├── .DS_Store ├── .gitignore ├── Makefile ├── include ├── aacdec.h ├── aacenc.h ├── acodec.h ├── audio_aac_adp.h ├── autoconf.h ├── fisheye_calibrate.h ├── hi_ae_comm.h ├── hi_af_comm.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_dis.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_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_plugin.h ├── hi_resampler_api.h ├── hi_runtime_api.h ├── hi_runtime_comm.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_awb.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 ├── ringfifo.h ├── rtputils.h ├── rtspservice.h ├── rtsputils.h ├── securec.h ├── securectype.h ├── vdec_exp.h ├── vou_exp.h └── watchdog.h ├── loadbmp.c ├── loadbmp.h ├── main.c ├── ringfifo.c ├── rtputils.c ├── rtspservice.c ├── rtsputils.c ├── sample_comm.h ├── sample_comm_audio.c ├── sample_comm_isp.c ├── sample_comm_region.c ├── sample_comm_sys.c ├── sample_comm_vdec.c ├── sample_comm_venc.c ├── sample_comm_vi.c ├── sample_comm_vo.c ├── sample_comm_vpss.c ├── sample_venc.c └── si ├── rtsp-h264_imx335.IAB ├── rtsp-h264_imx335.IAD ├── rtsp-h264_imx335.IMB ├── rtsp-h264_imx335.IMD ├── rtsp-h264_imx335.PFI ├── rtsp-h264_imx335.PO ├── rtsp-h264_imx335.PR ├── rtsp-h264_imx335.PRI ├── rtsp-h264_imx335.PS ├── rtsp-h264_imx335.SearchResults └── rtsp-h264_imx335.WK3 /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinetd/hi3516dv300-rtsp-h264/9578ff95ac622804d0d15095b37dcb3d7ab57019/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | INCLUDE=-I./include/ 2 | 3 | LIBS=./lib/libmpi.a \ 4 | ./lib/lib_hiae.a \ 5 | ./lib/libisp.a \ 6 | ./lib/lib_hiawb.a \ 7 | ./lib/libhi_cipher.a \ 8 | ./lib/libVoiceEngine.a \ 9 | ./lib/libupvqe.a \ 10 | ./lib/libdnvqe.a \ 11 | ./lib/libive.a \ 12 | ./lib/libmd.a \ 13 | ./lib/libsecurec.a \ 14 | ./lib/lib_hidrc.a \ 15 | ./lib/lib_hildci.a \ 16 | ./lib/lib_hidehaze.a \ 17 | ./lib/libhdmi.a \ 18 | ./lib/libsns_imx335.a -lpthread -lm -ldl 19 | 20 | all:rtsp-h264 21 | 22 | rtsp-h264: 23 | arm-himix200-linux-gcc -o rtsp-h264 -Dhi3516dv300 -DSENSOR0_TYPE=SONY_IMX335_MIPI_5M_30FPS_12BIT -DSENSOR1_TYPE=SONY_IMX327_MIPI_2M_30FPS_12BIT -DHI_RELEASE -DHI_XXXX -DISP_V2 -DHI_ACODEC_TYPE_INNER -mcpu=arm926ej-s -mno-unaligned-access -fno-aggressive-loop-optimizations -ffunction-sections -fdata-sections main.c ringfifo.c rtputils.c rtspservice.c rtsputils.c loadbmp.c sample_comm_audio.c sample_comm_isp.c sample_comm_sys.c sample_comm_venc.c sample_comm_vi.c sample_comm_vo.c sample_comm_vpss.c sample_venc.c $(INCLUDE) $(LIBS) 24 | 25 | clean: 26 | rm -rfv rtsp-h264 27 | -------------------------------------------------------------------------------- /include/aacenc.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2004 - 2018, Hisilicon Tech. Co., Ltd. 3 | * ALL RIGHTS RESERVED 4 | * FileName: hi_spdif.h 5 | * Description: 6 | * 7 | * History: 8 | * Version Date Author DefectNum Description 9 | * 0.01 2006-11-01 z40717 NULL Create this file. 10 | * 11 | *****************************************************************************/ 12 | /** 13 | * \file 14 | * \brief Describes the information about AACENC. 15 | */ 16 | 17 | #ifndef _AACENC_H 18 | #define _AACENC_H 19 | 20 | #ifdef __cplusplus 21 | #if __cplusplus 22 | extern "C" { 23 | #endif /* __cpluscplus */ 24 | #endif /* __cpluscplus */ 25 | 26 | #include "hi_type.h" 27 | 28 | /********************************Macro Definition********************************/ 29 | /** \addtogroup AACENC */ 30 | /** @{ */ /** <--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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 (3) 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 (1) 38 | 39 | #define ISP_MAX_PHY_PIPE_NUM (4) 40 | #define ISP_MAX_VIR_PIPE_NUM (0) 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 (1) 47 | 48 | #define SENSOR_RES_WIDTH_MAX 4608 49 | #define SENSOR_RES_HEIGHT_MAX 4608 50 | #define ISP_RES_WIDTH_MAX 4608,3840,2048,2048 //need change when pipe num is change 51 | #define ISP_RES_HEIGHT_MAX 4608,3840,2048,2048 //need change when pipe num is change 52 | 53 | extern HI_U16 g_au16ResWMax[ISP_MAX_PIPE_NUM]; 54 | extern HI_U16 g_au16ResHMax[ISP_MAX_PIPE_NUM]; 55 | 56 | /* isp alg part */ 57 | #define HI_ISP_CLUT_LUT_LENGTH (5508) 58 | #define HI_ISP_CA_YRATIO_LUT_LENGTH (128) 59 | 60 | 61 | #define STATIC_DP_COUNT_NORMAL (2048) 62 | #define STATIC_DP_COUNT_MAX (STATIC_DP_COUNT_NORMAL * ISP_STRIPING_MAX_NUM) 63 | #define ISP_SUPPORT_OFFLINE_DPC_CALIBRATION (1) 64 | 65 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT0 (4096) 66 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT1 (4096) 67 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT2 (4096) 68 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT3 (4096) 69 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT4 (4096) 70 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT5 (4096) 71 | #define HI_ISP_SPECAWB_FACT_ELEMENT_LUT6 (4096) 72 | #define HI_ISP_SPECAWB_WB_CNVTBL_LUT (16384) 73 | #define HI_ISP_SPECAWB_KELDBB_LUT (16384) 74 | #define HI_ISP_SPECAWB_BBL_LUT (240) 75 | #define HI_ISP_SPECAWB_CAA_LUT1 (16384) 76 | #define HI_ISP_SPECAWB_CAA_LUT2 (16384) 77 | #define HI_ISP_SPECAWB_CAA_LUT3 (16384) 78 | #define ISP_SPECAWB_BUF_SIZE (110832) 79 | 80 | #define AWB_ZONE_BIN (1) 81 | #define AWB_LIB_NUM (ISP_MAX_PIPE_NUM) 82 | #define AE_LIB_NUM (ISP_MAX_PIPE_NUM) 83 | 84 | #define HI_ISP_SHARPEN_RGAIN (31) 85 | #define HI_ISP_SHARPEN_RGAIN_MAX (31) 86 | #define HI_ISP_SHARPEN_RGAIN_BIT (31) 87 | #define HI_ISP_SHARPEN_GGAIN (32) 88 | #define HI_ISP_SHARPEN_GGAIN_MAX (255) 89 | #define HI_ISP_SHARPEN_GGAIN_BIT (255) 90 | #define HI_ISP_SHARPEN_BGAIN (31) 91 | #define HI_ISP_SHARPEN_BGAIN_MAX (31) 92 | #define HI_ISP_SHARPEN_BGAIN_BIT (31) 93 | #define HI_ISP_SHARPEN_LUMAWGT_MAX (127) 94 | #define HI_ISP_SHARPEN_LUMAWGT (127) 95 | #define HI_ISP_SHARPEN_LUMAWGT_BIT (127) 96 | 97 | 98 | #define GAMMA_REG_NODE_NUM (257) 99 | #define GAMMA_OUTSEG_NUM (8) 100 | 101 | #define HI_ISP_DRC_STRENGTH_MAX (1023) 102 | #define HI_ISP_DRC_SPA_FLT_COEF_MAX (5) 103 | 104 | #define HI_ISP_DEMOSAIC_DETAIL_SMOOTH_RANGE_MAX (7) 105 | #define HI_ISP_DEMOSAIC_DETAIL_SMOOTH_RANGE_MIN (1) 106 | #define HI_ISP_DEMOSAIC_NONDIR_MFDETALEHC_STR_MAX (127) 107 | 108 | #define HI_ISP_LDCI_HEPOSWGT_MAX (255) 109 | #define HI_ISP_LDCI_HENEGWGT_MAX (255) 110 | #define HI_ISP_PREGAMMA_LUT_MAX (0xFFFFF) 111 | 112 | #define EXPANDER_NODE_NUM (257) 113 | 114 | #define DEFOG_ZONE_ROW (32) 115 | #define DEFOG_ZONE_COLUMN (32) 116 | #define DEFOG_ZONE_NUM (1024) 117 | #define DEFOG_MAX_ZONE_NUM (1024) 118 | 119 | #define HI_ISP_LSC_MESHSTR_MAX (65535) 120 | #define HI_ISP_LSC_DEFAULT_MESH_STRENGTH (4096) 121 | #define HI_ISP_LSC_DEFAULT_WEIGHT (256) 122 | #define HI_ISP_LSC_GRID_COL (33) 123 | #define HI_ISP_LSC_GRID_ROW (33) 124 | #define HI_ISP_LSC_GRID_POINTS (HI_ISP_LSC_GRID_COL * HI_ISP_LSC_GRID_ROW) 125 | #define HI_ISP_LSC_DEFAULT_MESH_SCALE (4) 126 | #define HI_ISP_LSC_XGRID_WIDTH_MAX(x) ((x) / 4 - 60) 127 | #define HI_ISP_LSC_YGRID_WIDTH_MAX(x) ((x) / 4 - 60) 128 | 129 | #define AF_GAMMA_VALUE_MAX (6) 130 | #define HI_EXT_SYSTEM_MANUAL_DEHAZE_HBLK_DEFAULT (32) 131 | #define HI_EXT_SYSTEM_MANUAL_DEHAZE_VBLK_DEFAULT (32) 132 | 133 | #define HI_ISP_CR_SLOPE_MAX (14) 134 | #define HI_ISP_CR_THR_MAX (16383) 135 | #define HI_ISP_CR_NPOFFSET_MAX (16383) 136 | #define HI_ISP_CR_NPOFFSET_MIN (512) 137 | #ifdef __cplusplus 138 | #if __cplusplus 139 | } 140 | #endif 141 | #endif /* End of #ifdef __cplusplus */ 142 | 143 | #endif /* __HI_ISP_DEFINES_H__ */ 144 | -------------------------------------------------------------------------------- /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_*/ -------------------------------------------------------------------------------- /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_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_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 | BURST_MODE = 0x0, 45 | NON_BURST_MODE_SYNC_PULSES = 0x1, 46 | NON_BURST_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 | -------------------------------------------------------------------------------- /include/hi_plugin.h: -------------------------------------------------------------------------------- 1 | #ifndef __HI_PLUGIN_TYPE_H__ 2 | #define __HI_PLUGIN_TYPE_H__ 3 | 4 | #include "hi_type.h" 5 | 6 | #if defined(_MSC_VER) 7 | #define EXPORT __declspec(dllexport) 8 | #elif defined(__GNUC__) 9 | #define EXPORT __attribute__((visibility("default"))) 10 | #else 11 | #define EXPORT 12 | #pragma warning cant export dynamic symbos 13 | #endif 14 | 15 | #ifdef __cplusplus 16 | #if __cplusplus 17 | extern "C" { 18 | #endif 19 | #endif /* __cplusplus */ 20 | 21 | #define MAX_OPERAND_NAME_LEN (64) 22 | 23 | typedef struct hiNodePlugin_Shape_S 24 | { 25 | HI_S32 s32H; 26 | HI_S32 s32W; 27 | HI_S32 s32C; 28 | } HI_NodePlugin_Shape_S; 29 | 30 | typedef enum hiNodePlugin_ElemType_E 31 | { 32 | ELEM_TYPE_U8, 33 | ELEM_TYPE_U16, 34 | ELEM_TYPE_U32 35 | } HI_NodePlugin_ElemType_E; 36 | 37 | typedef struct hiNodePlugin_Operand_S 38 | { 39 | HI_U64 u64Offset; // addr 40 | HI_CHAR mName[MAX_OPERAND_NAME_LEN + 1]; 41 | HI_NodePlugin_ElemType_E enElemType; 42 | HI_U32 u32Num; 43 | HI_U32 u32Stride; 44 | HI_NodePlugin_Shape_S stShape; 45 | } HI_NodePlugin_Operand_S; 46 | 47 | typedef struct HiNodeParam 48 | { 49 | HI_VOID* pParam; 50 | HI_U32 u32Size; 51 | } HI_NodePlugin_NodeParam_S; 52 | 53 | typedef HI_S32 (*NodePluginCompute)(const HI_NodePlugin_Operand_S*, HI_U32, HI_NodePlugin_Operand_S*, HI_U32, HI_NodePlugin_NodeParam_S*, HI_NodePlugin_NodeParam_S*); 54 | 55 | typedef HI_S32 (*NodePluginGetType)(HI_CHAR pszNodeType[], const HI_U32 u32Length); 56 | 57 | EXPORT HI_S32 HI_NodePlugin_Compute(const HI_NodePlugin_Operand_S* pstInputs, HI_U32 u32InputNum, 58 | HI_NodePlugin_Operand_S* pstOutputs, HI_U32 u32Outputs, HI_NodePlugin_NodeParam_S* pstHyperParam, HI_NodePlugin_NodeParam_S* pstTrainingParam); 59 | 60 | EXPORT HI_S32 HI_NodePlugin_getNodeType(HI_CHAR pszNodeType[], const HI_U32 u32Length); 61 | 62 | #ifdef __cplusplus 63 | #if __cplusplus 64 | } 65 | #endif 66 | #endif /* __cplusplus */ 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /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 | #ifndef HI_ERR_RESAMPLE_PREFIX 13 | #define HI_ERR_RESAMPLE_PREFIX 0x80000000 14 | #endif 15 | 16 | /* input handle is invalid */ 17 | #define HI_ERR_RESAMPLE_HANDLE (HI_ERR_RESAMPLE_PREFIX | 0x0001) 18 | 19 | /* pcm circ buffer state is invalid */ 20 | #define HI_ERR_RESAMPLE_PCMBUF (HI_ERR_RESAMPLE_PREFIX | 0x0002) 21 | 22 | /* input sample number is more than MAXFRAMESIZE or input buffer size 23 | , or input sample number is not invalid (eg. even)*/ 24 | #define HI_ERR_RESAMPLE_SAMPLE_NUMBER (HI_ERR_RESAMPLE_PREFIX | 0x0003) 25 | 26 | /* output pcm buffer space is not enough */ 27 | #define HI_ERR_RESAMPLE_OUTPCM_SPACE (HI_ERR_RESAMPLE_PREFIX | 0x0004) 28 | 29 | /* the channels of input pcm is invalid */ 30 | #define HI_ERR_PCM_CHANNEL (HI_ERR_RESAMPLE_PREFIX | 0x0005) 31 | 32 | /* the bit width of input pcm is invalid */ 33 | #define HI_ERR_PCM_FORMAT (HI_ERR_RESAMPLE_PREFIX | 0x0006) 34 | 35 | /* invalid bypass flag */ 36 | #define HI_ERR_INVALID_BYPASSFLAG (HI_ERR_RESAMPLE_PREFIX | 0x0007) 37 | 38 | /* error unknown */ 39 | #define HI_ERR_UNKNOWN (HI_ERR_RESAMPLE_PREFIX | 0x0008) 40 | 41 | /* input Empty pointer*/ 42 | #define HI_ERR_INPUT_EMPTY_POINTER (HI_ERR_RESAMPLE_PREFIX | 0x0009) 43 | 44 | /************************************************************************************** 45 | * Function: HI_Resampler_Create 46 | * 47 | * Description: allocate memory for platform-specific data 48 | * clear all the user-accessible fields 49 | * 50 | * Inputs: inrate: 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 51 | * outrate: 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 52 | * chans: 1 or 2 53 | * Outputs: none 54 | * 55 | * Return: handle to Resampler instance, 0 if malloc fails 56 | **************************************************************************************/ 57 | HI_VOID* HI_Resampler_Create(HI_S32 s32Inrate, HI_S32 s32Outrate, HI_S32 s32Chans); 58 | 59 | 60 | /************************************************************************************** 61 | * Function: HI_Resampler_Process 62 | * 63 | * Description: Resample pcm data to specific samplerate, only for interlaced format 64 | * 65 | * Inputs: inst: valid Resampler instance pointer (HResampler) 66 | * inbuf: pointer to inputbuf 67 | * insamps: input number of sample pointers 68 | * Outputs: outbuf: pointer to outputbuf 69 | * 70 | * Return: output sample number per-channel 71 | * Notes: sure insamps < MAXFRAMESIZE 72 | 73 | 74 | **************************************************************************************/ 75 | HI_S32 HI_Resampler_Process(HI_VOID* inst, HI_S16* s16Inbuf, HI_S32 s32Insamps, HI_S16* s16Outbuf); 76 | 77 | 78 | /************************************************************************************** 79 | * Function: HI_Resampler_Destroy 80 | * 81 | * Description: free platform-specific data allocated by ResamplerCreate 82 | * 83 | * Inputs: valid Resampler instance pointer (HResampler) 84 | * Outputs: none 85 | * 86 | * Return: none 87 | **************************************************************************************/ 88 | HI_VOID HI_Resampler_Destroy(HI_VOID* inst); 89 | 90 | 91 | /******************************************************************************* 92 | * Function: HI_Resampler_GetMaxOutputNum 93 | * 94 | * Description: Caculate max output number at specific input number 95 | * 96 | * Inputs: inst: valid Resampler instance pointer (HI_HANDLE) 97 | * insamps: input data number per-channel, insamps must be even 98 | * Outputs: none 99 | * Return: >=0: Success, return the max output number per-channel 100 | * other: Fail, return error code 101 | * Notes: 102 | * 1 if stereo(chans==2), sure insamps%2 == 0 103 | ******************************************************************************/ 104 | HI_S32 HI_Resampler_GetMaxOutputNum(HI_VOID* inst, HI_S32 s32Insamps); 105 | 106 | 107 | #ifdef __cplusplus 108 | } 109 | #endif 110 | 111 | 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /include/hi_runtime_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __HI_RUNTIME_API__ 2 | #define __HI_RUNTIME_API__ 3 | 4 | #include "hi_type.h" 5 | #include "hi_runtime_comm.h" 6 | 7 | #ifdef __cplusplus 8 | #if __cplusplus 9 | extern "C" { 10 | #endif 11 | #endif /* __cplusplus */ 12 | 13 | /***************************************************************************** 14 | * Prototype : HI_SVPRT_RUNTIME_Init 15 | * Description : Environment Init 16 | * Parameters : HI_CHAR *pszGlobalSetting GlobalSetting for runtime 17 | if NULL, use default 18 | HI_RUNTIME_MEM_CTRL_S *pstMemCtrl Memory Controll by alloc,flush,and free 19 | if NULL, use mmz 20 | * Return Value : HI_SUCCESS: Success; Error codes: Failure. 21 | *****************************************************************************/ 22 | HI_S32 HI_SVPRT_RUNTIME_Init(IN const HI_CHAR* pszGlobalSetting, IN HI_RUNTIME_MEM_CTRL_S *pstMemCtrl); 23 | 24 | /***************************************************************************** 25 | * Prototype : HI_SVPRT_RUNTIME_LoadModelGroupSync 26 | * Description : Load model 27 | * Parameters : HI_CHAR* pstModelGroupConfig Input Group Config 28 | HI_RUNTIME_GROUP_INFO_S* pstModelGroupAttr Group Info, such as wk,cop,connector 29 | HI_RUNTIME_GROUP_HANDLE* phGroupHandle output Group Handle 30 | * Return Value : HI_SUCCESS: Success; Error codes: Failure. 31 | *****************************************************************************/ 32 | HI_S32 HI_SVPRT_RUNTIME_LoadModelGroup(IN const HI_CHAR* pstModelGroupConfig, 33 | IN HI_RUNTIME_GROUP_INFO_S* pstModelGroupAttr, 34 | OUT HI_RUNTIME_GROUP_HANDLE* phGroupHandle); 35 | 36 | /***************************************************************************** 37 | * Prototype : HI_SVPRT_RUNTIME_ForwardGroupSync 38 | * Description : Perform prediction on input sample(s), and output responses for corresponding sample(s), Sync Fuction 39 | * Parameters : HI_RUNTIME_GROUP_HANDLE phGroupHandle Group Handle generated by HI_SVPRT_RUNTIME_LoadModelGroup 40 | * HI_RUNTIME_GROUP_SRC_BLOB_ARRAY_PTR pstSrc Input Blobs 41 | * HI_RUNTIME_GROUP_DST_BLOB_ARRAY_PTR pstDst Output Blobs. 42 | * Return Value: HI_SUCCESS: Success; Error codes: Failure. 43 | *****************************************************************************/ 44 | HI_S32 HI_SVPRT_RUNTIME_ForwardGroupSync(IN const HI_RUNTIME_GROUP_HANDLE hGroupHandle, IN const HI_RUNTIME_GROUP_SRC_BLOB_ARRAY_PTR pstSrc, OUT HI_RUNTIME_GROUP_DST_BLOB_ARRAY_PTR pstDst, IN HI_U64 u64SrcId); 45 | 46 | /***************************************************************************** 47 | * Prototype : HI_SVPRT_RUNTIME_ForwardGroupASync 48 | * Description : Perform prediction on input sample(s), and output responses for corresponding sample(s),ASync Function 49 | * Parameters : HI_RUNTIME_GROUP_HANDLE phGroupHandle Group Handle generated by HI_SVPRT_RUNTIME_LoadModelGroup 50 | can't be NULL 51 | * HI_RUNTIME_GROUP_SRC_BLOB_ARRAY_PTR pstSrc Input Blobs 52 | * HI_RUNTIME_GROUP_DST_BLOB_ARRAY_PTR pstDst Output Blobs. 53 | * HI_U64 u64SrcId Frame id set by user, 54 | * can be duplicate number 55 | * HI_RUNTIME_Forward_CallBack pCbFun Callback for ForwardGroup, 56 | * can't be null 57 | * Return Value: HI_SUCCESS: Success; Error codes: Failure. 58 | *****************************************************************************/ 59 | HI_S32 HI_SVPRT_RUNTIME_ForwardGroupASync(IN const HI_RUNTIME_GROUP_HANDLE hGroupHandle, IN const HI_RUNTIME_GROUP_SRC_BLOB_ARRAY_PTR pstSrc, OUT HI_RUNTIME_GROUP_DST_BLOB_ARRAY_PTR pstDst, IN HI_U64 u64SrcId, IN HI_RUNTIME_Forward_Callback pCbFun); 60 | 61 | /***************************************************************************** 62 | * Prototype : HI_SVPRT_RUNTIME_UnloadModel 63 | * Description : Unload model 64 | * Parameters : HI_RUNTIME_GROUP_HANDLE phGroupHandle Group Handle generated by HI_SVPRT_RUNTIME_LoadModelGroup 65 | * can not be NULL 66 | * 67 | * Return Value : HI_SUCCESS: Success; Error codes: Failure. 68 | *****************************************************************************/ 69 | HI_S32 HI_SVPRT_RUNTIME_UnloadModelGroup(IN const HI_RUNTIME_GROUP_HANDLE hGroupHandle); 70 | 71 | /***************************************************************************** 72 | * Prototype : HI_SVPRT_RUNTIME_deInit 73 | * Description : Environment DeInit 74 | * Return Value : HI_SUCCESS: Success; Error codes: Failure. 75 | *****************************************************************************/ 76 | HI_S32 HI_SVPRT_RUNTIME_DeInit(); 77 | 78 | #ifdef __cplusplus 79 | #if __cplusplus 80 | } 81 | #endif 82 | #endif /* __cplusplus */ 83 | 84 | #endif /* __HI_RUNTIME_API__ */ 85 | -------------------------------------------------------------------------------- /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 stSnsImx327_2l_Obj; 76 | extern ISP_SNS_OBJ_S stSnsImx334Obj; 77 | extern ISP_SNS_OBJ_S stSnsOV2718Obj; 78 | extern ISP_SNS_OBJ_S stSnsAr0237Obj; 79 | 80 | extern ISP_SNS_OBJ_S stSnsCmv50000Obj; 81 | extern ISP_SNS_OBJ_S stSnsImx277SlvsObj; 82 | extern ISP_SNS_OBJ_S stSnsImx117Obj; 83 | extern ISP_SNS_OBJ_S stSnsImx290SlaveObj; 84 | extern ISP_SNS_OBJ_S stSnsImx334SlaveObj; 85 | extern ISP_SNS_OBJ_S stSnsImx226Obj; 86 | extern ISP_SNS_OBJ_S stSnsImx335Obj; 87 | extern ISP_SNS_OBJ_S stSnsImx307Obj; 88 | extern ISP_SNS_OBJ_S stSnsImx307_2l_Obj; 89 | extern ISP_SNS_OBJ_S stSnsImx458Obj; 90 | extern ISP_SNS_OBJ_S stSnsSc4236Obj; 91 | extern ISP_SNS_OBJ_S stSnsOs05aObj; 92 | extern ISP_SNS_OBJ_S stSnsOs05a_2lObj; 93 | 94 | #define CMOS_CHECK_POINTER(ptr)\ 95 | do {\ 96 | if (HI_NULL == ptr)\ 97 | {\ 98 | ISP_TRACE(HI_DBG_ERR, "Null Pointer!\n");\ 99 | return HI_ERR_ISP_NULL_PTR;\ 100 | }\ 101 | }while(0) 102 | 103 | #define CMOS_CHECK_POINTER_VOID(ptr)\ 104 | do {\ 105 | if (HI_NULL == ptr)\ 106 | {\ 107 | ISP_TRACE(HI_DBG_ERR, "Null Pointer!\n");\ 108 | return;\ 109 | }\ 110 | }while(0) 111 | 112 | #define SENSOR_FREE(ptr)\ 113 | do{\ 114 | if (HI_NULL != ptr)\ 115 | {\ 116 | free(ptr);\ 117 | ptr = HI_NULL;\ 118 | }\ 119 | } while (0) 120 | 121 | 122 | #ifdef __cplusplus 123 | #if __cplusplus 124 | } 125 | #endif 126 | #endif /* End of #ifdef __cplusplus */ 127 | 128 | #endif /* __HI_SNS_CTRL_H__ */ 129 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | /** @} */ /**