├── .gitignore ├── Makefile ├── Makefile.linux.param ├── Makefile.param ├── README.md ├── linux.mak └── svp ├── README.md └── multi-core ├── .vscode ├── c_cpp_properties.json ├── launch.json ├── settings.json └── tasks.json ├── Makefile ├── Makefile.param ├── compile.sh ├── dsp ├── Makefile ├── encapsulation │ ├── include │ │ └── sample_dsp_enca.h │ └── src │ │ └── sample_dsp_enca.c ├── sample │ ├── sample_dsp.c │ └── sample_dsp_main.h └── sample_dsp_main.c ├── hirt ├── Makefile ├── Makefile.plugin.proposal ├── Makefile.plugin.proposal_without_permute ├── include │ ├── sample_runtime_classify.h │ ├── sample_runtime_define.h │ ├── sample_runtime_detection_rfcn.h │ ├── sample_runtime_detection_ssd.h │ ├── sample_runtime_group_rfcnalex.h │ └── sample_runtime_group_tracker.h ├── plugins │ ├── proposal │ │ ├── detectionCom.c │ │ ├── detectionCom.h │ │ └── hi_plugin_proposal.c │ └── proposal_without_permute │ │ ├── detectionCom.c │ │ ├── detectionCom.h │ │ └── hi_plugin_proposal.c ├── readme.txt └── src │ ├── alexnet.modelgroup │ ├── main.c │ ├── rfcn.modelgroup │ ├── rfcn_alexnet.modelgroup │ ├── rfcn_goturn_alexnet_tracker.modelgroup │ ├── sample_runtime_classify.c │ ├── sample_runtime_detection_rfcn.c │ ├── sample_runtime_detection_ssd.c │ ├── sample_runtime_group_rfcnalex.c │ ├── sample_runtime_group_tracker.c │ └── ssd.modelgroup ├── ive ├── Makefile ├── sample │ ├── sample_ive_ann.c │ ├── sample_ive_bg_model.c │ ├── sample_ive_canny.c │ ├── sample_ive_cnn.c │ ├── sample_ive_gmm.c │ ├── sample_ive_gmm2.c │ ├── sample_ive_main.h │ ├── sample_ive_md.c │ ├── sample_ive_od.c │ ├── sample_ive_sobel_with_cached_mem.c │ ├── sample_ive_st_and_lk.c │ ├── sample_ive_svm.c │ └── sample_ive_test_memory.c └── sample_ive_main.c ├── nnie ├── Makefile ├── sample │ ├── sample_nnie.c │ └── sample_nnie_main.h ├── sample_nnie_main.cpp ├── sample_nnie_main1.cbak └── sample_nnie_software │ ├── sample_svp_nnie_software.c │ └── sample_svp_nnie_software.h ├── nnie_makefile展开 ├── opencv └── test_opencv │ ├── cat.jpg │ ├── main │ ├── main.cpp │ ├── main.o │ └── makefile ├── tmp_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_hdr.h ├── hi_comm_isp.h ├── hi_comm_ive.h ├── hi_comm_pciv.h ├── hi_comm_photo.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_mcc_usrdev.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 ├── isp_dehaze.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_hdr.h ├── mpi_isp.h ├── mpi_ive.h ├── mpi_nnie.h ├── mpi_pciv.h ├── mpi_photo.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 ├── securec.h ├── securectype.h ├── vdec_exp.h ├── vou_exp.h └── watchdog.h └── 时间测试 /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | vio/ 3 | 4 | vgs/ 5 | 6 | venc/ 7 | 8 | vdec_heterogeneous/ 9 | 10 | vdec/ 11 | 12 | uvc_app/ 13 | 14 | traffic_capture/ 15 | 16 | tde/ 17 | 18 | snap/ 19 | 20 | scene_auto/ 21 | 22 | photo/ 23 | 24 | mode_switch/ 25 | 26 | pciv/ 27 | 28 | lsc_online_cali/ 29 | 30 | liteos/ 31 | 32 | hifb/ 33 | 34 | gpu/ 35 | 36 | fisheye/ 37 | 38 | dpu/ 39 | 40 | dis/ 41 | 42 | common/ 43 | 44 | awb_online_calibration/ 45 | 46 | avs/ 47 | 48 | audio/ 49 | 50 | liteos.mak 51 | 52 | How to compile.txt 53 | 54 | svp/single/ 55 | 56 | svp/big-little/ 57 | 58 | svp/multi-core/opencv/makefile_test/ 59 | 60 | svp/multi-core/opencv/test_opencv/canny.jpg 61 | 62 | svp/multi-core/nnie/data/ 63 | 64 | svp/multi-core/ive/data/ 65 | 66 | *.wk 67 | 68 | svp/multi-core/hirt/resource/ 69 | 70 | svp/multi-core/dsp/dsp_bin/ 71 | 72 | *.o 73 | 74 | svp/multi-core/nnie/sample_nnie_main 75 | 76 | svp/multi-core/nnie/out/canny.jpg 77 | 78 | *.modelgroup 79 | 80 | svp/multi-core/hirt/sample_runtime_release 81 | 82 | *.so 83 | 84 | svp/multi-core/ive/ 85 | 86 | svp/multi-core/dsp/ 87 | 88 | svp/multi-core/tmp_include/opencv2/ 89 | 90 | svp/multi-core/tmp_include/opencv/ 91 | 92 | 93 | *.tar 94 | *.tar.gz 95 | 96 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: linux lite linuxclean liteclean linux_svp svp_clean 3 | 4 | linux: 5 | cp ../cfg.mak.multicore ../cfg.mak 6 | @cd vio; make 7 | @cd vdec; make 8 | @cd venc; make 9 | @cd avs; make 10 | @cd fisheye; make 11 | @cd dis; make 12 | @cd hifb; make 13 | @cd audio; make 14 | @cd snap; make 15 | @cd vgs; make 16 | @cd tde; make 17 | @cd mode_switch; make 18 | @cd scene_auto; make 19 | @cd dpu; make 20 | @cd svp/multi-core; make 21 | @cd gpu; make 22 | @cd lsc_online_cali; make 23 | @cd awb_online_calibration; make 24 | @cd traffic_capture; make 25 | @cd pciv; make host 26 | @cd pciv; make slave 27 | 28 | linux_svp: 29 | #只编译svp 30 | cp ../cfg.mak.multicore ../cfg.mak 31 | @cd svp/multi-core; make 32 | 33 | nnie_clean: 34 | #只清空nnie的编译 35 | cp ../cfg.mak.multicore ../cfg.mak 36 | @cd svp/multi-core/nnie; make clean 37 | 38 | linuxclean: 39 | cp ../cfg.mak.multicore ../cfg.mak 40 | @cd vio; make clean 41 | @cd vdec; make clean 42 | @cd venc; make clean 43 | @cd avs; make clean 44 | @cd fisheye; make clean 45 | @cd dis; make clean 46 | @cd hifb; make clean 47 | @cd audio; make clean 48 | @cd snap; make clean 49 | @cd vgs; make clean 50 | @cd tde; make clean 51 | @cd mode_switch; make clean 52 | @cd scene_auto; make clean 53 | @cd dpu; make clean 54 | @cd svp/multi-core; make clean 55 | @cd gpu; make clean 56 | @cd lsc_online_cali; make clean 57 | @cd awb_online_calibration; make clean 58 | @cd traffic_capture; make clean 59 | @cd pciv; make clean 60 | lite: 61 | cp ../cfg.mak.single ../cfg.mak 62 | @cd vio; make 63 | @cd vdec; make 64 | @cd venc; make 65 | @cd avs; make 66 | @cd fisheye; make 67 | @cd dis; make 68 | @cd audio; make 69 | @cd snap; make 70 | @cd vgs; make 71 | @cd dpu; make 72 | @cd svp/single; make 73 | @cd mode_switch; make 74 | @cd lsc_online_cali; make 75 | @cd awb_online_calibration; make 76 | @cd svp/big-little; make 77 | liteclean: 78 | cp ../cfg.mak.single ../cfg.mak 79 | @cd vio; make clean 80 | @cd vdec; make clean 81 | @cd venc; make clean 82 | @cd avs; make clean 83 | @cd fisheye; make clean 84 | @cd dis; make clean 85 | @cd audio; make clean 86 | @cd snap; make clean 87 | @cd vgs; make clean 88 | @cd dpu; make clean 89 | @cd svp/single; make clean 90 | @cd mode_switch; make clean 91 | @cd lsc_online_cali; make clean 92 | @cd awb_online_calibration; make clean 93 | @cd svp/big-little; make clean 94 | 95 | -------------------------------------------------------------------------------- /Makefile.linux.param: -------------------------------------------------------------------------------- 1 | 2 | # use C01 to indicate uclibc, C02 to indicate glibc, C00 to indicate FPGA. 3 | ifeq ($(FPGA), y) 4 | export CVER?=.C$(DBG_FLAG)0 5 | else ifeq ($(LIBC),glibc) 6 | export CVER?=.C$(DBG_FLAG)2 7 | else 8 | export CVER?=.C$(DBG_FLAG)1 9 | endif 10 | 11 | ifeq ($(HIARCH), $(filter $(HIARCH),hi3519av100 hi3516cv500)) 12 | ifeq ($(ARM_ARCH), smp) 13 | POSTFIX:=-smp 14 | else 15 | POSTFIX:= 16 | endif 17 | endif 18 | 19 | ############################################################################## 20 | # Allocated the kernel position 21 | ifeq ($(MPP_BUILD), y) 22 | ifeq ($(HIARCH),$(filter $(HIARCH), hi3559av100es hi3559av100)) 23 | export KERNEL_ROOT?=$(HIWORK_PATH)/osdrv$(HIARCH)$(CVER)/opensource/kernel/$(KERNEL_NAME)_$(CPU_TYPE) 24 | else ifeq ($(HIARCH),$(filter $(HIARCH), hi3519av100)) 25 | export KERNEL_ROOT?=$(HIWORK_PATH)/osdrv$(HI_SUBARCH)$(CVER)/opensource/kernel/$(KERNEL_NAME)$(POSTFIX) 26 | else 27 | export KERNEL_ROOT?=$(HIWORK_PATH)/osdrv$(HIARCH)$(CVER)/opensource/kernel/$(KERNEL_NAME)$(POSTFIX) 28 | endif 29 | else 30 | ifeq ($(HIARCH),$(filter $(HIARCH), hi3559av100es hi3559av100)) 31 | export KERNEL_ROOT?=$(SDK_PATH)/osdrv/opensource/kernel/$(KERNEL_NAME)_$(CPU_TYPE) 32 | else 33 | export KERNEL_ROOT?=$(SDK_PATH)/../../osdrv/opensource/kernel/$(KERNEL_NAME)$(POSTFIX) 34 | endif 35 | endif 36 | 37 | OSDRV_PATH:=$(KERNEL_ROOT)/../../.. 38 | 39 | ############################################################################## 40 | 41 | # Define cross compiler,添加c/cpp混合编译 42 | 43 | export CC:=$(CROSS)gcc 44 | export AR:=$(CROSS)ar 45 | export CXX:=$(CROSS)g++ 46 | 47 | export REL_INC := $(REL_DIR)/include 48 | export REL_LIB := $(REL_DIR)/lib 49 | export REL_KO := $(REL_DIR)/ko 50 | export REL_OBJ := $(REL_DIR)/obj 51 | export REL_INI := $(REL_DIR)/init 52 | 53 | LIBS_LD_CFLAGS += -ldl 54 | MPP_CFLAGS += -Wno-date-time 55 | DRV_CFLAGS += -Wno-date-time 56 | -------------------------------------------------------------------------------- /Makefile.param: -------------------------------------------------------------------------------- 1 | # Hisilicon Hi35xx sample Makefile.param 2 | 3 | ifeq ($(PARAM_FILE), ) 4 | PARAM_FILE:=../../Makefile.param 5 | include $(PARAM_FILE) 6 | endif 7 | 8 | ################# select sensor type for your sample ############################### 9 | #### SONY_IMX477_MIPI_8M_30FPS_12BIT ################# 10 | #### SONY_IMX477_MIPI_8M_60FPS_12BIT ################# 11 | #### SONY_IMX477_MIPI_12M_30FPS_12BIT ################# 12 | #### SONY_IMX477_MIPI_9M_50FPS_10BIT ################# 13 | #### SONY_IMX477_MIPI_9M_60FPS_10BIT ################# 14 | #### SONY_IMX290_MIPI_2M_30FPS_12BIT ################# 15 | #### SONY_IMX290_MIPI_2M_30FPS_12BIT_WDR3TO1 ################# 16 | #### SONY_IMX334_SLAVE_MIPI_8M_30FPS_12BIT ################# 17 | #### SONY_IMX334_MIPI_8M_30FPS_12BIT ################# 18 | #### SONY_IMX334_MIPI_8M_30FPS_12BIT_WDR2TO1 ################# 19 | #### SONY_IMX277_SLVS_8M_120FPS_10BIT ################# 20 | #### SONY_IMX277_SLVS_8M_30FPS_12BIT ################# 21 | #### SONY_IMX277_SLVS_8M_60FPS_12BIT ################# 22 | #### SONY_IMX277_SLVS_12M_30FPS_12BIT ################# 23 | #### SONY_IMX277_SLVS_2M_240FPS_12BIT ################# 24 | 25 | SENSOR0_TYPE ?= SONY_IMX334_MIPI_8M_30FPS_12BIT 26 | SENSOR1_TYPE ?= SONY_IMX334_MIPI_8M_30FPS_12BIT 27 | SENSOR2_TYPE ?= SONY_IMX334_MIPI_8M_30FPS_12BIT 28 | SENSOR3_TYPE ?= SONY_IMX334_MIPI_8M_30FPS_12BIT 29 | SENSOR4_TYPE ?= SONY_IMX277_SLVS_8M_30FPS_12BIT 30 | SENSOR5_TYPE ?= SONY_IMX277_SLVS_8M_30FPS_12BIT 31 | SENSOR6_TYPE ?= SONY_IMX277_SLVS_8M_30FPS_12BIT 32 | SENSOR7_TYPE ?= SONY_IMX277_SLVS_8M_30FPS_12BIT 33 | 34 | 35 | SENSOR_LIBS := $(REL_LIB)/lib_hiae.a 36 | SENSOR_LIBS += $(REL_LIB)/libisp.a 37 | SENSOR_LIBS += $(REL_LIB)/lib_hidehaze.a 38 | SENSOR_LIBS += $(REL_LIB)/lib_hidrc.a 39 | SENSOR_LIBS += $(REL_LIB)/lib_hildci.a 40 | SENSOR_LIBS += $(REL_LIB)/libsns_imx477.a 41 | #SENSOR_LIBS += $(REL_LIB)/libsns_imx299.a 42 | #SENSOR_LIBS += $(REL_LIB)/libsns_imx299_slvs.a 43 | SENSOR_LIBS += $(REL_LIB)/libsns_imx290.a 44 | SENSOR_LIBS += $(REL_LIB)/libsns_imx334.a 45 | SENSOR_LIBS += $(REL_LIB)/libsns_imx334_slave.a 46 | SENSOR_LIBS += $(REL_LIB)/libsns_imx277_slvs.a 47 | SENSOR_LIBS += $(REL_LIB)/lib_hiawb.a 48 | 49 | 50 | MPI_LIBS := $(REL_LIB)/libmpi.a 51 | MPI_LIBS += $(REL_LIB)/libhdmi.a 52 | MPI_LIBS += $(REL_LIB)/libdpu_rect.a 53 | MPI_LIBS += $(REL_LIB)/libdpu_match.a 54 | MPI_LIBS += $(REL_LIB)/libhiavslut.a 55 | MPI_LIBS += $(REL_LIB)/libpos_query.a 56 | 57 | ifeq ($(CONFIG_HI_MOTIONFUSION_SUPPORT), y) 58 | MPI_LIBS += $(REL_LIB)/libmotionfusion.a 59 | endif 60 | 61 | ifeq ($(CONFIG_HI_MONO_COLOR_FUSION_SUPPORT),y) 62 | MPI_LIBS += $(REL_LIB)/libmcf.a 63 | endif 64 | 65 | COMMON_DIR ?= $(PWD)/../common 66 | AUDIO_ADP_DIR ?= $(PWD)/../audio/adp 67 | 68 | INC_FLAGS := -I$(COMMON_DIR) 69 | INC_FLAGS += -I$(REL_INC) 70 | INC_FLAGS += -I$(AUDIO_ADP_DIR) 71 | INC_FLAGS += -I$(OSAL_ROOT)/include 72 | 73 | INC_FLAGS += -I$(SDK_PATH)/$(EXTDRV)/tlv320aic31 74 | INC_FLAGS += -I$(SDK_PATH)/$(EXTDRV)/motionsensor/motionsensor_mng 75 | INC_FLAGS += -I$(SDK_PATH)/$(EXTDRV)/motionsensor/motionsensor_chip/pub 76 | 77 | ISP_VERSION := ISP_V2 78 | CFLAGS += -Wall -g $(INC_FLAGS) -D$(HIARCH) -D$(HI_FPGA) -lpthread -lm -ldl -D$(ISP_VERSION) 79 | CFLAGS += -lstdc++ 80 | CFLAGS += -DSENSOR0_TYPE=$(SENSOR0_TYPE) 81 | CFLAGS += -DSENSOR1_TYPE=$(SENSOR1_TYPE) 82 | CFLAGS += -DSENSOR2_TYPE=$(SENSOR2_TYPE) 83 | CFLAGS += -DSENSOR3_TYPE=$(SENSOR3_TYPE) 84 | CFLAGS += -DSENSOR4_TYPE=$(SENSOR4_TYPE) 85 | CFLAGS += -DSENSOR5_TYPE=$(SENSOR5_TYPE) 86 | CFLAGS += -DSENSOR6_TYPE=$(SENSOR6_TYPE) 87 | CFLAGS += -DSENSOR7_TYPE=$(SENSOR7_TYPE) 88 | 89 | ################ select audio codec type for your sample ################ 90 | ACODEC_TYPE ?= ACODEC_TYPE_INNER 91 | #external acodec 92 | #ACODEC_TYPE ?= ACODEC_TYPE_TLV320AIC31 93 | INNER_HDMI ?= y 94 | 95 | ifeq ($(ACODEC_TYPE), ACODEC_TYPE_INNER) 96 | CFLAGS += -DHI_ACODEC_TYPE_INNER 97 | endif 98 | 99 | 100 | ifeq ($(ACODEC_TYPE), ACODEC_TYPE_TLV320AIC31) 101 | CFLAGS += -DHI_ACODEC_TYPE_TLV320AIC31 102 | endif 103 | 104 | ifeq ($(INNER_HDMI), y) 105 | CFLAGS += -DHI_ACODEC_TYPE_HDMI 106 | endif 107 | 108 | ######################################################################### 109 | 110 | CFLAGS += $(LIBS_CFLAGS) $(MPP_CFLAGS) 111 | 112 | COMM_SRC := $(wildcard $(COMMON_DIR)/*.c) 113 | 114 | #DEL_SRC := $(COMMON_DIR)/sample_comm_audio.c 115 | #DEL_SRC += $(COMMON_DIR)/sample_comm_ive.c 116 | #COMM_SRC := $(filter-out $(DEL_SRC), $(COMM_SRC)) 117 | 118 | COMM_OBJ := $(COMM_SRC:%.c=%.o) 119 | 120 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | sample 2 | -------------------------------------------------------------------------------- /linux.mak: -------------------------------------------------------------------------------- 1 | 2 | # target source 3 | OBJS := $(SRCS:%.c=%.o) 4 | OBJS := $(OBJS:%.cpp=%.o) 5 | CXXFLAGS=$(CFLAGS) 6 | 7 | .PHONY : clean all 8 | 9 | all: $(TARGET) 10 | 11 | $(TARGET):$(COMM_OBJ) $(OBJS) 12 | @$(CXX) $(CFLAGS) -lpthread -lm -o $@ $^ $(MPI_LIBS) $(SENSOR_LIBS) $(AUDIO_LIBA) $(REL_LIB)/libsecurec.a $(OPENCV_INCLUDE) $(OPENCV_LIB_DIR) $(OPENCV_LIBS) 13 | 14 | clean: 15 | @rm -f $(TARGET) 16 | @rm -f $(OBJS) 17 | @rm -f $(COMM_OBJ) 18 | 19 | cleanstream: 20 | @rm -f *.h264 21 | @rm -f *.h265 22 | @rm -f *.jpg 23 | @rm -f *.mjp 24 | @rm -f *.mp4 25 | -------------------------------------------------------------------------------- /svp/README.md: -------------------------------------------------------------------------------- 1 | svp 2 | -------------------------------------------------------------------------------- /svp/multi-core/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Linux", 5 | //如果需要递归包含,末尾加/**。 6 | "includePath": [ 7 | "${workspaceFolder}/**" 8 | ], 9 | "defines": [], 10 | "compilerPath": "/usr/bin/g++", 11 | "cStandard": "c11", 12 | "cppStandard": "c++17", 13 | "intelliSenseMode": "clang-x64" 14 | } 15 | ], 16 | "version": 4 17 | } -------------------------------------------------------------------------------- /svp/multi-core/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "(gdb) Launch", // 配置名称,将会在启动配置的下拉菜单中显示 6 | "type": "cppdbg", // 配置类型,cppdbg对应cpptools提供的调试功能;可以认为此处只能是cppdbg 7 | "request": "launch", //请求配置类型,可以为launch(启动)或attach(附加 8 | "program": "${workspaceFolder}/nnie/sample_nnie_main.o",//"${fileDirname}/${fileBasenameNoExtension}.exe", // 将要进行调试的程序的路径 9 | "args": [], // 程序调试时传递给程序的命令行参数,一般设为空即可 10 | "stopAtEntry": true, // 设为true时程序将暂停在程序入口处,相当于在main上打断点 11 | "cwd": "${workspaceFolder}", // 调试程序时的工作目录,此为工作区文件夹;改成${fileDirname}可变为文件所在目录 12 | "environment": [], // 环境变量 13 | "externalConsole": false, // 为true时使用单独的cmd窗口,与其它IDE一致;18年10月后设为false可调用VSC内置终端 14 | "MIMode": "gdb", // 如果不设为neverOpen,调试时会跳到“调试控制台”选项卡,你应该不需要对gdb手动输命令吧? 15 | "preLaunchTask": "my_cmake_compile", // 调试会话开始前执行的任务,一般为编译程序。与tasks.json的label相对应 16 | "setupCommands": [ 17 | { 18 | "description": "Enable pretty-printing for gdb", 19 | "text": "-enable-pretty-printing", 20 | "ignoreFailures": true 21 | } 22 | ] 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /svp/multi-core/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "debug_comm.h": "c" 4 | } 5 | } -------------------------------------------------------------------------------- /svp/multi-core/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "my_cmake_compile", // 任务名称,与launch.json的preLaunchTask相对应 6 | "type": "shell", 7 | "command": "bash", // 要使用的编译器,C++用clang++; 8 | "args": [ 9 | "./compile.sh" 10 | ], 11 | "type": "process", // process是vsc把预定义变量和转义解析后直接全部传给command;shell相当于先打开shell再输入命令,所以args还会经过shell再解析一遍 12 | "group": { 13 | "kind": "build", 14 | "isDefault": true // 不为true时ctrl shift B就要手动选择了 15 | } 16 | 17 | 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /svp/multi-core/Makefile: -------------------------------------------------------------------------------- 1 | rel: 2 | @cd ive; make 3 | @cd dsp; make 4 | @cd nnie; make 5 | @cd hirt; make 6 | clean: 7 | @cd ive; make clean 8 | @cd dsp; make clean 9 | @cd nnie; make clean 10 | @cd hirt; make clean 11 | cleanall: 12 | @cd ive; make clean; make cleanstream 13 | @cd dsp; make clean; make cleanstream 14 | @cd nnie; make clean; make cleanstream 15 | @cd hirt; make clean 16 | -------------------------------------------------------------------------------- /svp/multi-core/Makefile.param: -------------------------------------------------------------------------------- 1 | # Hisilicon Hi35xx sample Makefile.param 2 | export PARAM_FILE := ../../../../Makefile.param 3 | include $(PARAM_FILE) 4 | 5 | COMMON_DIR:=$(PWD)/../../../common 6 | AUDIO_ADP_DIR:=$(PWD)/../../../audio/adp 7 | 8 | include ../../../Makefile.param 9 | 10 | MPI_LIBS += $(REL_LIB)/libive.a 11 | MPI_LIBS += $(REL_LIB)/libmd.a 12 | MPI_LIBS += $(REL_LIB)/libdsp.a 13 | MPI_LIBS += $(REL_LIB)/libnnie.a 14 | 15 | CFLAGS += -I$(PWD)/../common 16 | 17 | -------------------------------------------------------------------------------- /svp/multi-core/compile.sh: -------------------------------------------------------------------------------- 1 | mkdir build 2 | cd build 3 | cmake .. 4 | make 5 | 6 | -------------------------------------------------------------------------------- /svp/multi-core/dsp/Makefile: -------------------------------------------------------------------------------- 1 | # Hisilicon Hi35xx sample Makefile 2 | include ../Makefile.param 3 | 4 | CFLAGS += -I$(PWD)/sample 5 | CFLAGS += -I$(PWD)/encapsulation/include 6 | 7 | SRCS := $(wildcard *.c) 8 | SRCS += $(wildcard ./sample/*.c) 9 | SRCS += $(wildcard ./encapsulation/src/*.c) 10 | SRCS += $(wildcard $(PWD)/../common/*.c) 11 | TARGET := sample_dsp_main 12 | 13 | # compile linux or HuaweiLite 14 | include $(PWD)/../../../$(OSTYPE).mak 15 | -------------------------------------------------------------------------------- /svp/multi-core/dsp/encapsulation/include/sample_dsp_enca.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2017, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : sample_dsp_enca.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2017/11/06 10 | Description : Encapsulate mpi by HI_MPI_SVP_DSP_RPC 11 | History : 12 | 1.Date : 2017/11/06 13 | Author : c00211359 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | #ifndef __SAMPLE_DSP_ENCA_H__ 18 | #define __SAMPLE_DSP_ENCA_H__ 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | #include "hi_dsp.h" 25 | 26 | /***************************************************************************** 27 | * Prototype : SAMPLE_SVP_DSP_ENCA_Dilate3x3 28 | * Description : Encapsulate Dilate 3x3 29 | * 30 | * Parameters : SVP_DSP_HANDLE *phHandle Handle 31 | * SVP_SRC_IMAGE_S *pstSrc Input image 32 | * SVP_DST_IMAGE_S *pstDst Output image 33 | * SVP_DSP_ID_E enDspId DSP Core ID. 34 | * SVP_DSP_PRI_E enPri Priority 35 | * SVP_MEM_INFO_S *pstAssistBuf Assist buffer 36 | * 37 | * Return Value : HI_SUCCESS: Success;Error codes: Failure. 38 | * Spec : 39 | * 40 | * History: 41 | * 42 | * 1. Date : 2017-11-06 43 | * Author : 44 | * Modification : Created function 45 | * 46 | ****************************************************************************/ 47 | HI_S32 SAMPLE_SVP_DSP_ENCA_Dilate3x3(SVP_DSP_HANDLE *phHandle,SVP_DSP_ID_E enDspId,SVP_DSP_PRI_E enPri, 48 | SVP_SRC_IMAGE_S *pstSrc,SVP_DST_IMAGE_S *pstDst,SVP_MEM_INFO_S *pstAssistBuf); 49 | 50 | /***************************************************************************** 51 | * Prototype : SAMPLE_SVP_DSP_ENCA_Erode3x3 52 | * Description : Encapsulate Erode 3x3 53 | * 54 | * Parameters : SVP_DSP_HANDLE *phHandle Handle 55 | * SVP_SRC_IMAGE_S *pstSrc Input image 56 | * SVP_DST_IMAGE_S *pstDst Output image 57 | * SVP_DSP_ID_E enDspId DSP Core ID. 58 | * SVP_DSP_PRI_E enPri Priority 59 | * SVP_MEM_INFO_S *pstAssistBuf Assist buffer 60 | * 61 | * Return Value : HI_SUCCESS: Success;Error codes: Failure. 62 | * Spec : 63 | * 64 | * History: 65 | * 66 | * 1. Date : 2017-11-06 67 | * Author : 68 | * Modification : Created function 69 | * 70 | ****************************************************************************/ 71 | HI_S32 SAMPLE_SVP_DSP_ENCA_Erode3x3(SVP_DSP_HANDLE *phHandle,SVP_DSP_ID_E enDspId,SVP_DSP_PRI_E enPri, 72 | SVP_SRC_IMAGE_S *pstSrc,SVP_DST_IMAGE_S *pstDst,SVP_MEM_INFO_S *pstAssistBuf); 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /svp/multi-core/dsp/encapsulation/src/sample_dsp_enca.c: -------------------------------------------------------------------------------- 1 | #include "sample_dsp_enca.h" 2 | #include "mpi_dsp.h" 3 | #include 4 | /***************************************************************************** 5 | * Prototype : SAMPLE_SVP_DSP_ENCA_Dilate3x3 6 | * Description : Encapsulate Dilate 3x3 7 | * 8 | * Parameters : SVP_DSP_HANDLE *phHandle Handle 9 | * SVP_SRC_IMAGE_S *pstSrc Input image 10 | * SVP_DST_IMAGE_S *pstDst Output image 11 | * SVP_DSP_ID_E enDspId DSP Core ID. 12 | * SVP_DSP_PRI_E enPri Priority 13 | * SVP_MEM_INFO_S *pstAssistBuf Assist buffer 14 | * 15 | * Return Value : HI_SUCCESS: Success;Error codes: Failure. 16 | * Spec : 17 | * 18 | * History: 19 | * 20 | * 1. Date : 2017-11-06 21 | * Author : 22 | * Modification : Created function 23 | * 24 | ****************************************************************************/ 25 | HI_S32 SAMPLE_SVP_DSP_ENCA_Dilate3x3(SVP_DSP_HANDLE *phHandle,SVP_DSP_ID_E enDspId,SVP_DSP_PRI_E enPri, 26 | SVP_SRC_IMAGE_S *pstSrc,SVP_DST_IMAGE_S *pstDst,SVP_MEM_INFO_S *pstAssistBuf) 27 | { 28 | SVP_DSP_MESSAGE_S stMsg = {0}; 29 | HI_U8 *pu8Tmp = NULL; 30 | /*Check parameter,But,we do not it in here*/ 31 | /*Fill Message*/ 32 | stMsg.u32CMD = SVP_DSP_CMD_DILATE_3X3; 33 | stMsg.u32MsgId = 0; 34 | stMsg.u64Body = pstAssistBuf->u64PhyAddr; 35 | stMsg.u32BodyLen = sizeof(SVP_SRC_IMAGE_S) + sizeof(SVP_DST_IMAGE_S); /*SRC + DST*/ 36 | 37 | pu8Tmp = (HI_U8*) pstAssistBuf->u64VirAddr; 38 | memcpy(pu8Tmp,pstSrc,sizeof(*pstSrc)); 39 | pu8Tmp += sizeof(*pstSrc); 40 | memcpy(pu8Tmp,pstDst,sizeof(*pstDst)); 41 | /*It must flush cache ,if the buffer pstAssistBuf.u64VirAddr malloc with cache!*/ 42 | return HI_MPI_SVP_DSP_RPC(phHandle,&stMsg, enDspId, enPri); 43 | } 44 | 45 | /***************************************************************************** 46 | * Prototype : SAMPLE_SVP_DSP_ENCA_Erode3x3 47 | * Description : Encapsulate Erode 3x3 48 | * 49 | * Parameters : SVP_DSP_HANDLE *phHandle Handle 50 | * SVP_SRC_IMAGE_S *pstSrc Input image 51 | * SVP_DST_IMAGE_S *pstDst Output image 52 | * SVP_DSP_ID_E enDspId DSP Core ID. 53 | * SVP_DSP_PRI_E enPri Priority 54 | * SVP_MEM_INFO_S *pstAssistBuf Assist buffer 55 | * 56 | * Return Value : HI_SUCCESS: Success;Error codes: Failure. 57 | * Spec : 58 | * 59 | * History: 60 | * 61 | * 1. Date : 2017-11-06 62 | * Author : 63 | * Modification : Created function 64 | * 65 | ****************************************************************************/ 66 | HI_S32 SAMPLE_SVP_DSP_ENCA_Erode3x3(SVP_DSP_HANDLE *phHandle,SVP_DSP_ID_E enDspId,SVP_DSP_PRI_E enPri, 67 | SVP_SRC_IMAGE_S *pstSrc,SVP_DST_IMAGE_S *pstDst,SVP_MEM_INFO_S *pstAssistBuf) 68 | { 69 | SVP_DSP_MESSAGE_S stMsg = {0}; 70 | HI_U8 *pu8Tmp = NULL; 71 | /*Check parameter,But,we do not it in here*/ 72 | /*Fill Message*/ 73 | stMsg.u32CMD = SVP_DSP_CMD_ERODE_3X3; 74 | stMsg.u32MsgId = 0; 75 | stMsg.u64Body = pstAssistBuf->u64PhyAddr; 76 | stMsg.u32BodyLen = sizeof(SVP_SRC_IMAGE_S) + sizeof(SVP_DST_IMAGE_S); /*SRC + DST*/ 77 | 78 | pu8Tmp = (HI_U8*) pstAssistBuf->u64VirAddr; 79 | memcpy(pu8Tmp,pstSrc,sizeof(*pstSrc)); 80 | pu8Tmp += sizeof(*pstSrc); 81 | memcpy(pu8Tmp,pstDst,sizeof(*pstDst)); 82 | /*It must flush cache ,if the buffer pstAssistBuf.u64VirAddr malloc with cache!*/ 83 | return HI_MPI_SVP_DSP_RPC(phHandle,&stMsg, enDspId, enPri); 84 | } 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /svp/multi-core/dsp/sample/sample_dsp_main.h: -------------------------------------------------------------------------------- 1 | #ifndef __SAMPLE_DSP_MAIN_H__ 2 | #define __SAMPLE_DSP_MAIN_H__ 3 | 4 | 5 | #ifdef __cplusplus 6 | #if __cplusplus 7 | extern "C"{ 8 | #endif 9 | #endif /* __cplusplus */ 10 | #include "hi_type.h" 11 | 12 | /* 13 | *Dilate sample 14 | */ 15 | HI_VOID SAMPLE_SVP_DSP_Dilate(HI_VOID); 16 | /* 17 | *Dilate single handle 18 | */ 19 | HI_VOID SAMPLE_SVP_DSP_DilateHandleSig(HI_VOID); 20 | 21 | #ifdef __cplusplus 22 | #if __cplusplus 23 | } 24 | #endif 25 | #endif /* __cplusplus */ 26 | 27 | 28 | #endif /* __SAMPLE_DSP_MAIN_H__ */ 29 | -------------------------------------------------------------------------------- /svp/multi-core/dsp/sample_dsp_main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "sample_dsp_main.h" 13 | 14 | /****************************************************************************** 15 | * function : dsp sample 16 | ******************************************************************************/ 17 | #ifdef __HuaweiLite__ 18 | int app_main(int argc, char *argv[]) 19 | { 20 | #else 21 | /****************************************************************************** 22 | * function : to process abnormal case 23 | ******************************************************************************/ 24 | HI_VOID SAMPLE_SVP_DSP_HandleSig(HI_S32 s32Signo) 25 | { 26 | if (SIGINT == s32Signo || SIGTERM == s32Signo) 27 | { 28 | SAMPLE_SVP_DSP_DilateHandleSig(); 29 | printf("\033[0;31mprogram termination abnormally!\033[0;39m\n"); 30 | } 31 | exit(-1); 32 | } 33 | int main(int argc, char *argv[]) 34 | { 35 | signal(SIGINT, SAMPLE_SVP_DSP_HandleSig); 36 | signal(SIGTERM, SAMPLE_SVP_DSP_HandleSig); 37 | #endif 38 | SAMPLE_SVP_DSP_Dilate(); 39 | } 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/Makefile: -------------------------------------------------------------------------------- 1 | include $(PWD)/../Makefile.param 2 | 3 | FLAGS := -O3 -Wall -fPIC -fstack-protector -fstack-check -Wl,-z,relro,-z,now -fvisibility=hidden 4 | export FLAGS 5 | 6 | CPPFLAGS += -I$(REL_INC) 7 | CPPFLAGS += -I$(PWD)/common/include 8 | CPPFLAGS += -I$(PWD)/include 9 | CPPFLAGS += $(FLAGS) 10 | CPPFLAGS += -DON_BOARD 11 | CPPFLAGS += $(LIBS_CFLAGS) 12 | 13 | ifeq (${HIARCH}, hi3559av100) 14 | CPPFLAGS += -DCHIP_3559A 15 | endif 16 | 17 | ifeq (${HIARCH}, hi3519av100) 18 | CPPFLAGS += -DCHIP_3519A 19 | endif 20 | 21 | SRCS := $(wildcard src/*.c) 22 | SRCS += $(wildcard common/src/*.c) 23 | TARGET := sample_runtime_release 24 | 25 | # target source 26 | OBJS := $(SRCS:%.c=%.o) 27 | 28 | .PHONY : all proposal clean 29 | 30 | all: proposal $(TARGET) 31 | 32 | 33 | proposal: 34 | make -f Makefile.plugin.proposal 35 | make -f Makefile.plugin.proposal_without_permute 36 | @mkdir -p $(REL_LIB) && cp plugins/proposal/*.so $(REL_LIB) -f 37 | @mkdir -p $(REL_LIB) && cp plugins/proposal_without_permute/*.so $(REL_LIB) -f 38 | @cp plugins/proposal/*.so . -f 39 | @cp plugins/proposal_without_permute/*.so . -f 40 | 41 | $(TARGET):$(OBJS) 42 | @cp $(PWD)/src/*.modelgroup $(PWD) 43 | $(CC) $(LIBS_LD_CFLAGS) -o $@ $^ -L$(REL_LIB) -Wl,-Bstatic -lsvpruntime -Wl,-Bdynamic -lpthread -lm -lstdc++ -L$(REL_LIB) -lnnie -ldl -lpthread -live -lsecurec -lmpi -ldnvqe -lupvqe -lVoiceEngine 44 | 45 | clean: 46 | @rm -f $(TARGET) 47 | @rm -f $(OBJS) 48 | @rm -rf *.so 49 | @rm -rf $(PWD)/*.modelgroup 50 | make clean -f Makefile.plugin.proposal 51 | make clean -f Makefile.plugin.proposal_without_permute 52 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/Makefile.plugin.proposal: -------------------------------------------------------------------------------- 1 | include $(PWD)/../Makefile.param 2 | 3 | PROPOSAL_COMPILE_DIR = $(PWD)/plugins/proposal 4 | 5 | CPPFLAGS += -I$(REL_INC) 6 | CPPFLAGS += -I$(PROPOSAL_COMPILE_DIR)/../../common/include 7 | CPPFLAGS += -I$(PROPOSAL_COMPILE_DIR)/include 8 | CPPFLAGS += -O3 9 | CPPFLAGS += -DON_BOARD 10 | CPPFLAGS += $(FLAGS) 11 | CPPFLAGS += $(LIBS_CFLAGS) 12 | 13 | SRCS := $(wildcard $(PROPOSAL_COMPILE_DIR)/*.c) 14 | SRCS += $(wildcard $(PROPOSAL_COMPILE_DIR)/../../common/src/sample_memory_ops.c) 15 | 16 | LIB_S := $(PROPOSAL_COMPILE_DIR)/libruntime_plugin_proposal.so 17 | 18 | # target source 19 | OBJS := $(SRCS:%.c=%.o) 20 | 21 | .PHONY : clean all 22 | 23 | all: target 24 | 25 | target:$(OBJS) 26 | @$(CC) $(LIBS_LD_CFLAGS) -shared -fPIC -o $(LIB_S) $(OBJS) 27 | 28 | clean: 29 | @rm -f $(LIB_S) 30 | @rm -f $(OBJS) 31 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/Makefile.plugin.proposal_without_permute: -------------------------------------------------------------------------------- 1 | include $(PWD)/../Makefile.param 2 | 3 | PROPOSAL_WITHOUT_PERMUTE_COMPILE_DIR = $(PWD)/plugins/proposal_without_permute 4 | 5 | CPPFLAGS += -I$(REL_INC) 6 | CPPFLAGS += -I$(PROPOSAL_WITHOUT_PERMUTE_COMPILE_DIR)/../../common/include 7 | CPPFLAGS += -I$(PROPOSAL_WITHOUT_PERMUTE_COMPILE_DIR)/include 8 | CPPFLAGS += -O3 9 | CPPFLAGS += -DON_BOARD 10 | CPPFLAGS += $(FLAGS) 11 | CPPFLAGS += $(LIBS_CFLAGS) 12 | 13 | SRCS := $(wildcard $(PROPOSAL_WITHOUT_PERMUTE_COMPILE_DIR)/*.c) 14 | SRCS += $(wildcard $(PROPOSAL_WITHOUT_PERMUTE_COMPILE_DIR)/../../common/src/sample_memory_ops.c) 15 | 16 | LIB_S := $(PROPOSAL_WITHOUT_PERMUTE_COMPILE_DIR)/libruntime_plugin_proposal_without_permute.so 17 | 18 | # target source 19 | OBJS := $(SRCS:%.c=%.o) 20 | 21 | .PHONY : clean all 22 | 23 | all: target 24 | 25 | target:$(OBJS) 26 | @$(CC) $(LIBS_LD_CFLAGS) -shared -fPIC -o $(LIB_S) $(OBJS) 27 | 28 | clean: 29 | @rm -f $(LIB_S) 30 | @rm -f $(OBJS) 31 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/include/sample_runtime_classify.h: -------------------------------------------------------------------------------- 1 | #ifndef __SAMPLE_RUNTIME_CLASSIFY_H 2 | #define __SAMPLE_RUNTIME_CLASSIFY_H 3 | #include "hi_type.h" 4 | 5 | HI_S32 SAMPLE_AlexNet(); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/include/sample_runtime_define.h: -------------------------------------------------------------------------------- 1 | #ifndef __SAMPLE_RUNTIME_DEFINE_H 2 | #define __SAMPLE_RUNTIME_DEFINE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | #ifdef ON_BOARD 10 | #define RESOURCE_DIR "./resource" 11 | #else 12 | #define RESOURCE_DIR "../resource" 13 | #endif 14 | 15 | #define MAX_ROI_NUM 300 16 | 17 | #if DEBUG 18 | #define sample_debug(...) \ 19 | do \ 20 | { \ 21 | printf(__VA_ARGS__); \ 22 | } while (0) 23 | #else 24 | #define sample_debug(...) 25 | #endif 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/include/sample_runtime_detection_rfcn.h: -------------------------------------------------------------------------------- 1 | #ifndef __SAMPLE_RUNTIME_H 2 | #define __SAMPLE_RUNTIME_H 3 | #include "hi_type.h" 4 | 5 | HI_S32 SAMPLE_RFCN(); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/include/sample_runtime_detection_ssd.h: -------------------------------------------------------------------------------- 1 | #ifndef __SAMPLE_RUNTIME_SSD_H 2 | #define __SAMPLE_RUNTIME_SSD_H 3 | #include "hi_type.h" 4 | 5 | HI_S32 SAMPLE_SSD(); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/include/sample_runtime_group_rfcnalex.h: -------------------------------------------------------------------------------- 1 | #ifndef __SAMPLE_RUNTIME_GROUP_RFCNALEX_H 2 | #define __SAMPLE_RUNTIME_GROUP_RFCNALEX_H 3 | #include "hi_type.h" 4 | 5 | HI_S32 SAMPLE_Model_Group_RFCNAlexNet(); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/include/sample_runtime_group_tracker.h: -------------------------------------------------------------------------------- 1 | #ifndef __SAMPLE_RUNTIME_GROUP_TRACKER_H 2 | #define __SAMPLE_RUNTIME_GROUP_TRACKER_H 3 | #include "hi_type.h" 4 | 5 | HI_S32 SAMPLE_Model_Group_RFCN_GOTURN_ALEXNET(HI_U64 u64StartFrame, HI_U64 u64EndFrame); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/readme.txt: -------------------------------------------------------------------------------- 1 | Runtime sample usage: 2 | 3 | Step 1: set LD_LIBRARY_PATH 4 | export LD_LIBRARY_PATH="xxx/mpp/out/linux/big-little/lib:$LD_LIBRARY_PATH" 5 | xxx is sdk package path. 6 | 7 | Step 2: compile sample code 8 | cd hirt; 9 | make; 10 | 11 | Step 3: run sample 12 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/src/alexnet.modelgroup: -------------------------------------------------------------------------------- 1 | name: "single_alexnet" 2 | priority: 1 3 | max_tmpbuf_size_mb: 1024 4 | 5 | input { 6 | name: "data" 7 | } 8 | 9 | model { 10 | name: "alexnet" 11 | bottom: {name: "data"} 12 | top: {name: "prob"} 13 | } 14 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "hi_runtime_api.h" 4 | #include "string.h" 5 | #include "sample_memory_ops.h" 6 | #ifdef ON_BOARD 7 | #include "mpi_sys.h" 8 | #include "mpi_vb.h" 9 | #else 10 | #include "hi_comm_svp.h" 11 | #include "hi_nnie.h" 12 | #include "mpi_nnie.h" 13 | #endif 14 | #include "math.h" 15 | #include "sample_log.h" 16 | #include "sample_save_blob.h" 17 | #include "sample_resize_roi.h" 18 | #include "sample_data_utils.h" 19 | #include "sample_runtime_classify.h" 20 | #include "sample_runtime_detection_rfcn.h" 21 | #include "sample_runtime_group_rfcnalex.h" 22 | #include "sample_runtime_detection_ssd.h" 23 | #include "sample_runtime_group_tracker.h" 24 | 25 | #if DEBUG 26 | #define sample_debug(...) \ 27 | do \ 28 | { \ 29 | printf(__VA_ARGS__); \ 30 | } while (0) 31 | #else 32 | #define sample_debug(...) 33 | #endif 34 | 35 | 36 | static void SAMPLE_RUNTIME_Usage(char* pchPrgName) 37 | { 38 | printf("Usage : %s \n", pchPrgName); 39 | printf("index:\n"); 40 | printf("\t 0) Alexnet(VNode)\n"); 41 | printf("\t 1) RFCN(VNode->RNode->VNode)\n"); 42 | printf("\t 2) RFCN & AlexNet Group(RFCN->Connector->AlexNet)\n"); 43 | printf("\t 3) SSD\n"); 44 | printf("\t 4) RFCN & Goturn & Alexnet\n"); 45 | } 46 | 47 | #ifdef ON_BOARD 48 | static HI_S32 SAMPLE_COMM_SVP_SysInit(HI_VOID) 49 | { 50 | HI_S32 s32Ret = HI_FAILURE; 51 | VB_CONFIG_S struVbConf; 52 | 53 | HI_MPI_SYS_Exit(); 54 | HI_MPI_VB_Exit(); 55 | 56 | memset(&struVbConf, 0, sizeof(VB_CONFIG_S)); 57 | 58 | struVbConf.u32MaxPoolCnt = 2; 59 | struVbConf.astCommPool[1].u64BlkSize = 768 * 576 * 2; 60 | struVbConf.astCommPool[1].u32BlkCnt = 1; 61 | 62 | s32Ret = HI_MPI_VB_SetConfig((const VB_CONFIG_S*)&struVbConf); 63 | 64 | if (HI_SUCCESS != s32Ret) 65 | { 66 | printf("HI_MPI_VB_SetConfig error\n"); 67 | return HI_FAILURE; 68 | } 69 | 70 | s32Ret = HI_MPI_VB_Init(); 71 | 72 | if (HI_SUCCESS != s32Ret) 73 | { 74 | printf("HI_MPI_VB_Init error\n"); 75 | return HI_FAILURE; 76 | } 77 | 78 | s32Ret = HI_MPI_SYS_Init(); 79 | 80 | if (HI_SUCCESS != s32Ret) 81 | { 82 | printf("HI_MPI_SYS_Init error\n"); 83 | return HI_FAILURE; 84 | } 85 | 86 | return s32Ret; 87 | } 88 | 89 | static HI_S32 SAMPLE_COMM_SVP_SysExit(HI_VOID) 90 | { 91 | HI_S32 s32Ret = HI_FAILURE; 92 | 93 | s32Ret = HI_MPI_SYS_Exit(); 94 | 95 | if (HI_SUCCESS != s32Ret) 96 | { 97 | printf("HI_MPI_SYS_Exit error\n"); 98 | return HI_FAILURE; 99 | } 100 | 101 | s32Ret = HI_MPI_VB_Exit(); 102 | 103 | if (HI_SUCCESS != s32Ret) 104 | { 105 | printf("HI_MPI_VB_Exit error\n"); 106 | return HI_FAILURE; 107 | } 108 | 109 | return HI_SUCCESS; 110 | } 111 | #endif 112 | 113 | int main(int argc, char* argv[]) 114 | { 115 | if (argc < 2) 116 | { 117 | SAMPLE_RUNTIME_Usage(argv[0]); 118 | return HI_FAILURE; 119 | } 120 | 121 | #ifdef ON_BOARD 122 | SAMPLE_COMM_SVP_SysInit(); 123 | #endif 124 | 125 | switch (*argv[1]) 126 | { 127 | case '0': 128 | SAMPLE_AlexNet(); 129 | break; 130 | case '1': 131 | SAMPLE_RFCN(); 132 | break; 133 | case '2': 134 | SAMPLE_Model_Group_RFCNAlexNet(); 135 | break; 136 | case '3': 137 | SAMPLE_SSD(); 138 | break; 139 | case '4': 140 | SAMPLE_Model_Group_RFCN_GOTURN_ALEXNET(1, 5); 141 | break; 142 | default: 143 | printf("index[%s] error !!!!!!!!!!\n", argv[1]); 144 | SAMPLE_RUNTIME_Usage(argv[0]); 145 | break; 146 | } 147 | 148 | #ifdef ON_BOARD 149 | SAMPLE_COMM_SVP_SysExit(); 150 | #endif 151 | return HI_SUCCESS; 152 | } 153 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/src/rfcn.modelgroup: -------------------------------------------------------------------------------- 1 | name: "single_rfcn" 2 | priority: 1 3 | max_tmpbuf_size_mb: 2048 4 | 5 | input { 6 | name: "data" 7 | } 8 | 9 | model { 10 | name: "rfcn" 11 | bottom: { name: "data" } 12 | top: { name: "proposal" } 13 | top: { name: "cls_prob_reshape" } 14 | top: { name: "bbox_pred_reshape" } 15 | cops { 16 | name: "proposal" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/src/rfcn_alexnet.modelgroup: -------------------------------------------------------------------------------- 1 | name: "rfcn_alexnet" 2 | priority: 1 3 | max_tmpbuf_size_mb: 3072 4 | 5 | input { 6 | name: "data" 7 | } 8 | 9 | model { 10 | name: "rfcn" 11 | bottom: { name: "data" } 12 | top: { name: "proposal" } 13 | top: { name: "cls_prob_reshape" } 14 | top: { name: "bbox_pred_reshape" } 15 | cops { 16 | name: "proposal" 17 | } 18 | } 19 | 20 | connector { 21 | name: "rfcn_conn_alexnet" 22 | bottom: { name: "data" } 23 | bottom: { name: "rfcn.proposal" } 24 | bottom: { name: "rfcn.cls_prob_reshape" } 25 | bottom: { name: "rfcn.bbox_pred_reshape" } 26 | top: { 27 | name: "rect_image" 28 | type: U8 29 | shape: {dim:64 dim:3 dim:227 dim:227} 30 | } 31 | } 32 | 33 | model { 34 | name: "alexnet" 35 | bottom: { name: "rfcn_conn_alexnet.rect_image" } 36 | top: { name: "prob" } 37 | } 38 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/src/rfcn_goturn_alexnet_tracker.modelgroup: -------------------------------------------------------------------------------- 1 | name: "rfcn_goturn_alexnet_tracker" 2 | priority: 1 3 | max_tmpbuf_size_mb: 3072 4 | 5 | input { 6 | name: "image" 7 | } 8 | 9 | connector { 10 | name: "rfcn_pre" 11 | bottom: { name: "image" } 12 | top: { name: "image_resize" } 13 | } 14 | 15 | model { 16 | name: "rfcn" 17 | bottom: { name: "rfcn_pre.image_resize" } 18 | top: { name: "proposal" } 19 | top: { name: "cls_prob_reshape" } 20 | top: { name: "bbox_pred_reshape" } 21 | cops { 22 | name: "proposal" 23 | } 24 | } 25 | 26 | connector { 27 | name: "rfcn_after" 28 | bottom: { name: "rfcn.proposal" } 29 | bottom: { name: "rfcn.cls_prob_reshape" } 30 | bottom: { name: "rfcn.bbox_pred_reshape" } 31 | top: { name: "detection_targets" 32 | report_flag: true} 33 | } 34 | 35 | connector { 36 | name: "feature_extra_1" 37 | bottom: { name: "rfcn_after.detection_targets" } 38 | top: { name: "targets_feature_d" 39 | report_flag: true} 40 | } 41 | 42 | connector { 43 | name: "go_turn_pre" 44 | bottom: { name: "image" } 45 | bottom: { 46 | name: "compare.targets" 47 | frame_depend: -1 48 | } 49 | bottom: { 50 | name: "compare.targets_bbox" 51 | frame_depend: -1 52 | } 53 | top: { name: "images_crop" } 54 | top: { name: "targets_crop" } 55 | top: { name: "location_edge" 56 | report_flag: true} 57 | } 58 | 59 | model { 60 | name: "go_turn" 61 | bottom: { name: "go_turn_pre.targets_crop" } 62 | bottom: { name: "go_turn_pre.images_crop" } 63 | top: { name: "fc8_shapes" } 64 | } 65 | 66 | connector { 67 | name: "go_turn_after" 68 | bottom: { name: "go_turn.fc8_shapes" } 69 | bottom: { name: "go_turn_pre.location_edge"} 70 | top: { name: "tracker_targets" 71 | type: VEC_S32 72 | shape: {dim:2 dim:4 dim:1 dim:1} 73 | } 74 | } 75 | 76 | connector { 77 | name: "feature_extra_2" 78 | bottom: { name: "go_turn_after.tracker_targets" } 79 | top: { name: "targets_feature_t" 80 | report_flag: true} 81 | } 82 | 83 | connector { 84 | name: "compare" 85 | bottom: { name: "image"} 86 | bottom: { name: "feature_extra_1.targets_feature_d" } 87 | bottom: { name: "feature_extra_2.targets_feature_t" } 88 | top: { name: "targets" 89 | report_flag: true} 90 | top: { name: "targets_bbox" 91 | report_flag: true} 92 | } 93 | 94 | #connector { 95 | # name: "resize_1" 96 | # bottom: { name: "image" } 97 | # bottom: { name: "compare.targets" } 98 | # top: { name: "targets_resize" } 99 | #} 100 | # 101 | #connector { 102 | # name: "resize_2" 103 | # bottom: { name: "image" } 104 | # bottom: { name: "compare.targets" } 105 | # top: { name: "targets_resize" } 106 | #} 107 | # 108 | #connector { 109 | # name: "resize_3" 110 | # bottom: { name: "image" } 111 | # bottom: { name: "compare.targets" } 112 | # top: { name: "targets_resize" } 113 | #} 114 | # 115 | #model { 116 | # name: "alexnet_1" 117 | # bottom: { name: "resize_1.targets_resize" } 118 | # top: { name: "prob" } 119 | #} 120 | # 121 | #model { 122 | # name: "alexnet_2" 123 | # bottom: { name: "resize_2.targets_resize" } 124 | # top: { name: "prob" } 125 | #} 126 | # 127 | #model { 128 | # name: "alexnet_3" 129 | # bottom: { name: "resize_3.targets_resize" } 130 | # top: { name: "prob" } 131 | #} 132 | -------------------------------------------------------------------------------- /svp/multi-core/hirt/src/ssd.modelgroup: -------------------------------------------------------------------------------- 1 | name: "single_ssd" 2 | priority: 1 3 | max_tmpbuf_size_mb: 3072 4 | 5 | input { 6 | name: "data" 7 | } 8 | 9 | model { 10 | name: "ssd" 11 | bottom: {name: "data"} 12 | top: {name: "conv4_3_norm_mbox_loc_perm"} 13 | top: {name: "conv4_3_norm_mbox_conf_perm"} 14 | top: {name: "fc7_mbox_loc_perm"} 15 | top: {name: "fc7_mbox_conf_perm"} 16 | top: {name: "conv6_2_mbox_loc_perm"} 17 | top: {name: "conv6_2_mbox_conf_perm"} 18 | top: {name: "conv7_2_mbox_loc_perm"} 19 | top: {name: "conv7_2_mbox_conf_perm"} 20 | top: {name: "conv8_2_mbox_loc_perm"} 21 | top: {name: "conv8_2_mbox_conf_perm"} 22 | top: {name: "conv9_2_mbox_loc_perm"} 23 | top: {name: "conv9_2_mbox_conf_perm"} 24 | } 25 | -------------------------------------------------------------------------------- /svp/multi-core/ive/Makefile: -------------------------------------------------------------------------------- 1 | # Hisilicon Hi35xx sample Makefile 2 | 3 | include ../Makefile.param 4 | 5 | CFLAGS += -I$(PWD)/sample 6 | 7 | SRCS := $(wildcard *.c) 8 | SRCS += $(wildcard ./sample/*.c) 9 | SRCS += $(wildcard $(PWD)/../common/*.c) 10 | TARGET := sample_ive_main 11 | 12 | # compile linux or HuaweiLite 13 | include $(PWD)/../../../$(OSTYPE).mak 14 | -------------------------------------------------------------------------------- /svp/multi-core/nnie/Makefile: -------------------------------------------------------------------------------- 1 | # Hisilicon Hi35xx sample Makefile 2 | include $(PWD)/../Makefile.param 3 | 4 | CFLAGS += -I$(PWD)/sample 5 | CFLAGS += -I$(PWD)/sample_nnie_software 6 | CFLAGS += -O3 7 | #添加对cpp文件的查找搜索 8 | SRCS := $(wildcard *.c) 9 | SRCS += $(wildcard *.cpp) 10 | SRCS += $(wildcard ./sample/*.c) 11 | SRCS += $(wildcard ./sample_nnie_software/*.c) 12 | SRCS += $(wildcard $(PWD)/../common/*.c) 13 | TARGET := sample_nnie_main 14 | 15 | #添加opencv编译包含路径 16 | DIR_ARM :=/home/rainzsy/UserSoft/opencv-3.4.3/install_arm64/ 17 | OPENCV_INCLUDE := -I$(DIR_ARM)/include 18 | OPENCV_LIB_DIR := -L$(DIR_ARM)/lib 19 | OPENCV_LIBS = -lopencv_highgui \ 20 | -lopencv_imgproc \ 21 | -lopencv_core \ 22 | -lopencv_imgcodecs \ 23 | -lopencv_video \ 24 | -lopencv_objdetect \ 25 | -lopencv_imgcodecs 26 | 27 | 28 | 29 | # compile linux or HuaweiLite 30 | include $(PWD)/../../../$(OSTYPE).mak 31 | -------------------------------------------------------------------------------- /svp/multi-core/nnie/sample/sample_nnie_main.h: -------------------------------------------------------------------------------- 1 | #ifndef __SAMPLE_SVP_MAIN_H__ 2 | #define __SAMPLE_SVP_MAIN_H__ 3 | 4 | 5 | #ifdef __cplusplus 6 | #if __cplusplus 7 | extern "C"{ 8 | #endif 9 | #endif /* __cplusplus */ 10 | #include "hi_type.h" 11 | 12 | /****************************************************************************** 13 | * function : show Cnn sample 14 | ******************************************************************************/ 15 | void SAMPLE_SVP_NNIE_Cnn(); 16 | 17 | /****************************************************************************** 18 | * function : show Segnet sample 19 | ******************************************************************************/ 20 | void SAMPLE_SVP_NNIE_Segnet(void); 21 | 22 | /****************************************************************************** 23 | * function : show FasterRcnn sample 24 | ******************************************************************************/ 25 | void SAMPLE_SVP_NNIE_FasterRcnn(void); 26 | 27 | /****************************************************************************** 28 | * function : show fasterrcnn double roipooling sample 29 | ******************************************************************************/ 30 | void SAMPLE_SVP_NNIE_FasterRcnn_DoubleRoiPooling(void); 31 | 32 | /****************************************************************************** 33 | * function : show RFCN sample 34 | ******************************************************************************/ 35 | void SAMPLE_SVP_NNIE_Rfcn(void); 36 | 37 | /****************************************************************************** 38 | * function : show SSD sample 39 | ******************************************************************************/ 40 | void SAMPLE_SVP_NNIE_Ssd(void); 41 | 42 | /****************************************************************************** 43 | * function : show YOLOV1 sample 44 | ******************************************************************************/ 45 | void SAMPLE_SVP_NNIE_Yolov1(void); 46 | 47 | /****************************************************************************** 48 | * function : show YOLOV2 sample 49 | ******************************************************************************/ 50 | void SAMPLE_SVP_NNIE_Yolov2(void); 51 | 52 | /****************************************************************************** 53 | * function : show YOLOV3 sample 54 | ******************************************************************************/ 55 | void SAMPLE_SVP_NNIE_Yolov3(void); 56 | 57 | /****************************************************************************** 58 | * function : show Lstm sample 59 | ******************************************************************************/ 60 | void SAMPLE_SVP_NNIE_Lstm(void); 61 | 62 | /****************************************************************************** 63 | * function : show Pvanet FasterRcnn sample 64 | ******************************************************************************/ 65 | void SAMPLE_SVP_NNIE_Pvanet(void); 66 | 67 | 68 | 69 | /****************************************************************************** 70 | * function : Cnn sample signal handle 71 | ******************************************************************************/ 72 | void SAMPLE_SVP_NNIE_Cnn_HandleSig(void); 73 | 74 | /****************************************************************************** 75 | * function : Segnet sample signal handle 76 | ******************************************************************************/ 77 | void SAMPLE_SVP_NNIE_Segnet_HandleSig(void); 78 | 79 | /****************************************************************************** 80 | * function : fasterRcnn sample signal handle 81 | ******************************************************************************/ 82 | void SAMPLE_SVP_NNIE_FasterRcnn_HandleSig(void); 83 | 84 | /****************************************************************************** 85 | * function : rfcn sample signal handle 86 | ******************************************************************************/ 87 | void SAMPLE_SVP_NNIE_Rfcn_HandleSig(void); 88 | 89 | /****************************************************************************** 90 | * function : SSD sample signal handle 91 | ******************************************************************************/ 92 | void SAMPLE_SVP_NNIE_Ssd_HandleSig(void); 93 | 94 | /****************************************************************************** 95 | * function : Yolov1 sample signal handle 96 | ******************************************************************************/ 97 | void SAMPLE_SVP_NNIE_Yolov1_HandleSig(void); 98 | 99 | /****************************************************************************** 100 | * function : Yolov2 sample signal handle 101 | ******************************************************************************/ 102 | void SAMPLE_SVP_NNIE_Yolov2_HandleSig(void); 103 | 104 | /****************************************************************************** 105 | * function : Yolov3 sample signal handle 106 | ******************************************************************************/ 107 | void SAMPLE_SVP_NNIE_Yolov3_HandleSig(void); 108 | 109 | /****************************************************************************** 110 | * function : Lstm sample signal handle 111 | ******************************************************************************/ 112 | void SAMPLE_SVP_NNIE_Lstm_HandleSig(void); 113 | 114 | 115 | /****************************************************************************** 116 | * function : Pvanet sample signal handle 117 | ******************************************************************************/ 118 | void SAMPLE_SVP_NNIE_Pvanet_HandleSig(void); 119 | 120 | 121 | #ifdef __cplusplus 122 | #if __cplusplus 123 | } 124 | #endif 125 | #endif /* __cplusplus */ 126 | 127 | 128 | #endif /* __SAMPLE_SVP_MAIN_H__ */ 129 | -------------------------------------------------------------------------------- /svp/multi-core/nnie/sample_nnie_main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "sample_nnie_main.h" 12 | #include 13 | #include 14 | 15 | using namespace std; 16 | using namespace cv; 17 | 18 | 19 | //海思编译不能使用GTK,导致无法使用imshow这个函数,使用宏定义作为一个开关功能 20 | //#define WITH_GTK 21 | 22 | #ifdef WITH_GTK 23 | #define IMG_SHOW(des,img) imshow(des,img) 24 | #define WAIT_KEY(t) waitKey(t) 25 | #else 26 | #define IMG_SHOW(des,img) printf("[imshow] without GTK only print window name:%s\n",des) 27 | #define WAIT_KEY(t) printf("[waitKey] without GTK only print time:%d\n",t) 28 | #endif 29 | 30 | 31 | 32 | 33 | static char **s_ppChCmdArgv = NULL; 34 | 35 | /****************************************************************************** 36 | * function : show usage 37 | ******************************************************************************/ 38 | void SAMPLE_SVP_Usage(char* pchPrgName) 39 | { 40 | printf("Usage : %s \n", pchPrgName); 41 | printf("index:\n"); 42 | printf("\t 0) RFCN(VI->VPSS->NNIE->VGS->VO).\n"); 43 | printf("\t 1) Segnet(Read File).\n"); 44 | printf("\t 2) FasterRcnnAlexnet(Read File).\n"); 45 | printf("\t 3) FasterRcnnDoubleRoiPooling(Read File).\n"); 46 | printf("\t 4) Cnn(Read File).\n"); 47 | printf("\t 5) SSD(Read File).\n"); 48 | printf("\t 6) Yolov1(Read File).\n"); 49 | printf("\t 7) Yolov2(Read File).\n"); 50 | printf("\t 8) Yolov3(Read File).\n"); 51 | printf("\t 9) LSTM(Read File).\n"); 52 | printf("\t a) Pvanet(Read File).\n"); 53 | } 54 | 55 | 56 | 57 | int test_opencv() 58 | { 59 | Mat img = imread("./data/imgs/cat.jpg"); 60 | //imshow("原始图", img); //没有gtk不能imshow 61 | Mat DstPic, edge, grayImage; 62 | 63 | //创建与src同类型和同大小的矩阵 64 | DstPic.create(img.size(), img.type()); 65 | 66 | //将原始图转化为灰度图 67 | cvtColor(img, grayImage, COLOR_BGR2GRAY); 68 | 69 | //先使用3*3内核来降噪 70 | blur(grayImage, edge, Size(3, 3)); 71 | 72 | //运行canny算子 73 | Canny(edge, edge, 3, 9, 3); 74 | 75 | imwrite("./out/canny.jpg",edge); 76 | 77 | IMG_SHOW("canny", edge); 78 | WAIT_KEY(0); 79 | 80 | return 0; 81 | 82 | } 83 | 84 | 85 | 86 | int main(int argc, char *argv[]) 87 | { 88 | int s32Ret = HI_SUCCESS; 89 | 90 | cout<< "entering main\n"; 91 | if (argc < 2) 92 | { 93 | SAMPLE_SVP_Usage(argv[0]); 94 | return HI_FAILURE; 95 | } 96 | s_ppChCmdArgv = argv; 97 | 98 | cout << "opencv testing...\n"; 99 | test_opencv(); //测试opencv 100 | cout << "nnie testing ...\n"; 101 | switch (*argv[1]) 102 | { 103 | case '0': 104 | { 105 | SAMPLE_SVP_NNIE_Rfcn(); 106 | } 107 | break; 108 | case '1': 109 | { 110 | SAMPLE_SVP_NNIE_Segnet(); 111 | } 112 | break; 113 | case '2': 114 | { 115 | SAMPLE_SVP_NNIE_FasterRcnn(); 116 | } 117 | break; 118 | case '3': 119 | { 120 | SAMPLE_SVP_NNIE_FasterRcnn_DoubleRoiPooling(); 121 | } 122 | break; 123 | case '4': 124 | { 125 | SAMPLE_SVP_NNIE_Cnn(); 126 | } 127 | break; 128 | case '5': 129 | { 130 | SAMPLE_SVP_NNIE_Ssd(); 131 | } 132 | break; 133 | case '6': 134 | { 135 | SAMPLE_SVP_NNIE_Yolov1(); 136 | } 137 | break; 138 | case '7': 139 | { 140 | SAMPLE_SVP_NNIE_Yolov2(); 141 | } 142 | break; 143 | case '8': 144 | { 145 | SAMPLE_SVP_NNIE_Yolov3(); 146 | } 147 | break; 148 | case '9': 149 | { 150 | SAMPLE_SVP_NNIE_Lstm(); 151 | } 152 | break; 153 | case 'a': 154 | { 155 | SAMPLE_SVP_NNIE_Pvanet(); 156 | } 157 | break; 158 | default : 159 | { 160 | SAMPLE_SVP_Usage(argv[0]); 161 | } 162 | break; 163 | } 164 | 165 | return s32Ret; 166 | } 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /svp/multi-core/opencv/test_opencv/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Existever/Hi3559a_Yolov3_Hard/b23779c08840bde527d5e95ae9b9f4206677e6b8/svp/multi-core/opencv/test_opencv/cat.jpg -------------------------------------------------------------------------------- /svp/multi-core/opencv/test_opencv/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Existever/Hi3559a_Yolov3_Hard/b23779c08840bde527d5e95ae9b9f4206677e6b8/svp/multi-core/opencv/test_opencv/main -------------------------------------------------------------------------------- /svp/multi-core/opencv/test_opencv/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | using namespace cv; 7 | 8 | 9 | //海思编译不能使用GTK,导致无法使用imshow这个函数,使用宏定义作为一个开关功能 10 | //#define WITH_GTK 11 | 12 | #ifdef WITH_GTK 13 | #define IMG_SHOW(des,img) imshow(des,img) 14 | #define WAIT_KEY(t) waitKey(t) 15 | #else 16 | #define IMG_SHOW(des,img) printf("[imshow] without GTK only print window name:%s\n",des) 17 | #define WAIT_KEY(t) printf("[waitKey] without GTK only print time:%d\n",t) 18 | #endif 19 | 20 | 21 | //边缘检测 22 | int main() 23 | { 24 | Mat img = imread("cat.jpg"); 25 | //imshow("原始图", img); //没有gtk不能imshow 26 | Mat DstPic, edge, grayImage; 27 | 28 | //创建与src同类型和同大小的矩阵 29 | DstPic.create(img.size(), img.type()); 30 | 31 | //将原始图转化为灰度图 32 | cvtColor(img, grayImage, COLOR_BGR2GRAY); 33 | 34 | //先使用3*3内核来降噪 35 | blur(grayImage, edge, Size(3, 3)); 36 | 37 | //运行canny算子 38 | Canny(edge, edge, 3, 9, 3); 39 | 40 | imwrite("canny.jpg",edge); 41 | 42 | IMG_SHOW("边缘提取效果", edge); 43 | WAIT_KEY(0); 44 | 45 | return 0; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /svp/multi-core/opencv/test_opencv/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Existever/Hi3559a_Yolov3_Hard/b23779c08840bde527d5e95ae9b9f4206677e6b8/svp/multi-core/opencv/test_opencv/main.o -------------------------------------------------------------------------------- /svp/multi-core/opencv/test_opencv/makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | DEBGU_ON_PC :=0 4 | 5 | CC_PC :=g++ 6 | DIR_PC:=/home/rainzsy/UserSoft/opencv-3.4.3/install_x64/ 7 | 8 | CC_ARM :=aarch64-himix100-linux-g++ 9 | DIR_ARM :=/home/rainzsy/UserSoft/opencv-3.4.3/install_arm64/ 10 | 11 | 12 | ifeq ($(DEBGU_ON_PC),1) 13 | CC :=$(CC_PC) 14 | DIR :=$(DIR_PC) 15 | else 16 | CC :=$(CC_ARM) 17 | DIR :=$(DIR_ARM) 18 | endif 19 | 20 | 21 | 22 | 23 | TARGETS := main 24 | Depend := main.cpp 25 | 26 | LIBS = -lopencv_highgui \ 27 | -lopencv_imgproc \ 28 | -lopencv_core \ 29 | -lopencv_imgcodecs \ 30 | -lopencv_video \ 31 | -lopencv_objdetect \ 32 | -lopencv_imgcodecs 33 | 34 | INCLUDE = -I$(DIR)/include/ 35 | 36 | LIB_TARGET_DIR = -L$(DIR)/lib \ 37 | -L/$(DIR)/share/OpenCV/3rdparty/lib 38 | 39 | all:$(TARGETS) 40 | 41 | $(TARGETS):$(Depend) 42 | $(CC) $(CPPFLAGS) -o $@ $(INCLUDE) $^ $(LIB_TARGET_DIR) $(LIBS) 43 | 44 | clean: 45 | rm -f *.o $(TARGETS) 46 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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: [-16383,16383]: 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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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_S32 s32Timelag; /* RW; Range:[-2000000,2000000]; 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: Hi3559AV100 = [25, 120] | Hi3519AV100 = [25, 120] | Hi3516CV500 = [25, 60] | Hi3516DV300 = [25, 60] | 95 | Hi3559V200 = [25, 60] | Hi3556V200 = [25, 60] .*/ 96 | HI_U32 u32GyroOutputRange; /* RW; Range:[0,360]; The range of Gyro output in degree */ 97 | HI_U32 u32GyroDataBitWidth; /* RW; Range:[0,32]; The bits used for gyro angular velocity output */ 98 | HI_BOOL bCameraSteady; /* RW; The camera is steady or not */ 99 | HI_BOOL bScale; /* RW; Scale output image or not*/ 100 | }DIS_CONFIG_S; 101 | 102 | #ifdef __cplusplus 103 | #if __cplusplus 104 | } 105 | #endif 106 | #endif /* End of #ifdef __cplusplus */ 107 | 108 | 109 | #endif /* End of #ifndef __HI_COMM_DIS_H__ */ 110 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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: [1,8] */ 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 | #ifdef __cplusplus 112 | #if __cplusplus 113 | } 114 | #endif 115 | #endif /* __cplusplus */ 116 | 117 | #endif /* End of #ifndef __HI_COMM_SNAP_H__ */ 118 | 119 | 120 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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; //虚拟bank的配置信息 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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | #define HI_ERR_CIPHER_MEMSET_S_FAILED (HI_S32)(0x804D001C) 38 | #define HI_ERR_CIPHER_MEMCPY_S_FAILED (HI_S32)(0x804D001D) 39 | 40 | #ifdef __cplusplus 41 | #if __cplusplus 42 | } 43 | #endif 44 | #endif /* __cplusplus */ 45 | 46 | #endif /* __CRYP_CIPHER_H__ */ 47 | 48 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_include/hi_mcc_usrdev.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines data structures and interfaces for 3 | * hisilicon Multiple chips communication. 4 | * 5 | * Copyright (C) 2008 hisilicon , chanjinn@hauwei.com 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | * 21 | * 22 | * MCC is short for Multi-Chips-Communication 23 | * 24 | * Create by Hisicon, 2011.1.1 25 | */ 26 | 27 | #include 28 | 29 | #ifndef __HI_MCC_USERDEV_HEAD__ 30 | #define __HI_MCC_USERDEV_HEAD__ 31 | 32 | #define MCC_USR_MODULE_NAME "MCC_USR" 33 | #define MCC_USR_VERSION __DATE__", "__TIME__ 34 | 35 | #define HISI_MAX_MAP_DEV 0x1f 36 | 37 | #define NORMAL_MESSAGE_SIZE 128 38 | 39 | #define MAXIMAL_MESSAGE_SIZE 0x1000 40 | 41 | struct hi_mcc_handle_attr { 42 | int target_id; 43 | int port; 44 | int priority; 45 | 46 | /* to store remote device ids */ 47 | int remote_id[HISI_MAX_MAP_DEV]; 48 | }; 49 | 50 | #define HI_IOC_MCC_BASE 'M' 51 | 52 | /* Create a new mcc handle. A file descriptor is only used once for one mcc handle. */ 53 | #define HI_MCC_IOC_CONNECT _IOW(HI_IOC_MCC_BASE, 1, struct hi_mcc_handle_attr) 54 | 55 | #define HI_MCC_IOC_CHECK _IOW(HI_IOC_MCC_BASE, 2, struct hi_mcc_handle_attr) 56 | 57 | #define HI_MCC_IOC_GET_LOCAL_ID _IOW(HI_IOC_MCC_BASE, 4, struct hi_mcc_handle_attr) 58 | 59 | #define HI_MCC_IOC_GET_REMOTE_ID _IOW(HI_IOC_MCC_BASE, 5, struct hi_mcc_handle_attr) 60 | 61 | #define HI_MCC_IOC_ATTR_INIT _IOW(HI_IOC_MCC_BASE, 6, struct hi_mcc_handle_attr) 62 | 63 | #ifdef __KERNEL__ 64 | #include 65 | #include 66 | #include 67 | #include 68 | 69 | #define HI_MCC_DEBUG 4 70 | #define HI_MCC_INFO 3 71 | #define HI_MCC_ERR 2 72 | #define HI_MCC_FATAL 1 73 | #define HI_MCC_DBG_LEVEL 2 74 | #define hi_mcc_trace(level, s, params...) do{ if(level <= HI_MCC_DBG_LEVEL)\ 75 | printk(KERN_INFO "[%s, %d]: " s "\n", __FUNCTION__, __LINE__, ##params);\ 76 | }while(0) 77 | 78 | struct hios_mcc_handle { 79 | unsigned long pci_handle; /* pci handle */ 80 | struct list_head mem_list; /* mem list */ 81 | wait_queue_head_t wait; 82 | }; 83 | 84 | typedef struct hios_mcc_handle hios_mcc_handle_t; 85 | 86 | /* 87 | * recvfrom_notify sample 88 | * 89 | *int myrecv_notify(void *handle ,void *buf, unsigned int data_len) 90 | *{ ~~~~~~~ 91 | * struct hios_mcc_handle hios_handle; 92 | * hios_mcc_handle_opt opt; 93 | * unsigned long cus_data; 94 | * hios_handle.handle = (unsigned long) handle 95 | * ~~~~~~ 96 | * hios_mcc_getopt(&hios_handle, &opt); 97 | * cus_data = opt.data; 98 | * ... 99 | *} 100 | */ 101 | 102 | struct hios_mcc_handle_opt { 103 | int (*recvfrom_notify)(void *handle, 104 | void *buf, 105 | unsigned int data_len); 106 | 107 | unsigned long data; 108 | }; 109 | 110 | typedef struct hios_mcc_handle_opt hios_mcc_handle_opt_t; 111 | 112 | hios_mcc_handle_t *hios_mcc_open(struct hi_mcc_handle_attr *attr); 113 | 114 | void hios_mcc_handle_attr_init(struct hi_mcc_handle_attr *attr); 115 | 116 | int hios_mcc_sendto(hios_mcc_handle_t *handle, const void *buf, unsigned int len); 117 | 118 | int hios_mcc_sendto_user(hios_mcc_handle_t *handle, const void *buf, unsigned int len, int flag); 119 | 120 | int hios_mcc_close(hios_mcc_handle_t *handle); 121 | 122 | int hios_mcc_getopt(hios_mcc_handle_t *handle, hios_mcc_handle_opt_t *opt); 123 | 124 | int hios_mcc_setopt(hios_mcc_handle_t *handle, const hios_mcc_handle_opt_t *opt); 125 | 126 | int hios_mcc_getlocalid(hios_mcc_handle_t *handle); 127 | 128 | int hios_mcc_getremoteids(int ids[],hios_mcc_handle_t *handle); 129 | 130 | int hios_mcc_check_remote(int remote_id,hios_mcc_handle_t *handle); 131 | 132 | int hios_mcc_register(void); 133 | 134 | #endif /* __KERNEL__ */ 135 | 136 | #endif /* __HI_MCC_USERDEV_HEAD__ */ 137 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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_*/ -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | 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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | -------------------------------------------------------------------------------- /svp/multi-core/tmp_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 | /** @} */ /**