├── doc └── rc_example.cfg ├── tools ├── stop.sh ├── srm │ ├── Makefile │ └── README.md ├── Makefile └── ptest.sh ├── sdk_libs ├── arm64 │ ├── libpp.so │ ├── libcwl.so │ ├── libdwlg2.so │ ├── libenc.so │ ├── libg2vp9.so │ ├── libh2enc.so │ ├── libhal.so │ ├── libg2h264.so │ ├── libg2hevc.so │ ├── libsyslog.so │ └── libg2common.so └── x86_64 │ ├── libcwl.so │ ├── libenc.so │ ├── libhal.so │ ├── libpp.so │ ├── libdwlg2.so │ ├── libg2h264.so │ ├── libg2hevc.so │ ├── libg2vp9.so │ ├── libh2enc.so │ ├── libsyslog.so │ └── libg2common.so ├── firmware └── ZSP_FW_RP_V017.bin ├── .gitignore ├── drivers ├── .gitignore ├── Readme.txt ├── hw_monitor.h ├── pcie.h ├── memory.h ├── debug_trace.c ├── misc_ip.h ├── Makefile ├── interrupt.c ├── vc8000d.h └── mem_test.c ├── sdk_inc ├── common │ └── inc │ │ ├── trans_fd_api.h │ │ ├── hugepage_api.h │ │ ├── fb_ips.h │ │ ├── NetSender.h │ │ ├── trans_reg_rw_api.h │ │ ├── trans_edma_api.h │ │ ├── trans_mem_api.h │ │ ├── l2cache_api.h │ │ ├── dtrc_api.h │ │ └── dec400_f2_api.h ├── VC8000E │ └── software │ │ ├── source │ │ ├── hevc │ │ │ ├── hevcApiVersion.h │ │ │ ├── hevcenccache.h │ │ │ └── sw_cabac_defines.h │ │ ├── common │ │ │ ├── error.h │ │ │ ├── checksum.h │ │ │ ├── crc.h │ │ │ ├── queue.h │ │ │ ├── hash.h │ │ │ ├── tools.h │ │ │ └── sw_put_bits.h │ │ ├── jpeg │ │ │ ├── EncJpegCommon.h │ │ │ ├── EncJpegInit.h │ │ │ ├── EncJpegPutBits.h │ │ │ ├── EncJpegCodeFrame.h │ │ │ └── EncJpegInstance.h │ │ └── vp9 │ │ │ ├── vp9header.h │ │ │ ├── vp9testid.h │ │ │ ├── vp9init.h │ │ │ ├── vp9entropy.h │ │ │ ├── vp9codeframe.h │ │ │ ├── vp9entropytools.h │ │ │ ├── vp9macroblocktools.h │ │ │ ├── vp9putbits.h │ │ │ └── vp9seqparameterset.h │ │ ├── inc │ │ ├── container.h │ │ ├── test_data_define.h │ │ ├── mjpegencapi.h │ │ └── base_type.h │ │ └── linux_reference │ │ └── ewl │ │ └── ewl_linux_lock.h ├── Bigsea │ └── software │ │ └── inc │ │ ├── decapicommon.h │ │ └── basetype.h └── VC8000D │ └── software │ └── source │ ├── h264high │ ├── h264hwd_conflicts.h │ ├── h264hwd_cabac.h │ ├── h264hwd_regdrv.h │ ├── h264hwd_conceal.h │ ├── h264_pp_pipeline.h │ ├── h264decmc_internals.h │ ├── h264_pp_multibuffer.h │ └── h264decapi_e.h │ └── common │ ├── vpufeature.h │ ├── vpu_features_struct.h │ ├── version.h │ ├── stream_corrupt.h │ ├── tiledref.h │ └── errorhandling.h └── vpi ├── utils ├── inc │ ├── vpi_log_manager.h │ └── vpi_error.h └── src │ └── log_manager.c ├── src ├── dec │ ├── vpi_video_dec_info.h │ ├── vpi_video_dec_cfg.h │ ├── vpi_video_dec_pp.h │ ├── vpi_video_dec_picture_consume.h │ ├── vpi_video_dec_buffer.h │ ├── vpi_video_vp9dec.h │ ├── vpi_video_hevcdec.h │ └── vpi_video_h264dec.h ├── filter │ ├── vpi_video_hwdwprc.h │ ├── vpi_video_hwulprc.h │ ├── vpi_video_prc.h │ └── vpi_video_prc.c └── enc │ ├── vpi_video_h26xenc.h │ └── vpi_video_enc_common.h └── inc └── vpi_api.h /doc/rc_example.cfg: -------------------------------------------------------------------------------- 1 | bps:500000 2 | res:1280x720 3 | fps:25/1 4 | -------------------------------------------------------------------------------- /tools/stop.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | killall stest.sh 4 | killall srmtool 5 | killall ffmpeg 6 | -------------------------------------------------------------------------------- /sdk_libs/arm64/libpp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/arm64/libpp.so -------------------------------------------------------------------------------- /sdk_libs/arm64/libcwl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/arm64/libcwl.so -------------------------------------------------------------------------------- /sdk_libs/arm64/libdwlg2.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/arm64/libdwlg2.so -------------------------------------------------------------------------------- /sdk_libs/arm64/libenc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/arm64/libenc.so -------------------------------------------------------------------------------- /sdk_libs/arm64/libg2vp9.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/arm64/libg2vp9.so -------------------------------------------------------------------------------- /sdk_libs/arm64/libh2enc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/arm64/libh2enc.so -------------------------------------------------------------------------------- /sdk_libs/arm64/libhal.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/arm64/libhal.so -------------------------------------------------------------------------------- /sdk_libs/x86_64/libcwl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/x86_64/libcwl.so -------------------------------------------------------------------------------- /sdk_libs/x86_64/libenc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/x86_64/libenc.so -------------------------------------------------------------------------------- /sdk_libs/x86_64/libhal.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/x86_64/libhal.so -------------------------------------------------------------------------------- /sdk_libs/x86_64/libpp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/x86_64/libpp.so -------------------------------------------------------------------------------- /firmware/ZSP_FW_RP_V017.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/firmware/ZSP_FW_RP_V017.bin -------------------------------------------------------------------------------- /sdk_libs/arm64/libg2h264.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/arm64/libg2h264.so -------------------------------------------------------------------------------- /sdk_libs/arm64/libg2hevc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/arm64/libg2hevc.so -------------------------------------------------------------------------------- /sdk_libs/arm64/libsyslog.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/arm64/libsyslog.so -------------------------------------------------------------------------------- /sdk_libs/x86_64/libdwlg2.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/x86_64/libdwlg2.so -------------------------------------------------------------------------------- /sdk_libs/x86_64/libg2h264.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/x86_64/libg2h264.so -------------------------------------------------------------------------------- /sdk_libs/x86_64/libg2hevc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/x86_64/libg2hevc.so -------------------------------------------------------------------------------- /sdk_libs/x86_64/libg2vp9.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/x86_64/libg2vp9.so -------------------------------------------------------------------------------- /sdk_libs/x86_64/libh2enc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/x86_64/libh2enc.so -------------------------------------------------------------------------------- /sdk_libs/x86_64/libsyslog.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/x86_64/libsyslog.so -------------------------------------------------------------------------------- /sdk_libs/arm64/libg2common.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/arm64/libg2common.so -------------------------------------------------------------------------------- /sdk_libs/x86_64/libg2common.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeriSilicon/vpe/HEAD/sdk_libs/x86_64/libg2common.so -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | vpi/*.so 3 | *.mk 4 | *package* 5 | *.tgz 6 | srmtool 7 | *.cmd 8 | *.log 9 | .tmp 10 | .vpetest* 11 | -------------------------------------------------------------------------------- /drivers/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | modules.order 3 | Module.symvers 4 | .version 5 | *.tmp_versions* 6 | *.o.cmd 7 | .depend 8 | *.a 9 | *.so 10 | *.ko* 11 | *.mod.* 12 | .cache.mk 13 | -------------------------------------------------------------------------------- /sdk_inc/common/inc/trans_fd_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __TRANS_FD_H__ 2 | #define __TRANS_FD_H__ 3 | 4 | #include "base_type.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | int TranscodeOpenFD(const char *device, int mode); 11 | int TranscodeCloseFD(int fd); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif 18 | 19 | 20 | -------------------------------------------------------------------------------- /sdk_inc/common/inc/hugepage_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __HUGEPAGE_H__ 2 | #define __HUGEPAGE_H__ 3 | 4 | #include "base_type.h" 5 | #include "transcoder.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | void *fbtrans_get_huge_pages(unsigned int len); 12 | int fbtrans_free_huge_pages(void *ptr, unsigned int len); 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | 18 | #endif 19 | 20 | 21 | -------------------------------------------------------------------------------- /drivers/Readme.txt: -------------------------------------------------------------------------------- 1 | 2 | file description: 3 | common.h: common header file, internal use 4 | 5 | trans_core.h : will share this header file to app 6 | trans_core.c : main file, register/release driver, and mange submodules. 7 | 8 | trans_edma.h : 9 | trans_edma.c : edma function 10 | 11 | trans_mem.h : 12 | trans_mem.c : memory mangement 13 | 14 | trans_pci.h : 15 | trans_pci.c : initialize pcie and msi-x 16 | -------------------------------------------------------------------------------- /drivers/hw_monitor.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 | /* 3 | * Copyright (C) 2020 VeriSilicon Holdings Co., Ltd. 4 | */ 5 | 6 | #ifndef _CB_HW_MONITOR_H_ 7 | #define _CB_HW_MONITOR_H_ 8 | 9 | #include 10 | 11 | #include "common.h" 12 | 13 | int hw_monitor_init(struct cb_tranx_t *tdev); 14 | int hw_monitor_release(struct cb_tranx_t *tdev); 15 | irqreturn_t hw_monitor_isr(int irq, void *data); 16 | 17 | #endif /* _CB_HW_MONITOR_H_ */ 18 | -------------------------------------------------------------------------------- /sdk_inc/common/inc/fb_ips.h: -------------------------------------------------------------------------------- 1 | #ifndef __FB_IPS_H__ 2 | #define __FB_IPS_H__ 3 | 4 | #define PCIE_EDMA_REG_BASE (0x100000000) 5 | #define PCIE_REG_START (0x100000000) 6 | 7 | 8 | #define F2_DEC_OFFSET_TO_VCEA (0x090000) 9 | #define VCEAL2R_OFFSET_TO_VCEA (0x0A0000) 10 | #define TCACHE_OFFSET_TO_VCEA (0x0E0000) 11 | #define DTRC_OFFSET_TO_VCEA (0x0F0000) 12 | #define DTRCL2R_OFFSET_TO_VCEA (0x100000) 13 | 14 | #endif /* __FB_IPS_H__ */ 15 | 16 | -------------------------------------------------------------------------------- /drivers/pcie.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 | /* 3 | * Copyright (C) 2020 VeriSilicon Holdings Co., Ltd. 4 | */ 5 | 6 | #ifndef _CB_PCIE_H_ 7 | #define _CB_PCIE_H_ 8 | 9 | #include 10 | #include 11 | 12 | #include "common.h" 13 | 14 | int cb_pci_init(struct cb_tranx_t *tdev); 15 | long cb_pci_ioctl(struct file *filp, 16 | unsigned int cmd, 17 | unsigned long arg, 18 | struct cb_tranx_t *tdev); 19 | void cb_pci_release(struct cb_tranx_t *tdev); 20 | 21 | #endif /* _CB_PCIE_H_ */ 22 | -------------------------------------------------------------------------------- /drivers/memory.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 | /* 3 | * Copyright (C) 2020 VeriSilicon Holdings Co., Ltd. 4 | */ 5 | 6 | #ifndef _CB_MEMORY_H_ 7 | #define _CB_MEMORY_H_ 8 | 9 | #include 10 | #include 11 | 12 | #include "common.h" 13 | 14 | int cb_mem_init(struct cb_tranx_t *tdev); 15 | int cb_mem_release(struct cb_tranx_t *tdev); 16 | long cb_mem_ioctl(struct file *filp, 17 | unsigned int cmd, 18 | unsigned long arg, 19 | struct cb_tranx_t *tdev); 20 | void cb_mem_close(struct cb_tranx_t *tdev, struct file *filp); 21 | 22 | #endif /* _CB_MEMORY_H_ */ 23 | -------------------------------------------------------------------------------- /tools/srm/Makefile: -------------------------------------------------------------------------------- 1 | #/* 2 | # * Copyright 2019 VeriSilicon, Inc. 3 | # * 4 | # * Licensed under the Apache License, Version 2.0 (the "License"); 5 | # * you may not use this file except in compliance with the License. 6 | # * You may obtain a copy of the License at 7 | # * 8 | # * http://www.apache.org/licenses/LICENSE-2.0 9 | # * 10 | # * Unless required by applicable law or agreed to in writing, software 11 | # * distributed under the License is distributed on an "AS IS" BASIS, 12 | # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # * See the License for the specific language governing permissions and 14 | # * limitations under the License. 15 | # */ 16 | 17 | .PHONY: all clean 18 | 19 | all: 20 | $(CC) -o srmtool srm.c 21 | 22 | clean: 23 | $(RM) srmtool 24 | -------------------------------------------------------------------------------- /tools/Makefile: -------------------------------------------------------------------------------- 1 | #/* 2 | # * Copyright 2019 VeriSilicon, Inc. 3 | # * 4 | # * Licensed under the Apache License, Version 2.0 (the "License"); 5 | # * you may not use this file except in compliance with the License. 6 | # * You may obtain a copy of the License at 7 | # * 8 | # * http://www.apache.org/licenses/LICENSE-2.0 9 | # * 10 | # * Unless required by applicable law or agreed to in writing, software 11 | # * distributed under the License is distributed on an "AS IS" BASIS, 12 | # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # * See the License for the specific language governing permissions and 14 | # * limitations under the License. 15 | # */ 16 | 17 | .PHONY: clean all 18 | 19 | all: 20 | make -C srm 21 | cp srm/srmtool . 22 | 23 | clean: 24 | make -C srm clean 25 | rm srmtool 26 | -------------------------------------------------------------------------------- /drivers/debug_trace.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | /* 3 | * Copyright (C) 2020 VeriSilicon Holdings Co., Ltd. 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #include "common.h" 10 | #include "transcoder.h" 11 | 12 | void __trans_dbg(void *dev, int level, const char *fmt, ...) 13 | { 14 | struct va_format vaf; 15 | va_list args; 16 | struct cb_tranx_t *tdev = dev; 17 | struct pci_dev *pdev = tdev->pdev; 18 | 19 | BUG_ON(!tdev); 20 | if (level > tdev->print_level) 21 | return; 22 | 23 | va_start(args, fmt); 24 | 25 | vaf.fmt = fmt; 26 | vaf.va = &args; 27 | 28 | printk(KERN_ERR "%s %04x:%02x:%02x.%d %pV", 29 | tdev->dev_name, 30 | pci_domain_nr(pdev->bus), 31 | pdev->bus->number, 32 | PCI_SLOT(pdev->devfn), 33 | PCI_FUNC(pdev->devfn), &vaf); 34 | 35 | va_end(args); 36 | } 37 | -------------------------------------------------------------------------------- /sdk_inc/common/inc/NetSender.h: -------------------------------------------------------------------------------- 1 | #ifndef NET_SENDER_H_INCLUDED 2 | #define NET_SENDER_H_INCLUDED 3 | 4 | #define CONFIG_NET_BUF_SIZE (2* 1024) 5 | 6 | #define HEART_BEAT 400 7 | #define CLIENT_FPS 500 8 | #define CLIENT_TIMEOUT 600 9 | #define STATUS_PRINT 700 10 | 11 | 12 | #define offsetof(type, member) (size_t)&(((type*)0)->member) 13 | 14 | typedef void * NET_SENDER_HANDLE; 15 | 16 | typedef struct message { 17 | int type; 18 | int log_level; 19 | int dev_id; 20 | int task_id; 21 | int len; 22 | char mtext[CONFIG_NET_BUF_SIZE]; 23 | } UDP_MSG_t; 24 | NET_SENDER_HANDLE net_sender_init(const char *server_addr, int port, int dev_id, int task_idx); 25 | int net_sender_uninit(NET_SENDER_HANDLE inst); 26 | int net_sender_send_fps(NET_SENDER_HANDLE inst, int dev_id, int task_id); 27 | 28 | #endif /* NET_SENDER_H_INCLUDED */ 29 | 30 | -------------------------------------------------------------------------------- /drivers/misc_ip.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 | /* 3 | * Copyright (C) 2020 VeriSilicon Holdings Co., Ltd. 4 | */ 5 | 6 | #ifndef _CB_MISC_IP_H_ 7 | #define _CB_MISC_IP_H_ 8 | 9 | #include 10 | #include 11 | 12 | #include "common.h" 13 | 14 | 15 | int misc_ip_init(struct cb_tranx_t *tdev); 16 | int misc_ip_release(struct cb_tranx_t *tdev); 17 | long misc_ip_ioctl(struct file *filp, 18 | unsigned int cmd, 19 | unsigned long arg, 20 | struct cb_tranx_t *tdev); 21 | 22 | int dtrc_reset(struct cb_tranx_t *data, u32 id); 23 | int tcache_init(struct cb_tranx_t *tdev); 24 | int tcache_reset(struct cb_tranx_t *tdev); 25 | int tcache_subsys_reset(struct cb_tranx_t *tdev, int slice); 26 | 27 | int enable_all_pll(struct cb_tranx_t *tdev); 28 | int adjust_video_pll(struct cb_tranx_t *tdev, 29 | u32 pll_m, u32 pll_s, u32 pll_id); 30 | 31 | #endif /* _CB_MISC_IP_H_ */ 32 | -------------------------------------------------------------------------------- /sdk_inc/common/inc/trans_reg_rw_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __TRANS_REG_RW_H__ 2 | #define __TRANS_REG_RW_H__ 3 | 4 | #include "base_type.h" 5 | #include "transcoder.h" 6 | 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | typedef struct reg_desc REG_DESC_t; 13 | 14 | #define REG_WRITE_DES2BUF(buf, offset, regidx, value) ({ \ 15 | int __off = (offset); \ 16 | (buf)[__off].id = (regidx); \ 17 | (buf)[__off].val = (value); \ 18 | }) 19 | int trans_write_reg(int fd, int core_id, u8 ip_id, u32 reg_idx, int val); 20 | u32 trans_read_reg(int fd, int core_id, u8 ip_id, u32 reg_idx, u32 *val); 21 | int trans_write_reg_batch(int fd, int core_id, u8 ip_id, REG_DESC_t *reg_desc, int reg_desc_size); 22 | u32 trans_read_reg_batch(int fd, int core_id, u8 ip_id, REG_DESC_t *reg_desc, int reg_desc_size); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif 29 | 30 | 31 | -------------------------------------------------------------------------------- /sdk_inc/common/inc/trans_edma_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCIE_EDMA_H__ 2 | #define __PCIE_EDMA_H__ 3 | 4 | #include "base_type.h" 5 | #include "transcoder.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | typedef void * EDMA_HANDLE; 12 | 13 | EDMA_HANDLE TRANS_EDMA_init(char * device); 14 | void TRANS_EDMA_release(EDMA_HANDLE ehd); 15 | 16 | int TRANS_EDMA_RC2EP_nonlink(EDMA_HANDLE ehd, u64 src_base, u64 dst_base, u32 size); 17 | int TRANS_EDMA_EP2RC_nonlink(EDMA_HANDLE ehd, u64 src_base, u64 dst_base, u32 size); 18 | 19 | #ifdef ENABLE_HW_HANDSHAKE 20 | int TRANS_EDMA_RC2EP_link_config(EDMA_HANDLE ehd, u64 link_table_rc_base, void * link_table_rc_vbase, u32 element_size); 21 | #else 22 | int TRANS_EDMA_RC2EP_link_config(EDMA_HANDLE ehd, u64 link_table_rc_base, void * link_table_rc_vbase, u32 element_size, u32 element_num_each); 23 | #endif 24 | int TRANS_EDMA_RC2EP_link_enable(EDMA_HANDLE ehd, int core_id); 25 | int TRANS_EDMA_RC2EP_link_finish(EDMA_HANDLE ehd); 26 | 27 | int TRANS_EDMA_link_is_pending_start(EDMA_HANDLE ehd); 28 | int TRANS_EDMA_link_is_running(EDMA_HANDLE ehd); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | 36 | 37 | -------------------------------------------------------------------------------- /sdk_inc/common/inc/trans_mem_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __TRANSMEM_API_H__ 2 | #define __TRANSMEM_API_H__ 3 | 4 | #include "base_type.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | //#define CHECK_MEM_LEAK_TRANS 11 | 12 | #ifdef CHECK_MEM_LEAK_TRANS 13 | int TransCheckMemLeakInit(); 14 | int TransCheckMemLeakGotResult(); 15 | int trans_calc_alloc_mem_inc(); 16 | int trans_calc_free_mem_inc(); 17 | #endif 18 | 19 | void *Trans_malloc_func(u32 n, const char *func_name, const int line); 20 | void *Trans_calloc_func(u32 n, u32 s, const char *func_name, const int line); 21 | void Trans_free_func(void *p, const char *func_name, const int line); 22 | 23 | 24 | #ifdef CHECK_MEM_LEAK_TRANS 25 | #define Trans_malloc(n) Trans_malloc_func(n, __FUNCTION__, __LINE__) 26 | #define Trans_calloc(n, s) Trans_calloc_func(n, s, __FUNCTION__, __LINE__) 27 | #define Trans_free(p) Trans_free_func(p, __FUNCTION__, __LINE__) 28 | #else 29 | #define Trans_malloc(n) malloc(n) 30 | #define Trans_calloc(n, s) calloc(n, s) 31 | #define Trans_free(p) free(p) 32 | #endif 33 | 34 | 35 | #ifdef __cplusplus 36 | } // extern "C" 37 | #endif 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /drivers/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 VeriSilicon Holdings Co., Ltd. 2 | 3 | ifeq ($(obj),) 4 | obj = . 5 | endif 6 | 7 | ifeq ($(ARCH),aarch64) 8 | ARCH=arm64 9 | endif 10 | 11 | ifeq ($(EMULATOR),y) 12 | EXTRA_CFLAGS += -DEMULATOR 13 | endif 14 | 15 | ifeq ($(HW_HANDSHAKE),y) 16 | EXTRA_CFLAGS += -DENABLE_HANDSHAKE 17 | endif 18 | 19 | transcoder_pcie-objs += transcoder.o pcie.o edma.o vc8000e.o bigsea.o vc8000d.o 20 | transcoder_pcie-objs += memory.o interrupt.o debug_trace.o hw_monitor.o 21 | transcoder_pcie-objs += encoder.o misc_ip.o 22 | 23 | obj-m += transcoder_pcie.o 24 | 25 | KERN_DIR ?= /lib/modules/$(shell uname -r)/build 26 | 27 | all: 28 | $(MAKE) -C $(KERN_DIR) M=`pwd` modules 29 | 30 | test: 31 | $(CC) -o edma_test_hugepage edma_test_hugepage.c -lhugetlbfs 32 | $(CC) -o edma_link_test edma_link_test.c -lhugetlbfs 33 | $(CC) -o mem_test mem_test.c 34 | $(CC) -o edma_phyaddr_test edma_phyaddr_test.c 35 | $(CC) -o pcie_bw_test pcie_bw_test.c -lhugetlbfs 36 | $(CC) -o pcie_ddr_memtest pcie_ddr_memtest.c -lhugetlbfs 37 | 38 | .PHONY: clean 39 | clean: 40 | make -C $(KERN_DIR) M=`pwd` clean 41 | rm -rf edma_test_hugepage mem_test edma_link_test edma_phyaddr_test pcie_bw_test pcie_ddr_memtest 42 | -------------------------------------------------------------------------------- /sdk_inc/common/inc/l2cache_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __L2CACHE_API_H__ 2 | #define __L2CACHE_API_H__ 3 | 4 | #include "base_type.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct { 11 | 12 | int sw_cache_e; 13 | int sw_cache_irq; 14 | int sw_abort_e; 15 | int sw_reorder_e; 16 | u32 sw_rmaxburst; 17 | 18 | int sw_cache_all_e; 19 | int sw_cache_excpt_wr_e; 20 | int sw_axi_rd_id_e; 21 | u32 base_id; 22 | u32 sw_timeout_cycles; 23 | 24 | u32 sw_cache_except_list_address; 25 | 26 | int bus_timeout_int_mask; 27 | int abort_int_mask; 28 | 29 | } L2R_GLOBAL_CFG; 30 | 31 | typedef struct { 32 | 33 | int valid; 34 | u32 start_address; 35 | u32 end_address; 36 | 37 | } L2R_STREAM_CONFIG; 38 | 39 | typedef void * L2CACHE_HANDLE; 40 | 41 | 42 | L2CACHE_HANDLE L2CACHE_init(u32 base_offset, char * device); 43 | void L2CACHE_release(L2CACHE_HANDLE hd); 44 | 45 | int L2R_global_config(L2CACHE_HANDLE hd, L2R_GLOBAL_CFG * pGlobalCfg); 46 | int L2R_stream_config(L2CACHE_HANDLE hd, L2R_STREAM_CONFIG * pCfg); 47 | 48 | int L2R_Enable_Cache(L2CACHE_HANDLE hd, int core_id); 49 | int L2R_Disable_Cache(L2CACHE_HANDLE hd, int core_id); 50 | 51 | int L2R_dump_regs(L2CACHE_HANDLE hd, int core_id); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif /* __L2CACHE_API_H__ */ 58 | 59 | -------------------------------------------------------------------------------- /drivers/interrupt.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | /* 3 | * Copyright (C) 2020 VeriSilicon Holdings Co., Ltd. 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #include "common.h" 10 | #include "encoder.h" 11 | #include "vc8000d.h" 12 | #include "hw_monitor.h" 13 | #include "transcoder.h" 14 | #include "edma.h" 15 | 16 | irqreturn_t unify_isr(int irq, void *data) 17 | { 18 | u32 val; 19 | struct cb_tranx_t *tdev = data; 20 | 21 | do { 22 | if (tdev->hw_err_flag) 23 | return IRQ_NONE; 24 | 25 | /* read global interrupt status. */ 26 | val = ccm_read(tdev, GLOBAL_IRQ_REG_OFF); 27 | if (val & ABORT_INTERRUPT) { 28 | tdev->hw_err_flag = HW_ERR_FLAG; 29 | trans_dbg(tdev, TR_ERR, 30 | "global interrupt status:0x%x, enable hw_err\n", val); 31 | return IRQ_NONE; 32 | } 33 | 34 | if (val & HW_MONITOR) 35 | hw_monitor_isr(0, tdev); 36 | 37 | if (val & THS0_VCD_A) 38 | vcd_isr(0, tdev); 39 | if (val & THS0_VCD_B) 40 | vcd_isr(1, tdev); 41 | if (val & THS1_VCD_A) 42 | vcd_isr(2, tdev); 43 | if (val & THS1_VCD_B) 44 | vcd_isr(3, tdev); 45 | 46 | if (val & THS0_VCE) 47 | vce_isr(0, tdev); 48 | if (val & THS1_VCE) 49 | vce_isr(1, tdev); 50 | 51 | if (val & THS0_BIGSEA) 52 | bigsea_isr(0, tdev); 53 | if (val & THS1_BIGSEA) 54 | bigsea_isr(1, tdev); 55 | } while (0); 56 | 57 | return IRQ_HANDLED; 58 | } 59 | -------------------------------------------------------------------------------- /sdk_inc/common/inc/dtrc_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __DTRC_API_H__ 2 | #define __DTRC_API_H__ 3 | 4 | 5 | #include "base_type.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define DTRC_INPUT_WIDTH_ALIGNMENT 8 12 | #define DTRC_INPUT_HEIGHT_ALIGNMENT 8 13 | 14 | typedef struct { 15 | 16 | int interrupt_en; 17 | 18 | u32 id_y; 19 | u32 id_uv; 20 | u32 id_ybp; 21 | u32 id_uvbp; 22 | 23 | //DTCTRL 0xC8 24 | int bp_byARADDR; 25 | int output_be; 26 | int merge_G1G2_ARID; 27 | u32 bp_swap; 28 | u32 table_swap; 29 | u32 tile_swap; 30 | u32 raster_swap; 31 | u32 max_burst_length; 32 | int is_G1; 33 | int bp_mode; 34 | 35 | } DTRC_GLOBAL_CONFIG; 36 | 37 | typedef struct { 38 | 39 | u32 SrcWidth; 40 | u32 SrcHeight; 41 | int type_main8; 42 | int dc_bypass; 43 | 44 | u64 YDataAddr; 45 | u64 UVDataAddr; 46 | u64 YTableAddr; 47 | u64 UVTableAddr; 48 | 49 | u64 YSSA; 50 | u64 YSEA; 51 | u64 UVSSA; 52 | u64 UVSEA; 53 | 54 | int crop_en; 55 | u32 crop_x; 56 | u32 crop_y; 57 | u32 crop_w; 58 | u32 crop_h; 59 | 60 | } DTRC_FRAME; 61 | 62 | typedef void * DTRC_HANDLE; 63 | 64 | DTRC_HANDLE DTRC_init(u32 base_offset, char * device); 65 | void DTRC_release(DTRC_HANDLE hd); 66 | 67 | int DTRC_global_config(DTRC_HANDLE hd, DTRC_GLOBAL_CONFIG * pGlobalCfg); 68 | int DTRC_frame_config(DTRC_HANDLE hd, DTRC_FRAME *dtrc_para); 69 | int DTRC_enable(DTRC_HANDLE hd, int core_id); 70 | 71 | int DTRC_sw_reset(DTRC_HANDLE hd, int core_id); 72 | int DTRC_get_int_status(DTRC_HANDLE hd, int core_id, u32 * pStatus); 73 | int DTRC_clear_int(DTRC_HANDLE hd, int core_id, u32 int_status); 74 | 75 | int DTRC_dump_regs(DTRC_HANDLE hd, int core_id); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* __DTRC_API_H__ */ 82 | 83 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/hevc/hevcApiVersion.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | #define VCENC_MAJOR_VERSION 2 16 | #define VCENC_MINOR_VERSION 2 17 | 18 | #define VCENC_BUILD_MAJOR 43 19 | #define VCENC_BUILD_MINOR 14 20 | #define VCENC_BUILD_REVISION 10 21 | 22 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/inc/container.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef CONTAINER_H 17 | #define CONTAINER_H 18 | 19 | #include "base_type.h" 20 | 21 | #include "queue.h" 22 | 23 | struct container 24 | { 25 | struct queue parameter_set; /* Parameter set store */ 26 | struct queue picture; /* Picture store */ 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/common/error.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef ERROR_H 17 | #define ERROR_H 18 | 19 | #include 20 | #include "base_type.h" 21 | 22 | #define STRINGIFY(x) #x 23 | #define TOSTRING(x) STRINGIFY(x) 24 | #define ERR "Error: " __FILE__ ", line " TOSTRING(__LINE__) ": " 25 | #define SYSERR "System error message" 26 | 27 | void Error(i32 numArgs, ...); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /vpi/utils/inc/vpi_log_manager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_LOG_MANAGER_H__ 31 | #define __VPI_LOG_MANAGER_H__ 32 | 33 | #include "vpi_log.h" 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | int log_open(char *); 40 | int log_setlevel(int level); 41 | void log_close(); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif /* #ifndef __VPI_LOG_MANAGER_H__ */ 48 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/common/checksum.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2017 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef CHECKSUM_H 17 | #define CHECKSUM_H 18 | 19 | typedef struct { 20 | int offset; 21 | unsigned int chksum; 22 | } checksum_ctx; 23 | void checksum_init(checksum_ctx *ctx, unsigned int chksum, int offset); 24 | unsigned int checksum(checksum_ctx *ctx, unsigned char *data, int len); 25 | unsigned int checksum_final(checksum_ctx *ctx); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/common/crc.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2017 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef CRC_H 17 | #define CRC_H 18 | 19 | /* Polynomial for CRC32 */ 20 | #define QUOTIENT 0x04c11db7 21 | 22 | typedef struct { 23 | unsigned int crctab[256]; 24 | unsigned int crc; 25 | } crc32_ctx; 26 | void crc32_init(crc32_ctx *ctx, unsigned int init_crc); 27 | unsigned int crc32(crc32_ctx *ctx, unsigned char *data, int len); 28 | unsigned int crc32_final(crc32_ctx *ctx); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /vpi/src/dec/vpi_video_dec_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_VIDEO_DEC_API_H__ 31 | #define __VPI_VIDEO_DEC_API_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include "vpi_video_dec.h" 38 | 39 | void vpi_dec_performance_report(VpiDecCtx *vpi_ctx); 40 | void vpi_report_dec_pic_info(VpiDecCtx *vpi_ctx, struct DecPicturePpu *picture); 41 | const char *dec_ret_string(int retval); 42 | void print_decode_return(int retval); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif -------------------------------------------------------------------------------- /sdk_inc/Bigsea/software/inc/decapicommon.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2012 Google Inc. All Rights Reserved. */ 2 | 3 | #ifndef DECAPICOMMON_H 4 | #define DECAPICOMMON_H 5 | 6 | #include "basetype.h" 7 | #include "cwl.h" 8 | 9 | 10 | #define EC_NOT_SUPPORTED (u32)(0x00) 11 | #define EC_SUPPORTED (u32)(0x01) 12 | #define STRIDE_NOT_SUPPORTED (u32)(0x00) 13 | #define STRIDE_SUPPORTED (u32)(0x01) 14 | #define DOUBLE_BUFFER_NOT_SUPPORTED (u32)(0x00) 15 | #define DOUBLE_BUFFER_SUPPORTED (u32)(0x01) 16 | 17 | #define PP_NOT_SUPPORTED_FUSE (u32)(0x00) 18 | #define PP_FUSE_ENABLED (u32)(0x01) 19 | #define PP_FUSE_DEINTERLACING_ENABLED (u32)(0x40000000) 20 | #define PP_FUSE_ALPHA_BLENDING_ENABLED (u32)(0x20000000) 21 | #define MAX_PP_OUT_WIDHT_1920_FUSE_ENABLED (u32)(0x00008000) 22 | #define MAX_PP_OUT_WIDHT_1280_FUSE_ENABLED (u32)(0x00004000) 23 | #define MAX_PP_OUT_WIDHT_720_FUSE_ENABLED (u32)(0x00002000) 24 | #define MAX_PP_OUT_WIDHT_352_FUSE_ENABLED (u32)(0x00001000) 25 | 26 | #define MIN_PIC_WIDTH 1 27 | #define MIN_PIC_HEIGHT 1 28 | 29 | struct DecHwConfig { 30 | u32 ec_support; /* one of the EC values defined above */ 31 | u32 stride_support; /* HW supports separate Y and C strides */ 32 | u32 double_buffer_support; /* Decoder internal reference double buffering */ 33 | }; 34 | 35 | struct DecSwHwBuild { 36 | u32 sw_build; /* Software build ID */ 37 | u32 hw_build; /* Hardware build ID */ 38 | struct CWLHwConfig hw_config; /* Hardware configuration */ 39 | }; 40 | 41 | /* DPB flags to control reference picture format etc. */ 42 | enum DecDpbFlags { 43 | /* Reference frame formats */ 44 | DEC_REF_FRM_RASTER_SCAN = 0x0, 45 | DEC_REF_FRM_TILED_DEFAULT = 0x1 46 | }; 47 | 48 | #define DEC_REF_FRM_FMT_MASK 0x01 49 | 50 | /* Output picture format types */ 51 | enum DecPictureFormat { 52 | DEC_OUT_FRM_TILED_4X4 = 0, 53 | DEC_OUT_FRM_RASTER_SCAN = 1, /* a.k.a. SEMIPLANAR_420 */ 54 | DEC_OUT_FRM_PLANAR_420 = 2 55 | }; 56 | 57 | /* error handling */ 58 | enum DecErrorHandling { 59 | DEC_EC_PICTURE_FREEZE = 0, 60 | DEC_EC_VIDEO_FREEZE = 1, 61 | DEC_EC_PARTIAL_FREEZE = 2, 62 | DEC_EC_PARTIAL_IGNORE = 3 63 | }; 64 | 65 | #endif /* DECAPICOMMON_H */ 66 | -------------------------------------------------------------------------------- /sdk_inc/Bigsea/software/inc/basetype.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2014 Google Inc. All Rights Reserved. */ 2 | 3 | /*------------------------------------------------------------------------------ 4 | -- 5 | -- Description : Basic type definitions. 6 | -- 7 | ------------------------------------------------------------------------------*/ 8 | 9 | #ifndef BASETYPE_H_INCLUDED 10 | #define BASETYPE_H_INCLUDED 11 | 12 | #define VOLATILE volatile 13 | 14 | #ifdef __linux__ /* typedefs for Linux */ 15 | 16 | #include /* for size_t, NULL, etc. */ 17 | 18 | typedef unsigned char u8; 19 | typedef signed char i8; 20 | typedef unsigned short u16; 21 | typedef signed short i16; 22 | typedef unsigned int u32; 23 | typedef signed int i32; 24 | typedef long i64; 25 | typedef unsigned long u64; 26 | 27 | #if defined(_WIN64) 28 | typedef unsigned long long addr_t; 29 | #else 30 | typedef unsigned long addr_t; 31 | #endif 32 | 33 | typedef long off64_t; 34 | typedef size_t ptr_t; 35 | 36 | #ifndef __cplusplus 37 | #ifndef BOOL_DEFINED 38 | #define BOOL_DEFINED 39 | typedef enum { 40 | false = 0, 41 | true = 1 42 | } bool; 43 | #endif 44 | #endif 45 | 46 | #else /* __symbian__ or __win__ or whatever, customize it to suit well */ 47 | 48 | #ifndef _SIZE_T_DEFINED 49 | typedef unsigned int size_t; 50 | 51 | #define _SIZE_T_DEFINED 52 | #endif 53 | 54 | #ifndef NULL 55 | #ifdef __cplusplus 56 | #define NULL 0 57 | #else /* */ 58 | #define NULL ((void *)0) 59 | #endif /* */ 60 | #endif 61 | 62 | typedef unsigned char u8; 63 | typedef signed char i8; 64 | typedef unsigned short u16; 65 | typedef signed short i16; 66 | typedef unsigned int u32; 67 | typedef signed int i32; 68 | #if INTPTR_MAX == INT64_MAX 69 | typedef unsigned long u64; 70 | #else 71 | typedef unsigned long long u64; 72 | #endif 73 | 74 | #ifndef __cplusplus 75 | typedef enum { 76 | false = 0, 77 | true = 1 78 | } bool; 79 | #endif 80 | 81 | #endif 82 | 83 | #if defined(VC1SWDEC_16BIT) || defined(MP4ENC_ARM11) 84 | typedef unsigned short u16x; 85 | typedef signed short i16x; 86 | #else 87 | typedef unsigned int u16x; 88 | typedef signed int i16x; 89 | #endif 90 | 91 | #endif /* BASETYPE_H_INCLUDED */ 92 | -------------------------------------------------------------------------------- /vpi/src/filter/vpi_video_hwdwprc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_VIDEO_HWDWPRC_H__ 31 | #define __VPI_VIDEO_HWDWPRC_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include "vpi_video_prc.h" 38 | 39 | VpiRet vpi_prc_hwdw_init(VpiPrcCtx *vpi_ctx, void *cfg); 40 | VpiRet vpi_prc_hwdw_process(VpiPrcCtx *vpi_ctx, void *indata, void *outdata); 41 | VpiRet vpi_prc_hwdw_control(VpiPrcCtx *vpi_ctx, void *indata, void *outdata); 42 | VpiRet vpi_prc_hwdw_close(VpiPrcCtx *vpi_ctx); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/common/queue.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef QUEUE_H 17 | #define QUEUE_H 18 | 19 | struct node 20 | { 21 | struct node *next; 22 | }; 23 | 24 | struct queue 25 | { 26 | struct node *head; 27 | struct node *tail; 28 | }; 29 | 30 | void queue_init(struct queue *); 31 | void queue_put(struct queue *, struct node *); 32 | void queue_put_tail(struct queue *, struct node *); 33 | void queue_remove(struct queue *, struct node *); 34 | void free_nodes(struct node *tail); 35 | struct node *queue_get(struct queue *); 36 | struct node *queue_get_tail(struct queue *); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/common/hash.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2017 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef HASH_H 17 | #define HASH_H 18 | 19 | #include "crc.h" 20 | #include "checksum.h" 21 | 22 | typedef struct { 23 | unsigned int hash_type; 24 | union { 25 | crc32_ctx crc32_ctx; 26 | checksum_ctx checksum_ctx; 27 | }_ctx; 28 | } hashctx; 29 | void hash_init(hashctx *ctx, unsigned int hash_type); 30 | unsigned int hash(hashctx *ctx, unsigned char *data, int len); 31 | unsigned int hash_finalize(hashctx *ctx); 32 | void hash_reset(hashctx *ctx, int init_hash, int offset); 33 | void hash_getstate(hashctx *ctx, unsigned int *hash, int *offset); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /vpi/src/dec/vpi_video_dec_cfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_VIDEO_DEC_CFG_H__ 31 | #define __VPI_VIDEO_DEC_CFG_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include "vpi_video_dec.h" 38 | 39 | VpiRet vpi_check_out_format_for_trans(VpiDecCtx *vpi_ctx, VpiDecOption *dec_cfg); 40 | VpiRet vpi_dec_init_wrapper(VpiDecCtx *vpi_ctx); 41 | void vpi_dec_set_default_config(VpiDecCtx *vpi_ctx); 42 | void vpi_dec_init_hw_cfg(VpiDecCtx *vpi_ctx, VpiDecOption *dec_cfg); 43 | void vpi_dec_get_tb_cfg(VpiDecCtx *vpi_ctx); 44 | int vpi_dec_cfg_by_seqeuence_info(VpiDecCtx *vpi_ctx); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/hevc/hevcenccache.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef HEVC_ENC_CACHE_H 17 | #define HEVC_ENC_CACHE_H 18 | 19 | #include "base_type.h" 20 | #include "sw_picture.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" 24 | { 25 | #endif 26 | 27 | /*------------------------------------------------------------------------------ 28 | Function prototypes 29 | ------------------------------------------------------------------------------*/ 30 | VCEncRet EnableCache(struct vcenc_instance *vcenc_instance, asicData_s *asic,struct sw_picture *pic); 31 | void DisableCache(struct vcenc_instance *vcenc_instance); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /vpi/src/dec/vpi_video_dec_pp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_VIDEO_DEC_PP_H__ 31 | #define __VPI_VIDEO_DEC_PP_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include "vpi_types.h" 38 | #include "vpi_video_dec.h" 39 | 40 | void dump_ppu(PpUnitConfig *ppu_cfg); 41 | VpiRet vpi_dec_parse_ppu_cfg(VpiDecCtx *vpi_ctx, PpUnitConfig *ppu_cfg); 42 | void vpi_resolve_pp_overlap_ppu(PpUnitConfig *ppu_cfg, 43 | struct TBPpUnitParams *pp_units_params); 44 | VpiRet vpi_dec_parse_resize(VpiDecCtx *vpi_ctx, VpiDecOption *dec_cfg); 45 | void vpi_dec_disable_all_pp_shaper(struct DecConfig *config); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /vpi/src/dec/vpi_video_dec_picture_consume.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_VIDEO_DEC_PICTURE_CONSUME_H__ 31 | #define __VPI_VIDEO_DEC_PICTURE_CONSUME_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include "vpi_video_dec.h" 38 | 39 | void init_dec_pic_wait_consume_list(VpiDecCtx *vpi_ctx); 40 | uint32_t find_dec_pic_wait_consume_index(VpiDecCtx *vpi_ctx, uint8_t *data); 41 | uint32_t find_dec_pic_wait_consume_empty_index(VpiDecCtx *vpi_ctx); 42 | void add_dec_pic_wait_consume_list(VpiDecCtx *vpi_ctx, void *data); 43 | void del_dec_pic_wait_consume_list(VpiDecCtx *vpi_ctx, uint8_t *data); 44 | void free_dec_pic_wait_consume_list(VpiDecCtx *vpi_ctx); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/common/tools.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef TOOLS_H 17 | #define TOOLS_H 18 | 19 | #include "base_type.h" 20 | #include "queue.h" 21 | 22 | typedef struct 23 | { 24 | u8 *stream; 25 | u32 cache; 26 | u32 bit_cnt; 27 | u32 accu_bits; 28 | } bits_buffer_s; 29 | 30 | i32 log2i(i32 x, i32 *result); 31 | i32 check_range(i32 x, i32 min, i32 max); 32 | void **malloc_array(struct queue *q, i32 r, i32 c, i32 size); 33 | void *qalloc(struct queue *q, i32 nmemb, i32 size); 34 | void qfree(struct queue *q); 35 | i32 get_value (bits_buffer_s *b, i32 number, bool bSigned); 36 | void get_align (bits_buffer_s *b, u32 bytes); 37 | char *nextIntToken (char *str, i16 *ret); 38 | i32 getGMVRange (i16 *maxX, i16 *maxY, i32 rangeCfg, i32 isH264, i32 isBSlice); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/inc/test_data_define.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef TEST_DATA_DEFINE_H 17 | #define TEST_DATA_DEFINE_H 18 | 19 | #include 20 | #include "queue.h" 21 | #include "base_type.h" 22 | 23 | #ifndef TEST_DATA 24 | #define COMMENT(b,...) 25 | #else 26 | #define COMMENT(b,...) if ((b)->stream_trace) { \ 27 | char buffer[128]; \ 28 | snprintf(buffer, sizeof(buffer), ##__VA_ARGS__); \ 29 | ASSERT(strlen((b)->stream_trace->comment) + strlen(buffer) < \ 30 | sizeof((b)->stream_trace->comment)); \ 31 | strcat((b)->stream_trace->comment, buffer); \ 32 | } 33 | #endif 34 | 35 | struct stream_trace 36 | { 37 | struct node *next; 38 | char *buffer; 39 | char comment[256]; 40 | size_t size; 41 | FILE *fp; 42 | u32 cnt; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /vpi/src/enc/vpi_video_h26xenc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __VPI_VIDEO_H26XENC_H__ 32 | #define __VPI_VIDEO_H26XENC_H__ 33 | #include "vpi_error.h" 34 | #include "vpi_video_h26xenc_cfg.h" 35 | 36 | extern VPIH26xParamsDef h26x_enc_param_table[]; 37 | 38 | #ifndef NEXT_MULTIPLE 39 | #define NEXT_MULTIPLE(value, n) (((value) + (n)-1) & ~((n)-1)) 40 | #endif 41 | 42 | VpiRet vpi_h26xe_init(VpiH26xEncCtx *enc_ctx, VpiH26xEncCfg *enc_cfg); 43 | VpiRet vpi_h26xe_encode(VpiH26xEncCtx *enc_ctx, void *input, void *output); 44 | VpiRet vpi_h26xe_get_packet(VpiH26xEncCtx *enc_ctx, void *outdata); 45 | VpiRet vpi_h26xe_close(VpiH26xEncCtx *enc_ctx); 46 | VpiRet vpi_h26xe_ctrl(VpiH26xEncCtx *enc_ctx, void *vpi_ctrl_type, 47 | void *vpi_value); 48 | VpiRet vpi_h26xe_put_frame(VpiH26xEncCtx *enc_ctx, void *indata); 49 | #endif /*__VPI_VIDEO_H26XENC_H__ */ 50 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/linux_reference/ewl/ewl_linux_lock.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Description : Locking semaphore for hardware sharing 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | #ifndef __EWL_LINUX_LOCK_H__ 21 | #define __EWL_LINUX_LOCK_H__ 22 | 23 | //Please select right lock for your platform 24 | #ifndef ANDROID_EWL 25 | #define USE_SYS_V_IPC 26 | #else 27 | #define USE_POSIX_SEMAPHORE 28 | #endif 29 | #include 30 | 31 | /*SYSTEM V*/ 32 | #ifdef USE_SYS_V_IPC 33 | #include 34 | #include 35 | 36 | int binary_semaphore_allocation(key_t key, int nsem, int sem_flags); 37 | int binary_semaphore_deallocate(int semid); 38 | int binary_semaphore_wait(int semid, int sem_num); 39 | int binary_semaphore_post(int semid, int sem_num); 40 | int binary_semaphore_initialize(int semid, int sem_num); 41 | #endif 42 | 43 | #endif /* __EWL_LINUX_LOCK_H__ */ 44 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/jpeg/EncJpegCommon.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Hantro Products Oy. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Abstract : 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | /*------------------------------------------------------------------------------ 21 | 22 | Table of contents 23 | 24 | 1. Include headers 25 | 2. External compiler flags 26 | 3. Module defines 27 | 4. Function prototypes 28 | 29 | ------------------------------------------------------------------------------*/ 30 | #ifndef __JPEG_COMMON_H__ 31 | #define __JPEG_COMMON_H__ 32 | 33 | /*------------------------------------------------------------------------------ 34 | 1. Include headers 35 | ------------------------------------------------------------------------------*/ 36 | #include "base_type.h" 37 | #include "enccommon.h" 38 | 39 | /*------------------------------------------------------------------------------ 40 | 2. External compiler flags 41 | ------------------------------------------------------------------------------*/ 42 | 43 | /*------------------------------------------------------------------------------ 44 | 3. Module defines 45 | ------------------------------------------------------------------------------*/ 46 | 47 | /*------------------------------------------------------------------------------ 48 | 4. Function prototypes 49 | ------------------------------------------------------------------------------*/ 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /vpi/src/filter/vpi_video_hwulprc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_VIDEO_HWULPRC_H__ 31 | #define __VPI_VIDEO_HWULPRC_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include "dwl.h" 38 | //#include "vpi_video_prc.h" 39 | 40 | #define MWL_BUF_DEPTH 68 41 | 42 | typedef struct { 43 | int state; 44 | VpiFrame *pic; 45 | void *pic_ppu; 46 | struct DWLLinearMem mwl_mem; 47 | } VpiHwUlPic; 48 | 49 | typedef struct VpiPrcHwUlCtx { 50 | void *mwl; 51 | 52 | int mwl_nums_init; 53 | u32 mwl_item_size; 54 | 55 | uint8_t *p_hugepage_buf_y; 56 | uint8_t *p_hugepage_buf_uv; 57 | uint32_t i_hugepage_size_y; 58 | uint32_t i_hugepage_size_uv; 59 | 60 | VpiFrame *frame; 61 | VpiPixsFmt format; 62 | 63 | int mwl_nums; 64 | 65 | pthread_mutex_t hw_upload_mutex; 66 | 67 | VpiHwUlPic pic_list[MWL_BUF_DEPTH]; 68 | }VpiPrcHwUlCtx; 69 | 70 | 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif -------------------------------------------------------------------------------- /sdk_inc/common/inc/dec400_f2_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEC400_F2_API__H__ 2 | #define __DEC400_F2_API__H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define MAX_READ_STREAM 6 9 | #define MAX_WRITE_STREAM 2 10 | 11 | typedef enum { 12 | F2_COMP_FMT_YUV_ONLY = 5, 13 | F2_COMP_FMT_UV_MIX, 14 | } F2_COMP_FMT; 15 | 16 | typedef enum { 17 | F2_COMP_ALIGN_256B = 4, 18 | F2_COMP_ALIGN_512B, 19 | } F2_ALIGN_MODE; 20 | 21 | typedef enum { 22 | F2_TILE_MODE_64x4 = 0x7, 23 | F2_TILE_MODE_128x4 = 0x18, 24 | F2_TILE_MODE_256x4 = 0x19, 25 | F2_TILE_MODE_128x8 = 0x1E, 26 | } F2_TILE_MODE; 27 | 28 | typedef enum { 29 | F2_BIT_DEPTH_8, 30 | F2_BIT_DEPTH_10, 31 | F2_BIT_DEPTH_12, 32 | F2_BIT_DEPTH_16, 33 | F2_BIT_DEPTH_14, 34 | } F2_BIT_DEPTH; 35 | 36 | typedef enum { 37 | F2_STREAM_MODE_REFY0 = 1, 38 | F2_STREAM_MODE_REFUV0, 39 | F2_STREAM_MODE_REFY1, 40 | F2_STREAM_MODE_REFUV1, 41 | F2_STREAM_MODE_INPUTY, 42 | F2_STREAM_MODE_INPUTUV, 43 | } F2_STREAM_MODE; 44 | 45 | #define F2_STREAM_MODE_REFY F2_STREAM_MODE_REFY0 46 | #define F2_STREAM_MODE_REFUV F2_STREAM_MODE_REFUV0 47 | 48 | typedef enum { 49 | F2_BUTT_JOINT_VC8000E = 0, 50 | F2_BUTT_JOINT_VP9, 51 | } F2_BUTT_JOINT; 52 | 53 | typedef struct { 54 | 55 | F2_BUTT_JOINT ButtJoint; 56 | 57 | int read_miss_policy; 58 | int write_miss_policy; 59 | int read_OT_cnt; 60 | int write_OT_cnt; 61 | 62 | } F2_DEC_GLOBAL_CFG; 63 | 64 | typedef struct { 65 | 66 | int compression_enable; 67 | F2_COMP_FMT compression_format; 68 | F2_ALIGN_MODE compression_align_mode1; 69 | F2_TILE_MODE tile_mode; 70 | F2_STREAM_MODE stream_mode; 71 | F2_BIT_DEPTH bit_depth; 72 | 73 | u32 buf_base; 74 | u32 cache_base; 75 | u32 buf_end; 76 | 77 | } F2_DEC_STREAM_CFG; 78 | 79 | #define READ_STREAM 0 80 | #define WRITE_STREAM 1 81 | 82 | typedef void * F2_DEC_HANDLE; 83 | 84 | F2_DEC_HANDLE F2_DEC_init(char * device); 85 | void F2_DEC_release(F2_DEC_HANDLE hd); 86 | 87 | int F2_DEC_global_config(F2_DEC_HANDLE hd, F2_DEC_GLOBAL_CFG * pGlbCfg); 88 | int F2_DEC_stream_config(F2_DEC_HANDLE hd, int rw, F2_DEC_STREAM_CFG * pStreamCfg); 89 | 90 | int F2_DEC_enable(F2_DEC_HANDLE hd, int core_id); 91 | int F2_DEC_flush(F2_DEC_HANDLE hd, int core_id); 92 | int F2_DEC_DisableAllStreams(F2_DEC_HANDLE hd, int core_id); 93 | 94 | int F2_DEC_dump_regs(F2_DEC_HANDLE hd, int core_id); 95 | 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | 100 | #endif /* __DEC400_F2_API__H__ */ 101 | 102 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/h264high/h264hwd_conflicts.h: -------------------------------------------------------------------------------- 1 | #ifndef __H264_CONFILICTS__ 2 | #define __H264_CONFILICTS__ 3 | 4 | #define H264_RENAME_FUNC(func) H264##func 5 | 6 | #define AllocateAsicBuffers H264_RENAME_FUNC(AllocateAsicBuffers) 7 | #define ReleaseAsicBuffers H264_RENAME_FUNC(ReleaseAsicBuffers) 8 | #define InitList H264_RENAME_FUNC(InitList) 9 | #define ReleaseList H264_RENAME_FUNC(ReleaseList) 10 | #define AllocateIdUsed H264_RENAME_FUNC(AllocateIdUsed) 11 | #define AllocateIdFree H264_RENAME_FUNC(AllocateIdFree) 12 | #define ReleaseId H264_RENAME_FUNC(ReleaseId) 13 | #define GetDataById H264_RENAME_FUNC(GetDataById) 14 | #define GetIdByData H264_RENAME_FUNC(GetIdByData) 15 | #define IncrementRefUsage H264_RENAME_FUNC(IncrementRefUsage) 16 | #define DecrementRefUsage H264_RENAME_FUNC(DecrementRefUsage) 17 | #define MarkHWOutput H264_RENAME_FUNC(MarkHWOutput) 18 | #define ClearHWOutput H264_RENAME_FUNC(ClearHWOutput) 19 | #define MarkTempOutput H264_RENAME_FUNC(MarkTempOutput) 20 | #define FinalizeOutputAll H264_RENAME_FUNC(FinalizeOutputAll) 21 | #define ClearOutput H264_RENAME_FUNC(ClearOutput) 22 | #define PopFreeBuffer H264_RENAME_FUNC(PopFreeBuffer) 23 | #define PushFreeBuffer H264_RENAME_FUNC(PushFreeBuffer) 24 | #define GetFreePicBuffer H264_RENAME_FUNC(GetFreePicBuffer) 25 | #define GetFreeBufferCount H264_RENAME_FUNC(GetFreeBufferCount) 26 | #define SetFreePicBuffer H264_RENAME_FUNC(SetFreePicBuffer) 27 | #define IncrementDPBRefCount H264_RENAME_FUNC(IncrementDPBRefCount) 28 | #define DecrementDPBRefCount H264_RENAME_FUNC(DecrementDPBRefCount) 29 | #define IsBufferReferenced H264_RENAME_FUNC(IsBufferReferenced) 30 | #define IsBufferOutput H264_RENAME_FUNC(IsBufferOutput) 31 | #define MarkOutputPicCorrupt H264_RENAME_FUNC(MarkOutputPicCorrupt) 32 | #define PushOutputPic H264_RENAME_FUNC(PushOutputPic) 33 | #define PeekOutputPic H264_RENAME_FUNC(PeekOutputPic) 34 | #define PopOutputPic H264_RENAME_FUNC(PopOutputPic) 35 | #define RemoveTempOutputAll H264_RENAME_FUNC(RemoveTempOutputAll) 36 | #define RemoveOutputAll H264_RENAME_FUNC(RemoveOutputAll) 37 | #define IsOutputEmpty H264_RENAME_FUNC(IsOutputEmpty) 38 | #define WaitOutputEmpty H264_RENAME_FUNC(WaitOutputEmpty) 39 | #define WaitListNotInUse H264_RENAME_FUNC(WaitListNotInUse) 40 | #define MarkIdAllocated H264_RENAME_FUNC(MarkIdAllocated) 41 | #define MarkIdFree H264_RENAME_FUNC(MarkIdFree) 42 | #define SetAbortStatusInList H264_RENAME_FUNC(SetAbortStatusInList) 43 | #define ClearAbortStatusInList H264_RENAME_FUNC(ClearAbortStatusInList) 44 | #define ResetOutFifoInList H264_RENAME_FUNC(ResetOutFifoInList) 45 | #define Ceil H264_RENAME_FUNC(Ceil) 46 | #define ScalingList H264_RENAME_FUNC(ScalingList) 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /tools/ptest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 2. ./ptest 4 | # can be 0-128 5 | # : 6 | # decoder: decoder test 7 | # encoder: 720p nv12 rawdata encoder test, 8 | # transcoder: 264->264 transcoding test 9 | # : test stream file 10 | # 11 | # Example: 12 | # #> ./ptest 16 transcoder test_1080p.h264 13 | 14 | ## check $1 15 | expr $1 "+" 10 &> /dev/null 16 | if [[ $1 != "" && $? -eq 0 ]];then 17 | echo "$1 test instances was configured" 18 | else 19 | echo "Wrong instance numbers $1" 20 | exit 1 21 | fi 22 | 23 | ## check $2 24 | if [[ "$2" != "decoder" && "$2" != "encoder" && "$2" != "transcoder" ]]; then 25 | echo "Wrong test type $2, supported type: decoder/encoder/transcoder" 26 | exit 1 27 | fi 28 | 29 | ## check $3 30 | if [ ! -f "$3" ]; then 31 | echo "File $3 is not exist" 32 | exit 1 33 | fi 34 | 35 | file=$3 36 | device=transcoder0 37 | ./srmtool & 38 | 39 | while(true) 40 | do 41 | joblist=($(jobs -p)) 42 | while (( ${#joblist[*]}+1 >= $1 )) 43 | do 44 | sleep 1 45 | joblist=($(jobs -p)) 46 | done 47 | 48 | if [ -f "srmtool" ]; then 49 | device=`./srmtool allocate 1080p 1 performance` 50 | if [ "$device" == "" ]; then 51 | echo -ne "\t\t\t\t\t\t\t\t\t\t\t\t [Running tasks:$[${#joblist[*]}+1], no available resource, waitting...]\r" 52 | continue 53 | else 54 | echo "allocated device ${device}" 55 | fi 56 | fi 57 | 58 | echo "start job $[${#joblist[*]}+1]" 59 | 60 | if [ "$2" == "decoder" ]; then 61 | echo "start decoder case" 62 | ffmpeg -y -filter_threads 1 -filter_complex_threads 1 -threads 1 -init_hw_device \ 63 | vpe=dev0:/dev/$device -c:v h264_vpe -i ${file} -filter_complex "hwdownload,format=nv12" -f null /dev/null & 64 | elif [ "$2" == "encoder" ]; then 65 | echo "start encoder case" 66 | ffmpeg -y -filter_threads 1 -filter_complex_threads 1 -threads 1 -init_hw_device \ 67 | vpe=dev0:/dev/$device -s 1280x720 -pix_fmt nv12 \ 68 | -i ${file} -filter_complex 'vpe_pp' -c:v h264enc_vpe -preset superfast -b:v 10000000 -f null /dev/null & 69 | elif [ "$2" == "transcoder" ]; then 70 | echo "start transcoder case" 71 | ffmpeg -y -filter_threads 1 -filter_complex_threads 1 -threads 1 -init_hw_device \ 72 | vpe=dev0:/dev/"${device}" -c:v h264_vpe -transcode 1 \ 73 | -i ${file} -c:v h264enc_vpe -preset superfast -b:v 10000000 -f null /dev/null & 74 | fi 75 | sleep 1 76 | joblist=($(jobs -p)) 77 | echo -ne "\t\t\t\t\t\t\t\t\t\t\t\t [Running tasks: $[${#joblist[*]}+1]]\r" 78 | done 79 | -------------------------------------------------------------------------------- /vpi/src/dec/vpi_video_dec_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_VIDEO_DEC_BUFFER_H__ 31 | #define __VPI_VIDEO_DEC_BUFFER_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include "vpi_video_dec.h" 38 | 39 | void vpi_dec_buf_list_add(BufLink **head, BufLink *list); 40 | BufLink* vpi_dec_buf_list_delete(BufLink *head); 41 | int vpi_send_packet_to_decode_buffer(VpiDecCtx *vpi_ctx, VpiPacket *vpi_packet, 42 | struct DWLLinearMem stream_buffer); 43 | int vpi_dec_get_stream_buffer_index(VpiDecCtx *vpi_ctx, int status); 44 | void vpi_dec_release_ext_buffers(VpiDecCtx *vpi_ctx); 45 | int vpi_dec_check_buffer_number_for_trans(VpiDecCtx *vpi_ctx); 46 | int vpi_dec_set_pts_decid(VpiDecCtx *vpi_ctx); 47 | void vpi_dec_clear_unused_pts(VpiDecCtx *vpi_ctx); 48 | int vpi_dec_set_pts_dts(VpiDecCtx *vpi_ctx, VpiPacket *pkt); 49 | VpiRet vpi_dec_output_frame(VpiDecCtx *vpi_ctx, VpiFrame *vpi_frame, 50 | struct DecPicturePpu *decoded_pic); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /drivers/vc8000d.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 | /* 3 | * Copyright (C) 2020 VeriSilicon Holdings Co., Ltd. 4 | */ 5 | 6 | #ifndef _CB_VC8000D_H_ 7 | #define _CB_VC8000D_H_ 8 | 9 | #include 10 | #include 11 | #include "common.h" 12 | 13 | #define VCD_PLL_M_NORMAL 520 /* 650MHz */ 14 | #define VCD_PLL_S_NORMAL 2 /* 650MHz */ 15 | #define VCD_PLL_M_75 390 /* 487.5MHz */ 16 | #define VCD_PLL_S_75 2 /* 487.5MHz */ 17 | #define VCD_PLL_M_50 520 /* 325MHz */ 18 | #define VCD_PLL_S_50 3 /* 325MHz */ 19 | #define VCD_PLL_M_25 520 /* 162.5MHz */ 20 | #define VCD_PLL_S_25 4 /* 162.5MHz */ 21 | 22 | #define VCD_MAX_CORES 4 23 | 24 | /* 25 | * This struct record vc8000d detail information. 26 | * @cores: core count 27 | * @core[VCD_MAX_CORES]: cores information 28 | * @core_format[VCD_MAX_CORES]: format of core supported 29 | * @vcd_cfg[VCD_MAX_CORES]: vcd core config 30 | * @rsv_lock: protect reserve and release 31 | * @dec_wait_queue: when receive irq, weak up waited task 32 | * @hw_queue: when release a core, weak reserved task 33 | * @list_live: LIVE priority task queue,LIVE task will add to this queue 34 | * @list_vod: VOD priority task queue,VOD task will add to this queue 35 | * @taskq[TR_MAX_LIST]: save list element of reserved core 36 | * @live_count: the count of element in list_live 37 | * @vod_count: the count of element in list_vod 38 | * @loading[2]: calculate decoder utilization, only statistics s0_a and s1_a. 39 | * @loading_lock: protect get decoder utilization. 40 | * @loading_timer: calculate decoder loading when get timer interrupt. 41 | * @tdev: record transcoder devices description 42 | */ 43 | struct vc8000d_t { 44 | int cores; 45 | struct video_core_info core[VCD_MAX_CORES]; 46 | u32 core_format[VCD_MAX_CORES]; 47 | struct vcd_core_config vcd_cfg[VCD_MAX_CORES]; 48 | spinlock_t rsv_lock; 49 | spinlock_t chk_irq_lock; 50 | wait_queue_head_t dec_wait_queue; 51 | wait_queue_head_t hw_queue; 52 | struct list_head list_live; 53 | struct list_head list_vod; 54 | struct rsv_taskq *taskq[TR_MAX_LIST]; 55 | int live_count; 56 | int vod_count; 57 | struct loading_info loading[2]; 58 | struct timer_list loading_timer; 59 | struct cb_tranx_t *tdev; 60 | }; 61 | 62 | 63 | int vc8000d_init(struct cb_tranx_t *tdev); 64 | int vc8000d_release(struct cb_tranx_t *tdev); 65 | long vc8000d_ioctl(struct file *filp, 66 | unsigned int cmd, 67 | unsigned long arg, 68 | struct cb_tranx_t *tdev); 69 | int adjust_vcd_pll(struct cb_tranx_t *tdev, u32 slice_id); 70 | void vcd_close(struct cb_tranx_t *tdev, struct file *filp); 71 | int vc8000d_core_reset(struct cb_tranx_t *tdev, int core_id); 72 | irqreturn_t vcd_isr(int irq, void *data); 73 | 74 | #endif /* _CB_VC8000D_H_ */ 75 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/jpeg/EncJpegInit.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Hantro Products Oy. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Abstract : 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | /*------------------------------------------------------------------------------ 21 | 22 | Table of contents 23 | 24 | 1. Include headers 25 | 2. Module defines 26 | 3. Data types 27 | 4. Function prototypes 28 | 29 | ------------------------------------------------------------------------------*/ 30 | #ifndef __ENC_JPEG_INIT_H__ 31 | #define __ENC_JPEG_INIT_H__ 32 | 33 | /*------------------------------------------------------------------------------ 34 | 1. Include headers 35 | ------------------------------------------------------------------------------*/ 36 | #include "jpegencapi.h" 37 | #include "EncJpegQuantTables.h" 38 | #include "EncJpegInstance.h" 39 | 40 | /*------------------------------------------------------------------------------ 41 | 2. Module defines 42 | ------------------------------------------------------------------------------*/ 43 | 44 | /*------------------------------------------------------------------------------ 45 | 3. Data types 46 | ------------------------------------------------------------------------------*/ 47 | 48 | /*------------------------------------------------------------------------------ 49 | 4. Function prototypes 50 | ------------------------------------------------------------------------------*/ 51 | 52 | JpegEncRet JpegInit(const JpegEncCfg * pEncCfg, jpegInstance_s ** instAddr); 53 | 54 | void JpegShutdown(jpegInstance_s * data); 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /tools/srm/README.md: -------------------------------------------------------------------------------- 1 | Srmtool is tool to do below two things: 2 | 3 | ## 1. Resource Monitoring: 4 | 5 | It will show the HW status include: 6 | * Encoder usage(percentage) 7 | * Decoder usage(percentage) 8 | * Memory used (MB) 9 | * Mempry free (MB) 10 | 11 | ###### Command line example: 12 | ```bash 13 | ./srmtool 14 | 15 | [vsi@vsi ~/zhanggy/vpe/tools]$ ./srmtool 16 | transcoder 0: power=on, decoder= 0%, encoder= 0%, memory used=3452MB, memory free= 0MB - active 17 | transcoder 1: power=on, decoder= 76%, encoder= 80%, memory used= 146MB, memory free=3306MB - active 18 | transcoder 2: power=on, decoder= 45%, encoder= 41%, memory used= 146MB, memory free=3306MB - active 19 | transcoder 3: power=on, decoder= 76%, encoder= 83%, memory used= 293MB, memory free=3159MB - active 20 | transcoder 4: power=on, decoder= 79%, encoder= 80%, memory used= 293MB, memory free=3159MB - active 21 | transcoder 5: power=on, decoder= 55%, encoder= 50%, memory used= 293MB, memory free=3159MB - active 22 | transcoder 6: power=on, decoder= 78%, encoder= 81%, memory used= 293MB, memory free=3159MB - active 23 | transcoder 7: power=on, decoder= 79%, encoder= 81%, memory used= 293MB, memory free=3159MB - active 24 | transcoder 8: power=on, decoder= 3%, encoder= 4%, memory used= 0MB, memory free=3454MB - freee 25 | transcoder 9: power=on, decoder= 79%, encoder= 82%, memory used= 293MB, memory free=3159MB - active 26 | 27 | ``` 28 | 29 | ## 2. Resource Matcher: 30 | 31 | For new task, it can be used to find the most-match transcoder devices. 32 | It can calculate the codec workload on all of the devices, and try to find the most-matched devices. 33 | 34 | It support two modes to allocate the resources: 35 | 36 | #### 1.Exclusive Mode: 37 | 38 | In this mode, once any task is running on the HW, then it can't be assigned to new task any more until it's free. 39 | 40 | ###### Command line example: 41 | ```bash 42 | ./srmtool allocate 43 | transcoder7 44 | ``` 45 | 46 | #### 2.Shared Mode: 47 | 48 | One HW can be assigned many tasks until reach it's limit. 49 | 50 | * If the new task required resources(decoder, encoder, memory) are less than what HW left, then the new task can be assigned to this HW; This mode is called "powersaving mode". 51 | 52 | * But to achieve best performance, maybe assign the new task to a complete free HW is the better choise. This mode is called "performance mode". 53 | 54 | How to describe the new task required resources? in this program I used resolution: 55 | 480p/720p/1080p/2160p. 56 | 57 | How many decoder/encoder/memory are required by 480p@30Hz/720p@30/1080p@30/2160p@30 transcoding task, 58 | then 480p/720p/1080p/2160p means how many decoder/encoder/memory resources. 59 | 60 | ###### Command line example: 61 | ```bash 62 | ./srmtool allocate 1080p 1 performance 63 | transcoder5 64 | ./srmtool allocate 480p 2 powersaving 65 | transcoder0 66 | ``` -------------------------------------------------------------------------------- /vpi/src/enc/vpi_video_enc_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __ENC_COMMON__ 31 | #define __ENC_COMMON__ 32 | 33 | #include "vpi_types.h" 34 | 35 | #define ENC_PARAMS_NAME_MAX_LEN 100 /*The max length of params in enc_params*/ 36 | #define ENC_PARAMS_VALUE_MAX_LEN 80 /*The max length of value in enc_params*/ 37 | #define ENC_PARAM_MAX_SEG_NUM 4 /*The max segments between two single quotes*/ 38 | #define ENC_PARAM_MAX_SEG_LEN 20 /*The max length of each segment*/ 39 | 40 | typedef enum { 41 | VPI_ENC_PARA_INT, 42 | VPI_ENC_PARA_FLOAT, 43 | VPI_ENC_PARA_STRING, 44 | VPI_ENC_PARA_COLON2, 45 | } VpiParaType; 46 | 47 | typedef struct { 48 | const char *name; 49 | int offset; 50 | double min; 51 | double max; 52 | VpiParaType type; 53 | } VpiEncSetting; 54 | 55 | char *vpi_enc_get_paraname_paravalue(char *string, char *param_name, 56 | char *param_val); 57 | int vpi_enc_split_string(char ** tgt, int max, char * src, char * split); 58 | int vpi_enc_parse_param(char *src, VpiEncSetting setting[], int length, 59 | void *output); 60 | int vpi_enc_set_param(char *key, char *val, VpiEncSetting setting[], int length, 61 | void *output); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/vp9/vp9header.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Abstract : VP9 stream headers 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | #ifndef VP9HEADERS_H 21 | #define VP9HEADERS_H 22 | 23 | /*------------------------------------------------------------------------------ 24 | 1. Include headers 25 | ------------------------------------------------------------------------------*/ 26 | #include "vp9instance.h" 27 | 28 | /*------------------------------------------------------------------------------ 29 | 2. External compiler flags 30 | -------------------------------------------------------------------------------- 31 | 32 | -------------------------------------------------------------------------------- 33 | 3. Module defines 34 | ------------------------------------------------------------------------------*/ 35 | 36 | /*------------------------------------------------------------------------------ 37 | 4. Function prototypes 38 | ------------------------------------------------------------------------------*/ 39 | void VP9FrameHeader(vp9Instance_s *); 40 | void VP9FrameHeaderFinish(vp9Instance_s *container); 41 | void VP9FrameTag(vp9Instance_s *); 42 | void VP9DataPartitionSizes(vp9Instance_s *); 43 | #endif 44 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/inc/mjpegencapi.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Hantro Products Oy. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Abstract : Hantro H1 JPEG Encoder API 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | /*------------------------------------------------------------------------------ 21 | 22 | Table of contents 23 | 24 | 1. Include headers 25 | 2. Module defines 26 | 3. Data types 27 | 4. Function prototypes 28 | 29 | ------------------------------------------------------------------------------*/ 30 | 31 | #ifndef __MJPEGENCAPI_H__ 32 | #define __MJPEGENCAPI_H__ 33 | 34 | #ifdef __cplusplus 35 | extern "C" 36 | { 37 | #endif 38 | 39 | /*------------------------------------------------------------------------------ 40 | 1. Include headers 41 | ------------------------------------------------------------------------------*/ 42 | 43 | #include "base_type.h" 44 | 45 | /*------------------------------------------------------------------------------ 46 | 2. Module defines 47 | ------------------------------------------------------------------------------*/ 48 | typedef struct 49 | { 50 | u32 id; 51 | u32 flags; //fixed to 0x10 to indicate key frame 52 | u32 offset; //offset to movi 53 | u32 length; //length of chunk 54 | }IDX_CHUNK; 55 | 56 | /*------------------------------------------------------------------------------ 57 | 4. Function prototypes 58 | ------------------------------------------------------------------------------*/ 59 | void MjpegAVIchunkheader(u8 **buf,char *type,char *name,u32 length); 60 | u32 MjpegEncodeAVIHeader(u32 *outbuf,u32 width,u32 height, u32 frameRateNum, u32 frameRateDenom, u32 frameNum); 61 | u32 MjpegEncodeAVIidx(u32 *outbuf,IDX_CHUNK *idx,u32 movi_idx, u32 frameNum); 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/common/sw_put_bits.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef SW_PUT_BITS_H 17 | #define SW_PUT_BITS_H 18 | 19 | #include "base_type.h" 20 | #include "test_data_define.h" 21 | 22 | 23 | struct buffer 24 | { 25 | #ifdef TEST_DATA 26 | struct stream_trace *stream_trace; 27 | u32 input_cabac_BIN_number; 28 | u32 input_bypass_BIN_number; 29 | #endif 30 | u8 *stream; /* get_buffer(): stream = hevc_nal->nal */ 31 | u32 *cnt; /* get_buffer(): cnt = &hevc_nal->cnt */ 32 | u32 size; /* get_buffer(): size of stream buffer */ 33 | u32 cache; /* Next bits before flushing to stream */ 34 | u32 bit_cnt; /* Bit count of above cache */ 35 | ptr_t stream_bus; /* get_buffer(): stream = hevc_nal->nal */ 36 | u32 byteCnt; /* Byte counter */ 37 | u32 overflow; /*show if bitstream buffer is overflow*/ 38 | u32 emulCnt; /* Counter for emulation_3_byte, needed in SEI */ 39 | }; 40 | 41 | void put_bit(struct buffer *, i32, i32); 42 | void put_bit_32(struct buffer *b, i32 value, i32 number); 43 | i32 buffer_full(struct buffer *b); 44 | void put_bit_ue(struct buffer *b, i32 val); 45 | void put_bit_se(struct buffer *b, i32 val); 46 | void rbsp_trailing_bits(struct buffer *); 47 | void put_bits_startcode(struct buffer *b); 48 | void rbsp_flush_bits(struct buffer *b); 49 | 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/vp9/vp9testid.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Description : Encoder setup according to a test vector 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | #ifndef __VP9_TESTID_H__ 21 | #define __VP9_TESTID_H__ 22 | 23 | /*------------------------------------------------------------------------------ 24 | 1. Include headers 25 | ------------------------------------------------------------------------------*/ 26 | #include "base_type.h" 27 | #include "vp9instance.h" 28 | #include "vp9ratecontrol.h" 29 | 30 | /*------------------------------------------------------------------------------ 31 | 2. External compiler flags 32 | -------------------------------------------------------------------------------- 33 | 34 | -------------------------------------------------------------------------------- 35 | 3. Module defines 36 | ------------------------------------------------------------------------------*/ 37 | 38 | /*------------------------------------------------------------------------------ 39 | 4. Function prototypes 40 | ------------------------------------------------------------------------------*/ 41 | 42 | void Vp9ConfigureTestBeforeFrame(vp9Instance_s *inst); 43 | void Vp9ConfigureTestPenalties(vp9Instance_s *inst); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/jpeg/EncJpegPutBits.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Hantro Products Oy. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Abstract : 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | /*------------------------------------------------------------------------------ 21 | 22 | Table of contents 23 | 24 | 1. Include headers 25 | 2. External compiler flags 26 | 3. Module defines 27 | 4. Function prototypes 28 | 29 | ------------------------------------------------------------------------------*/ 30 | #ifndef __ENC_JPEG_PUT_BITS_H__ 31 | #define __ENC_JPEG_PUT_BITS_H__ 32 | 33 | /*------------------------------------------------------------------------------ 34 | 1. Include headers 35 | ------------------------------------------------------------------------------*/ 36 | #include "base_type.h" 37 | #include "enccommon.h" 38 | #include "string.h" 39 | #include "test_data_define.h" 40 | 41 | /*------------------------------------------------------------------------------ 42 | 2. External compiler flags 43 | -------------------------------------------------------------------------------- 44 | 45 | -------------------------------------------------------------------------------- 46 | 3. Module defines 47 | ------------------------------------------------------------------------------*/ 48 | 49 | /*------------------------------------------------------------------------------ 50 | 4. Function prototypes 51 | ------------------------------------------------------------------------------*/ 52 | void EncJpegPutBits(stream_s *, u32, u32); 53 | void EncJpegByteAligned(stream_s * stream); 54 | void EncJpegHeaderPutBits(stream_s *, u32, u32); 55 | void EncJpegNextByteAligned(stream_s * stream); 56 | bool_e EncJpegBufferStatus(stream_s * stream); 57 | bool_e EncJpegSetBuffer(stream_s * buffer, u8 * stream, u32 size); 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/vp9/vp9init.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Abstract : Encoder initialization and setup 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | #ifndef __VP9_INIT_H__ 21 | #define __VP9_INIT_H__ 22 | 23 | /*------------------------------------------------------------------------------ 24 | 1. Include headers 25 | ------------------------------------------------------------------------------*/ 26 | #include "vp9encapi.h" 27 | #include "vp9instance.h" 28 | 29 | /*------------------------------------------------------------------------------ 30 | 2. External compiler flags 31 | -------------------------------------------------------------------------------- 32 | 33 | -------------------------------------------------------------------------------- 34 | 3. Module defines 35 | ------------------------------------------------------------------------------*/ 36 | 37 | /*------------------------------------------------------------------------------ 38 | 4. Function prototypes 39 | ------------------------------------------------------------------------------*/ 40 | 41 | bool_e VP9CheckCfg(const VP9EncConfig *pEncCfg); 42 | i32 VP9GetAllowedWidth(i32 width, VP9EncPictureType inputType); 43 | 44 | VP9EncRet VP9Init(const VP9EncConfig *pEncCfg, vp9Instance_s **instAddr); 45 | 46 | void VP9Shutdown(vp9Instance_s *data); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/common/vpufeature.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- Copyright (c) 2015-2017, VeriSilicon Inc. All rights reserved -- 3 | -- -- 4 | -- This software is confidential and proprietary and may be used only as -- 5 | -- expressly authorized by VeriSilicon in a written licensing agreement. -- 6 | -- -- 7 | -- This entire notice must be reproduced on all copies -- 8 | -- and may not be removed. -- 9 | -- -- 10 | -------------------------------------------------------------------------------- 11 | -- Redistribution and use in source and binary forms, with or without -- 12 | -- modification, are permitted provided that the following conditions are met:-- 13 | -- * Redistributions of source code must retain the above copyright notice, -- 14 | -- this list of conditions and the following disclaimer. -- 15 | -- * Redistributions in binary form must reproduce the above copyright -- 16 | -- notice, this list of conditions and the following disclaimer in the -- 17 | -- documentation and/or other materials provided with the distribution. -- 18 | -- * Neither the names of Google nor the names of its contributors may be -- 19 | -- used to endorse or promote products derived from this software -- 20 | -- without specific prior written permission. -- 21 | -------------------------------------------------------------------------------- 22 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"-- 23 | -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- 24 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- 25 | -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- 26 | -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- 27 | -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- 28 | -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- 29 | -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- 30 | -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- 31 | -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- 32 | -- POSSIBILITY OF SUCH DAMAGE. -- 33 | -------------------------------------------------------------------------------- 34 | ------------------------------------------------------------------------------*/ 35 | 36 | #ifndef __VPU_FEATURES__ 37 | #define __VPU_FEATURES__ 38 | 39 | #include "basetype.h" 40 | #include "vpu_features_struct.h" 41 | 42 | void GetReleaseHwFeaturesByID(u32 hw_build_id, struct DecHwFeatures *hw_feature); 43 | 44 | #endif /* __VPU_FEATURES__ */ 45 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/jpeg/EncJpegCodeFrame.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Hantro Products Oy. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Abstract : 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | /*------------------------------------------------------------------------------ 21 | 22 | Table of contents 23 | 24 | 1. Include headers 25 | 2. External compiler flags 26 | 3. Module defines 27 | 4. Function prototypes 28 | 29 | ------------------------------------------------------------------------------*/ 30 | #ifndef __ENC_JPEG_CODE_VOP_H__ 31 | #define __ENC_JPEG_CODE_VOP_H__ 32 | 33 | /*------------------------------------------------------------------------------ 34 | 1. Include headers 35 | ------------------------------------------------------------------------------*/ 36 | #include "base_type.h" 37 | #include "EncJpeg.h" 38 | #include "EncJpegInstance.h" 39 | 40 | #include "enccommon.h" 41 | #include "encasiccontroller.h" 42 | #include "EncJpegPutBits.h" 43 | 44 | /*------------------------------------------------------------------------------ 45 | 2. External compiler flags 46 | -------------------------------------------------------------------------------- 47 | 48 | -------------------------------------------------------------------------------- 49 | 3. Module defines 50 | ------------------------------------------------------------------------------*/ 51 | 52 | typedef enum 53 | { 54 | JPEGENCODE_OK = 0, 55 | JPEGENCODE_TIMEOUT = 1, 56 | JPEGENCODE_DATA_ERROR = 2, 57 | JPEGENCODE_HW_ERROR = 3, 58 | JPEGENCODE_SYSTEM_ERROR = 4, 59 | JPEGENCODE_HW_RESET = 5 60 | } jpegEncodeFrame_e; 61 | 62 | /*------------------------------------------------------------------------------ 63 | 4. Function prototypes 64 | ------------------------------------------------------------------------------*/ 65 | 66 | jpegEncodeFrame_e EncJpegCodeFrameRun(jpegInstance_s * inst); 67 | jpegEncodeFrame_e EncJpegCodeFrameWait(jpegInstance_s * inst); 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/vp9/vp9entropy.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Abstract : Encoder initialization and setup 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | #ifndef VP9ENTROPY_H 21 | #define VP9ENTROPY_H 22 | 23 | /*------------------------------------------------------------------------------ 24 | Include headers 25 | ------------------------------------------------------------------------------*/ 26 | #include "vp9entropytools.h" 27 | #include "vp9putbits.h" 28 | #include "vp9instance.h" 29 | 30 | /*------------------------------------------------------------------------------ 31 | External compiler flags 32 | -------------------------------------------------------------------------------- 33 | 34 | -------------------------------------------------------------------------------- 35 | Module defines 36 | ------------------------------------------------------------------------------*/ 37 | 38 | /*------------------------------------------------------------------------------ 39 | Function prototypes 40 | ------------------------------------------------------------------------------*/ 41 | void EncSwapEndianess(u32 *buf, u32 sizeBytes); 42 | void InitEntropy(vp9Instance_s *inst); 43 | void WriteEntropyTables(vp9Instance_s *inst, u32 fullRefresh); 44 | void CoeffProb(vp9buffer *buffer, i32 curr[4][8][3][11], i32 prev[4][8][3][11]); 45 | void MvProb(vp9buffer *buffer, i32 curr[2][19], i32 prev[2][19]); 46 | i32 CostMv(i32 mvd, i32 *mvProb); 47 | void SetModeCosts(vp9Instance_s *inst, i32 coeff, i32 segment); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /vpi/inc/vpi_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_API_H__ 31 | #define __VPI_API_H__ 32 | 33 | /* 34 | * provides application programming interface for the application layer. 35 | */ 36 | 37 | #include "vpi_types.h" 38 | 39 | /** 40 | * @brief free pointer 41 | * @param arg pointer waiting to be freed 42 | */ 43 | void vpi_freep(void *arg); 44 | 45 | /** 46 | * @brief Create system info structure 47 | * @param sys_info pointer of the system info 48 | */ 49 | 50 | int vpi_get_sys_info_struct(VpiSysInfo **sys_info); 51 | 52 | /** 53 | * @brief Create empty context structure and api function pointers. 54 | * Use functions in VpiApi to access vpi services. 55 | * @param ctx pointer of the vpi context 56 | * @param vpi pointer of the vpi api function 57 | * @param fd handler of the device 58 | * @param plugin vpi plugin type 59 | */ 60 | 61 | int vpi_create(VpiCtx *ctx, VpiApi **vpi, int fd, VpiPlugin plugin); 62 | 63 | /** 64 | * @brief Destroy vpi context and free both context and vpi structure 65 | * @param ctx The context of vpi 66 | * @param fd handler of the device 67 | */ 68 | 69 | int vpi_destroy(VpiCtx ctx, int fd); 70 | 71 | /** 72 | * @brief Open vpi hardware device 73 | * @param device The hardware device path 74 | */ 75 | 76 | int vpi_open_hwdevice(const char *device); 77 | 78 | /** 79 | * @brief Close vpi hardware device 80 | * @param fd The device handle 81 | */ 82 | 83 | int vpi_close_hwdevice(int fd); 84 | 85 | /** 86 | * @brief Get VPI error code 87 | * @param error vpi error code 88 | */ 89 | char *vpi_error_str(int vpi_error); 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/h264high/h264hwd_cabac.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- Copyright (c) 2015-2017, VeriSilicon Inc. All rights reserved -- 3 | -- Copyright (c) 2011-2014, Google Inc. All rights reserved. -- 4 | -- Copyright (c) 2007-2010, Hantro OY. All rights reserved. -- 5 | -- -- 6 | -- This software is confidential and proprietary and may be used only as -- 7 | -- expressly authorized by VeriSilicon in a written licensing agreement. -- 8 | -- -- 9 | -- This entire notice must be reproduced on all copies -- 10 | -- and may not be removed. -- 11 | -- -- 12 | -------------------------------------------------------------------------------- 13 | -- Redistribution and use in source and binary forms, with or without -- 14 | -- modification, are permitted provided that the following conditions are met:-- 15 | -- * Redistributions of source code must retain the above copyright notice, -- 16 | -- this list of conditions and the following disclaimer. -- 17 | -- * Redistributions in binary form must reproduce the above copyright -- 18 | -- notice, this list of conditions and the following disclaimer in the -- 19 | -- documentation and/or other materials provided with the distribution. -- 20 | -- * Neither the names of Google nor the names of its contributors may be -- 21 | -- used to endorse or promote products derived from this software -- 22 | -- without specific prior written permission. -- 23 | -------------------------------------------------------------------------------- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"-- 25 | -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- 26 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- 27 | -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- 28 | -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- 29 | -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- 30 | -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- 31 | -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- 32 | -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- 33 | -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- 34 | -- POSSIBILITY OF SUCH DAMAGE. -- 35 | -------------------------------------------------------------------------------- 36 | ------------------------------------------------------------------------------*/ 37 | 38 | #ifndef __H264CABAC_H__ 39 | #define __H264CABAC_H__ 40 | 41 | #include "basetype.h" 42 | 43 | extern const u32 h264_cabac_init_values[4*460*2/4]; 44 | 45 | #endif /* __H264CABAC_H__ */ 46 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/vp9/vp9codeframe.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Description : Encode picture 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | #ifndef __VP9_CODE_FRAME_H__ 21 | #define __VP9_CODE_FRAME_H__ 22 | 23 | /*------------------------------------------------------------------------------ 24 | 1. Include headers 25 | ------------------------------------------------------------------------------*/ 26 | #include "vp9instance.h" 27 | 28 | /*------------------------------------------------------------------------------ 29 | 2. External compiler flags 30 | -------------------------------------------------------------------------------- 31 | 32 | -------------------------------------------------------------------------------- 33 | 3. Module defines 34 | ------------------------------------------------------------------------------*/ 35 | 36 | typedef enum 37 | { 38 | VP9ENCODE_OK = 0, 39 | VP9ENCODE_TIMEOUT = 1, 40 | VP9ENCODE_DATA_ERROR = 2, 41 | VP9ENCODE_HW_ERROR = 3, 42 | VP9ENCODE_SYSTEM_ERROR = 4, 43 | VP9ENCODE_HW_RESET = 5 44 | } vp9EncodeFrame_e; 45 | 46 | /*------------------------------------------------------------------------------ 47 | 4. Function prototypes 48 | ------------------------------------------------------------------------------*/ 49 | void VP9SetFrameParams(vp9Instance_s *inst); 50 | vp9EncodeFrame_e VP9CodeFrame(vp9Instance_s *inst); 51 | vp9EncodeFrame_e VP9CodeFrameMultiPass(vp9Instance_s *inst); 52 | //void VP9InitPenalties(vp9Instance_s * inst); 53 | u32 ProcessStatistics(vp9Instance_s *inst, i32 *boost); 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/vp9/vp9entropytools.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Abstract : Entropy coding 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | #ifndef VP9ENTROPY_TOOLS_H 21 | #define VP9ENTROPY_TOOLS_H 22 | 23 | /*------------------------------------------------------------------------------ 24 | Include headers 25 | ------------------------------------------------------------------------------*/ 26 | #include "base_type.h" 27 | 28 | /*------------------------------------------------------------------------------ 29 | External compiler flags 30 | -------------------------------------------------------------------------------- 31 | 32 | -------------------------------------------------------------------------------- 33 | Module defines 34 | ------------------------------------------------------------------------------*/ 35 | typedef struct 36 | { 37 | i32 skipFalseProb; 38 | i32 intraProb; 39 | i32 lastProb; 40 | i32 gfProb; 41 | i32 kfYmodeProb[4]; 42 | i32 YmodeProb[4]; 43 | i32 kfUVmodeProb[3]; 44 | i32 UVmodeProb[3]; 45 | i32 kfBmodeProb[10][10][9]; 46 | i32 BmodeProb[9]; 47 | i32 coeffProb[4][8][3][11]; 48 | i32 oldCoeffProb[4][8][3][11]; 49 | i32 mvRefProb[4]; 50 | i32 mvProb[2][19]; 51 | i32 oldMvProb[2][19]; 52 | i32 subMvPartProb[3]; /* TODO use pointer directly to subMvPartProb */ 53 | i32 subMvRefProb[5][3]; /* TODO use pointer directly to subMvRefProb */ 54 | i32 defaultCoeffProbFlag; /* Flag for coeffProb == defaultCoeffProb */ 55 | i32 updateCoeffProbFlag; /* Flag for coeffProb != oldCoeffProb */ 56 | i32 segmentProb[3]; 57 | } entropy; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/common/vpu_features_struct.h: -------------------------------------------------------------------------------- 1 | struct DecHwFeatures { 2 | u32 id; 3 | u32 id_mask; 4 | /* decoding formats related */ 5 | u32 mpeg4_support; 6 | u32 custom_mpeg4_support; 7 | u32 h264_support; 8 | u32 h264_high10_support; 9 | u32 vc1_support; 10 | u32 mpeg2_support; 11 | u32 jpeg_support; 12 | u32 jpeg_prog_support; 13 | u32 sorenson_spark_support; 14 | u32 vp6_support; 15 | u32 vp7_support; 16 | u32 vp8_support; 17 | u32 vp9_support; 18 | u32 avs_support; 19 | u32 jpeg_esupport; 20 | u32 rv_support; 21 | u32 mvc_support; 22 | u32 webp_support; 23 | u32 avs_plus_support; 24 | u32 hevc_support; 25 | u32 hevc_main10_support; 26 | u32 vp9_profile2_support; 27 | /* resolution related */ 28 | u32 max_dec_8k_support; 29 | u32 max_dec_pic_width; 30 | u32 max_dec_pic_height; 31 | u32 max_pp_out_pic_width; 32 | /* Other features */ 33 | u32 addr64_support; 34 | u32 ref_buf_support; 35 | u32 tiled_mode_support; 36 | u32 ref_frame_tiled_only; 37 | u32 ec_support; 38 | u32 dec_stride_support; 39 | u32 pp_stride_support; 40 | u32 field_dpb_support; 41 | u32 double_buffer_support; 42 | u32 rfc_support; 43 | u32 ring_buffer_support; 44 | u32 mrb_prefetch; 45 | u32 statistical_level; 46 | u32 strm_len_32bits; 47 | u32 pic_size_reg_unified; 48 | /* decoding flow supported */ 49 | u32 h264_slice_ec_support; 50 | u32 tile_decoding_support; 51 | u32 jpeg_slice_decoding_support; 52 | u32 low_latency_mode_support; 53 | u32 has_2nd_pipeline; 54 | u32 has_2nd_h264_pipeline; 55 | u32 has_2nd_jpeg_pipeline; 56 | /* registers compatibility */ 57 | u32 is_legacy_dec_mode; 58 | /* pp related features */ 59 | u32 max_ppu_count; 60 | u32 pp_support; 61 | enum { 62 | NO_PP = 0, 63 | G1_NATIVE_PP, 64 | G2_NATIVE_PP, 65 | FIXED_DS_PP, 66 | UNFIED_PP 67 | } pp_version; 68 | u32 jpeg_pp_force_e; 69 | u32 dscale_support; 70 | u32 uscale_support; 71 | u32 flexible_scale_support; 72 | u32 crop_support; 73 | u32 crop_step_unit; 74 | u32 crop_step_rshift; 75 | u32 rotation_support; 76 | u32 dither_support; 77 | /* output format supported */ 78 | u32 fmt_p010_support; 79 | u32 fmt_customer1_support; 80 | u32 pp_pad_e; 81 | u32 pp_planar_support; 82 | u32 pp_yuv420_101010_support; 83 | }; 84 | -------------------------------------------------------------------------------- /vpi/src/filter/vpi_video_prc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_VIDEO_PRC_H__ 31 | #define __VPI_VIDEO_PRC_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include 38 | 39 | #include "vpi_error.h" 40 | #include "trans_edma_api.h" 41 | #include "vpi_video_pp.h" 42 | #include "vpi_video_hwulprc.h" 43 | 44 | typedef enum FilterType { 45 | FILTER_NULL, 46 | FILTER_PP, 47 | FILTER_SPLITER, 48 | FILTER_HW_DOWNLOADER, 49 | FILTER_HW_UPLOAD 50 | } FilterType; 51 | 52 | typedef struct VpiPrcCtx { 53 | FilterType filter_type; 54 | 55 | /*hwdownload/hwupload*/ 56 | EDMA_HANDLE edma_handle; 57 | int pp_index; 58 | 59 | /*pp filter*/ 60 | VpiPPFilter ppfilter; 61 | 62 | /*hwupload*/ 63 | VpiPrcHwUlCtx hwul_ctx; 64 | } VpiPrcCtx; 65 | 66 | VpiRet vpi_vprc_init(VpiPrcCtx *vpi_ctx, void *prc_cfg); 67 | VpiRet vpi_vprc_process(VpiPrcCtx *vpi_ctx, void *indata, void *outdata); 68 | VpiRet vpi_vprc_control(VpiPrcCtx *vpi_ctx, void *indata, void *outdata); 69 | int vpi_vprc_close(VpiPrcCtx *vpi_ctx); 70 | 71 | VpiRet vpi_prc_pp_init(VpiPrcCtx *vpi_ctx, void *cfg); 72 | VpiRet vpi_prc_pp_control(VpiPrcCtx *vpi_ctx, void *indata, void *outdata); 73 | VpiRet vpi_prc_pp_process(VpiPrcCtx *vpi_ctx, void *indata, void *outdata); 74 | VpiRet vpi_prc_pp_close(VpiPrcCtx *ctx); 75 | 76 | VpiRet vpi_prc_hwul_init(VpiPrcCtx *vpi_ctx, void *cfg); 77 | VpiRet vpi_prc_hwul_process(VpiPrcCtx *vpi_ctx, void *indata, void *outdata); 78 | VpiRet vpi_prc_hwul_control(VpiPrcCtx *vpi_ctx, void *indata, void *outdata); 79 | VpiRet vpi_prc_hwul_close(VpiPrcCtx *vpi_ctx); 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/inc/base_type.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef BASE_TYPE_H 17 | #define BASE_TYPE_H 18 | 19 | #include 20 | #include 21 | #ifndef NDEBUG 22 | #include 23 | #endif 24 | 25 | #if defined(_MSC_VER) 26 | /* MSVS doesn't define off_t, and uses _f{seek,tell}i64. */ 27 | typedef __int64 off_t; 28 | #define fseeko _fseeki64 29 | #define ftello _ftelli64 30 | #elif defined(_WIN32) 31 | /* MinGW defines off_t as long and uses f{seek,tell}o64/off64_t for large 32 | * files. */ 33 | #define fseeko fseeko64 34 | #define ftello ftello64 35 | #define off_t off64_t 36 | #endif /* _WIN32 */ 37 | 38 | typedef unsigned char u8; 39 | typedef signed char i8; 40 | typedef unsigned short u16; 41 | typedef signed short i16; 42 | typedef unsigned int u32; 43 | typedef signed int i32; 44 | typedef long i64; 45 | typedef unsigned long u64; 46 | 47 | typedef size_t ptr_t; 48 | 49 | #ifndef INLINE 50 | #define INLINE inline 51 | #endif 52 | 53 | #ifndef NULL 54 | #ifdef __cplusplus 55 | #define NULL 0 56 | #else /* */ 57 | #define NULL ((void *)0) 58 | #endif /* */ 59 | #endif 60 | 61 | typedef short Short; 62 | typedef int Int; 63 | typedef unsigned int UInt; 64 | 65 | 66 | #ifndef __cplusplus 67 | 68 | #define HANTRO_FALSE 0 69 | #define HANTRO_TRUE 1 70 | 71 | #ifndef BOOL_DEFINED 72 | #define BOOL_DEFINED 73 | typedef enum 74 | { 75 | false = HANTRO_FALSE, 76 | true = HANTRO_TRUE 77 | } bool; 78 | #endif 79 | 80 | enum 81 | { 82 | OK = 0, 83 | NOK = -1 84 | }; 85 | #endif 86 | 87 | /* ASSERT */ 88 | #ifndef NDEBUG 89 | #define ASSERT(x) assert(x) 90 | #else 91 | #define ASSERT(x) 92 | #endif 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/common/version.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- Copyright (c) 2015-2017, VeriSilicon Inc. All rights reserved -- 3 | -- Copyright (c) 2011-2014, Google Inc. All rights reserved. -- 4 | -- Copyright (c) 2007-2010, Hantro OY. All rights reserved. -- 5 | -- -- 6 | -- This software is confidential and proprietary and may be used only as -- 7 | -- expressly authorized by VeriSilicon in a written licensing agreement. -- 8 | -- -- 9 | -- This entire notice must be reproduced on all copies -- 10 | -- and may not be removed. -- 11 | -- -- 12 | -------------------------------------------------------------------------------- 13 | -- Redistribution and use in source and binary forms, with or without -- 14 | -- modification, are permitted provided that the following conditions are met:-- 15 | -- * Redistributions of source code must retain the above copyright notice, -- 16 | -- this list of conditions and the following disclaimer. -- 17 | -- * Redistributions in binary form must reproduce the above copyright -- 18 | -- notice, this list of conditions and the following disclaimer in the -- 19 | -- documentation and/or other materials provided with the distribution. -- 20 | -- * Neither the names of Google nor the names of its contributors may be -- 21 | -- used to endorse or promote products derived from this software -- 22 | -- without specific prior written permission. -- 23 | -------------------------------------------------------------------------------- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"-- 25 | -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- 26 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- 27 | -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- 28 | -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- 29 | -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- 30 | -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- 31 | -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- 32 | -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- 33 | -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- 34 | -- POSSIBILITY OF SUCH DAMAGE. -- 35 | -------------------------------------------------------------------------------- 36 | ------------------------------------------------------------------------------*/ 37 | 38 | #ifndef SOFTWARE_SOURCE_COMMON_VERSION_H_ 39 | #define SOFTWARE_SOURCE_COMMON_VERSION_H_ 40 | 41 | #define HANTRO_DEC_SW_BUILD_MAJOR 7 42 | #define HANTRO_DEC_SW_BUILD_MINOR 3 43 | 44 | #define HANTRO_DEC_SW_BUILD \ 45 | ((HANTRO_DEC_SW_BUILD_MAJOR << 16) + HANTRO_DEC_SW_BUILD_MINOR) 46 | 47 | #endif /* SOFTWARE_SOURCE_COMMON_VERSION_H_ */ 48 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/h264high/h264hwd_regdrv.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- Copyright (c) 2015-2017, VeriSilicon Inc. All rights reserved -- 3 | -- Copyright (c) 2011-2014, Google Inc. All rights reserved. -- 4 | -- Copyright (c) 2007-2010, Hantro OY. All rights reserved. -- 5 | -- -- 6 | -- This software is confidential and proprietary and may be used only as -- 7 | -- expressly authorized by VeriSilicon in a written licensing agreement. -- 8 | -- -- 9 | -- This entire notice must be reproduced on all copies -- 10 | -- and may not be removed. -- 11 | -- -- 12 | -------------------------------------------------------------------------------- 13 | -- Redistribution and use in source and binary forms, with or without -- 14 | -- modification, are permitted provided that the following conditions are met:-- 15 | -- * Redistributions of source code must retain the above copyright notice, -- 16 | -- this list of conditions and the following disclaimer. -- 17 | -- * Redistributions in binary form must reproduce the above copyright -- 18 | -- notice, this list of conditions and the following disclaimer in the -- 19 | -- documentation and/or other materials provided with the distribution. -- 20 | -- * Neither the names of Google nor the names of its contributors may be -- 21 | -- used to endorse or promote products derived from this software -- 22 | -- without specific prior written permission. -- 23 | -------------------------------------------------------------------------------- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"-- 25 | -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- 26 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- 27 | -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- 28 | -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- 29 | -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- 30 | -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- 31 | -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- 32 | -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- 33 | -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- 34 | -- POSSIBILITY OF SUCH DAMAGE. -- 35 | -------------------------------------------------------------------------------- 36 | ------------------------------------------------------------------------------*/ 37 | 38 | #ifndef __H264HWD_REGDRV_H__ 39 | #define __H264HWD_REGDRV_H__ 40 | 41 | #include "basetype.h" 42 | #include "regdrv.h" 43 | 44 | #define DEC_X170_ALIGN_MASK 0x07 45 | #define DEC_X170_ALIGN_MASK_HIGH10 0x0F 46 | #define DEC_X170_MODE_H264 0x00 47 | #define DEC_X170_MODE_H264_HIGH10 0x0F 48 | 49 | #endif /* __H264HWD_REGDRV_H__ */ 50 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/h264high/h264hwd_conceal.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- Copyright (c) 2015-2017, VeriSilicon Inc. All rights reserved -- 3 | -- Copyright (c) 2011-2014, Google Inc. All rights reserved. -- 4 | -- Copyright (c) 2007-2010, Hantro OY. All rights reserved. -- 5 | -- -- 6 | -- This software is confidential and proprietary and may be used only as -- 7 | -- expressly authorized by VeriSilicon in a written licensing agreement. -- 8 | -- -- 9 | -- This entire notice must be reproduced on all copies -- 10 | -- and may not be removed. -- 11 | -- -- 12 | -------------------------------------------------------------------------------- 13 | -- Redistribution and use in source and binary forms, with or without -- 14 | -- modification, are permitted provided that the following conditions are met:-- 15 | -- * Redistributions of source code must retain the above copyright notice, -- 16 | -- this list of conditions and the following disclaimer. -- 17 | -- * Redistributions in binary form must reproduce the above copyright -- 18 | -- notice, this list of conditions and the following disclaimer in the -- 19 | -- documentation and/or other materials provided with the distribution. -- 20 | -- * Neither the names of Google nor the names of its contributors may be -- 21 | -- used to endorse or promote products derived from this software -- 22 | -- without specific prior written permission. -- 23 | -------------------------------------------------------------------------------- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"-- 25 | -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- 26 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- 27 | -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- 28 | -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- 29 | -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- 30 | -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- 31 | -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- 32 | -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- 33 | -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- 34 | -- POSSIBILITY OF SUCH DAMAGE. -- 35 | -------------------------------------------------------------------------------- 36 | ------------------------------------------------------------------------------*/ 37 | 38 | #ifndef __H264HWD_CONCEAL_H__ 39 | #define __H264HWD_CONCEAL_H__ 40 | 41 | #include "basetype.h" 42 | #include "h264hwd_slice_header.h" 43 | #include "h264hwd_storage.h" 44 | #include "h264hwd_asic.h" 45 | 46 | 47 | void h264bsdConceal(storage_t *storage, DecAsicBuffers_t * p_asic_buff, 48 | u32 slice_type); 49 | 50 | #endif /* __H264HWD_CONCEAL_H__ */ 51 | -------------------------------------------------------------------------------- /vpi/src/dec/vpi_video_vp9dec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_VIDEO_VP9DEC_H__ 31 | #define __VPI_VIDEO_VP9DEC_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include "vpi_video_dec.h" 38 | 39 | #ifndef NEXT_MULTIPLE 40 | #define NEXT_MULTIPLE(value, n) (((value) + (n)-1) & ~((n)-1)) 41 | #endif 42 | 43 | VpiRet vpi_dec_vp9_init(const void **inst, struct DecConfig config, 44 | const void *dwl); 45 | VpiRet vpi_dec_vp9_get_info(VpiDecInst inst, struct DecSequenceInfo *info); 46 | VpiRet vpi_dec_vp9_set_info(VpiDecInst inst, struct DecConfig config, 47 | struct DecSequenceInfo *Info); 48 | enum DecRet vpi_dec_vp9_next_picture(VpiDecInst inst, 49 | struct DecPicturePpu *pic); 50 | VpiRet vpi_dec_vp9_picture_consumed(VpiDecInst inst, struct DecPicturePpu pic); 51 | int vpi_decode_vp9_dec_frame(VpiDecCtx *vpi_ctx, void *indata, void *outdata); 52 | VpiRet vpi_dec_vp9_end_of_stream(VpiDecInst inst); 53 | void vpi_dec_vp9_release(VpiDecInst inst); 54 | void vpi_decode_vp9_picture_consume(VpiDecCtx *vpi_ctx, void *data); 55 | VpiRet vpi_decode_vp9_init(VpiDecCtx *vpi_ctx); 56 | VpiRet vpi_decode_vp9_control(VpiDecCtx *vpi_ctx, void *indata, void *outdata); 57 | int vpi_decode_vp9_close(VpiDecCtx *vpi_ctx); 58 | int vpi_decode_vp9_put_packet(VpiDecCtx *vpi_ctx, void *indata); 59 | int vpi_decode_vp9_get_frame(VpiDecCtx *vpi_ctx, void *outdata); 60 | int vpi_decode_vp9_dec_process(VpiDecCtx *vpi_ctx); 61 | 62 | #ifdef USE_EXTERNAL_BUFFER 63 | enum DecRet vpi_dec_vp9_get_buffer_info(VpiDecInst inst, 64 | struct DecBufferInfo *buf_info); 65 | enum DecRet vpi_dec_vp9_add_buffer(VpiDecInst inst, struct DWLLinearMem *buf); 66 | #endif 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif -------------------------------------------------------------------------------- /vpi/src/dec/vpi_video_hevcdec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_VIDEO_HEVCDEC_H__ 31 | #define __VPI_VIDEO_HEVCDEC_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include "vpi_video_dec.h" 38 | 39 | #ifndef NEXT_MULTIPLE 40 | #define NEXT_MULTIPLE(value, n) (((value) + (n)-1) & ~((n)-1)) 41 | #endif 42 | 43 | VpiRet vpi_dec_hevc_init(const void **inst, struct DecConfig config, 44 | const void *dwl); 45 | VpiRet vpi_dec_hevc_get_info(VpiDecInst inst, struct DecSequenceInfo *info); 46 | VpiRet vpi_dec_hevc_set_info(VpiDecInst inst, struct DecConfig config, 47 | struct DecSequenceInfo *info); 48 | enum DecRet vpi_dec_hevc_next_picture(VpiDecInst inst, 49 | struct DecPicturePpu *pic); 50 | VpiRet vpi_dec_hevc_picture_consumed(VpiDecInst inst, struct DecPicturePpu pic); 51 | VpiRet vpi_dec_hevc_end_of_stream(VpiDecInst inst); 52 | void vpi_dec_hevc_release(VpiDecInst inst); 53 | VpiRet vpi_dec_hevc_use_extra_frm_buffers(const VpiDecInst inst, uint32_t num); 54 | #ifdef USE_EXTERNAL_BUFFER 55 | enum DecRet vpi_dec_hevc_get_buffer_info(VpiDecInst inst, 56 | struct DecBufferInfo *buf_info); 57 | enum DecRet vpi_dec_hevc_add_buffer(VpiDecInst inst, struct DWLLinearMem *buf); 58 | #endif 59 | int vpi_decode_hevc_put_packet(VpiDecCtx *vpi_ctx, void *indata); 60 | int vpi_decode_hevc_get_frame(VpiDecCtx *vpi_ctx, void *outdata); 61 | int vpi_decode_hevc_dec_process(VpiDecCtx *vpi_ctx); 62 | VpiRet vpi_decode_hevc_init(VpiDecCtx *vpi_ctx); 63 | int vpi_decode_hevc_dec_frame(VpiDecCtx *vpi_ctx, void *indata, void *outdata); 64 | VpiRet vpi_decode_hevc_control(VpiDecCtx *vpi_ctx, void *indata, void *outdata); 65 | int vpi_decode_hevc_close(VpiDecCtx *vpi_ctx); 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /vpi/src/dec/vpi_video_h264dec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_VIDEO_H264DEC_H__ 31 | #define __VPI_VIDEO_H264DEC_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include "vpi_video_dec.h" 38 | 39 | #ifndef NEXT_MULTIPLE 40 | #define NEXT_MULTIPLE(value, n) (((value) + (n)-1) & ~((n)-1)) 41 | #endif 42 | 43 | VpiRet vpi_dec_h264_init(const void **inst, struct DecConfig config, 44 | const void *dwl); 45 | VpiRet vpi_dec_h264_get_info(VpiDecInst inst, struct DecSequenceInfo *info); 46 | VpiRet vpi_dec_h264_set_info(VpiDecInst inst, struct DecConfig config, 47 | struct DecSequenceInfo *info); 48 | enum DecRet vpi_dec_h264_next_picture(VpiDecInst inst, 49 | struct DecPicturePpu *pic); 50 | VpiRet vpi_dec_h264_picture_consumed(VpiDecInst inst, struct DecPicturePpu pic); 51 | VpiRet vpi_dec_h264_end_of_stream(VpiDecInst inst); 52 | void vpi_dec_h264_release(VpiDecInst inst); 53 | VpiRet vpi_dec_h264_use_extra_frm_buffers(const VpiDecInst inst, uint32_t num); 54 | #ifdef USE_EXTERNAL_BUFFER 55 | enum DecRet vpi_dec_h264_get_buffer_info(VpiDecInst inst, 56 | struct DecBufferInfo *buf_info); 57 | enum DecRet vpi_dec_h264_add_buffer(VpiDecInst inst, struct DWLLinearMem *buf); 58 | #endif 59 | 60 | int vpi_decode_h264_put_packet(VpiDecCtx *vpi_ctx, void *indata); 61 | int vpi_decode_h264_get_frame(VpiDecCtx *vpi_ctx, void *outdata); 62 | int vpi_decode_h264_dec_process(VpiDecCtx *vpi_ctx); 63 | VpiRet vpi_decode_h264_init(VpiDecCtx *vpi_ctx); 64 | int vpi_decode_h264_dec_frame(VpiDecCtx *vpi_ctx, void *indata, void *outdata); 65 | VpiRet vpi_decode_h264_control(VpiDecCtx *vpi_ctx, void *indata, void *outdata); 66 | int vpi_decode_h264_close(VpiDecCtx *vpi_ctx); 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/hevc/sw_cabac_defines.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef CABAC_DEFINES_H 17 | #define CABAC_DEFINES_H 18 | 19 | #include "base_type.h" 20 | #include "sw_put_bits.h" 21 | 22 | struct cabac 23 | { 24 | struct buffer b; 25 | u8 ctx[158]; 26 | u8 sao_merge_flag; /* Table Table 9 5 offsets... */ 27 | u8 sao_type_idx; /* Table 9-6 */ 28 | u8 split_cu_flag; /* Table 9-7 */ 29 | u8 cu_transquant_bypass_flag; /* Table 9-8 */ 30 | u8 skip_flag; /* Table 9-9 */ 31 | u8 cu_qp_delta_abs; /* Table 9-24 */ 32 | u8 pred_mode_flag; /* Table 9-10 */ 33 | u8 part_mode; /* Table 9-11 */ 34 | u8 part_mode_amp; /* Table non- exist, just consistent with G2*/ 35 | u8 prev_intra_luma_pred_flag; /* Table 9-12 */ 36 | u8 intra_chroma_pred_mode; /* Table 9-13 */ 37 | u8 merge_flag; /* Table 9-15 */ 38 | u8 merge_idx; /* Table 9-16 */ 39 | u8 inter_pred_idc; /* Table 9-17 */ 40 | u8 ref_idx_l0; /* Table 9-18 */ 41 | u8 ref_idx_l1; 42 | u8 abs_mvd_greater0_flag; /* Table 9-23 */ 43 | u8 abs_mvd_greater1_flag; 44 | u8 mvp_l0_flag; /* Table 9-19 */ 45 | u8 mvp_l1_flag; 46 | u8 no_residual_syntax_flag; /* 9-14 */ 47 | u8 split_transform_flag; /* Table 9-20 */ 48 | u8 cbf_luma; /* Table 9-21 */ 49 | u8 cbf_ch; /* Table 9-22 */ 50 | u8 transform_skip_flag_lum; /* Table 9-25 */ 51 | u8 transform_skip_flag_ch; /* Table 9-25 */ 52 | u8 ls_coeff_x_prefix; /* Table 9-26 */ 53 | u8 ls_coeff_y_prefix; /* Table 9-27 */ 54 | u8 coded_sub_block_flag; /* Table 9-28 */ 55 | u8 significant_coeff_flag; /* Table 9-29 */ 56 | u8 coeff_abs_level_g1_flag; /* Table 9-30 */ 57 | u8 coeff_abs_level_g2_flag; /* Table 9-31 */ 58 | i32 cod_low; 59 | i32 cod_range; 60 | i32 bits_outstanding; 61 | i32 first_bit; 62 | #ifdef TEST_DATA 63 | i32 test_bits; 64 | i32 test_bits_num; 65 | i32 terminate_flag; 66 | #endif 67 | }; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/jpeg/EncJpegInstance.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Hantro Products Oy. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Abstract : 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | /*------------------------------------------------------------------------------ 21 | 22 | Table of contents 23 | 24 | 1. Include headers 25 | 2. External compiler flags 26 | 3. Module defines 27 | 4. Function prototypes 28 | 29 | ------------------------------------------------------------------------------*/ 30 | 31 | #ifndef __ENC_JPEG_INSTANCE_H__ 32 | #define __ENC_JPEG_INSTANCE_H__ 33 | 34 | /*------------------------------------------------------------------------------ 35 | 1. Include headers 36 | ------------------------------------------------------------------------------*/ 37 | #include "enccommon.h" 38 | #include "encpreprocess.h" 39 | #include "encasiccontroller.h" 40 | 41 | #include "EncJpeg.h" 42 | #include "rate_control_picture.h" 43 | 44 | /*------------------------------------------------------------------------------ 45 | 2. External compiler flags 46 | -------------------------------------------------------------------------------- 47 | 48 | -------------------------------------------------------------------------------- 49 | 3. Module defines 50 | ------------------------------------------------------------------------------*/ 51 | enum JpegEncStatus 52 | { 53 | ENCSTAT_INIT = 0xA1, 54 | ENCSTAT_ENCODE, 55 | ENCSTAT_ERROR 56 | }; 57 | 58 | typedef struct 59 | { 60 | u32 encStatus; 61 | stream_s stream; 62 | EWLHwConfig_t featureToSupport; 63 | u32 reserve_core_info; 64 | preProcess_s preProcess; 65 | jpegData_s jpeg; 66 | asicData_s asic; 67 | inputLineBuf_s inputLineBuf; 68 | streamMultiSeg_s streamMultiSegment; 69 | vcencRateControl_s rateControl; /* Rate control parameters */ 70 | u32 timeIncrement; /* The previous picture duration in units 71 | * of 1/frameRateNum. 0 for the very first picture 72 | * and typically equal to frameRateDenom for the rest. 73 | */ 74 | i32 fixedQP; /*fixed QP to every frame*/ 75 | u32 input_alignment; 76 | u64 lumaSize; 77 | u64 chromaSize; 78 | u32 invalidBytesInBuf0Tail; 79 | const void *inst; /* used as checksum */ 80 | } jpegInstance_s; 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /vpi/src/filter/vpi_video_prc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 VeriSilicon, Inc. 3 | * 4 | * The program is distributed under terms of BSD license. 5 | * You can obtain the copy of the license by visiting: 6 | * 7 | * http://www.opensource.org/licenses/bsd-license.php 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include "vpi_log.h" 17 | #include "vpi_video_prc.h" 18 | #include "vpi_video_hwdwprc.h" 19 | #include "vpi_video_pp.h" 20 | 21 | VpiRet vpi_vprc_init(VpiPrcCtx *vpi_ctx, void *prc_cfg) 22 | { 23 | VpiRet ret = VPI_SUCCESS; 24 | 25 | switch (vpi_ctx->filter_type) { 26 | case FILTER_PP: 27 | ret = vpi_prc_pp_init(vpi_ctx, prc_cfg); 28 | break; 29 | case FILTER_SPLITER: 30 | break; 31 | case FILTER_HW_DOWNLOADER: 32 | ret = vpi_prc_hwdw_init(vpi_ctx, prc_cfg); 33 | break; 34 | case FILTER_HW_UPLOAD: 35 | ret = vpi_prc_hwul_init(vpi_ctx, prc_cfg); 36 | break; 37 | default: 38 | VPILOGE("Unknown/Not supported format %d", vpi_ctx->filter_type); 39 | ret = VPI_ERR_SW; 40 | } 41 | 42 | return ret; 43 | } 44 | 45 | VpiRet vpi_vprc_process(VpiPrcCtx *vpi_ctx, void *indata, void *outdata) 46 | { 47 | VpiRet ret = VPI_SUCCESS; 48 | 49 | switch (vpi_ctx->filter_type) { 50 | case FILTER_PP: 51 | ret = vpi_prc_pp_process(vpi_ctx, indata, outdata); 52 | break; 53 | case FILTER_SPLITER: 54 | break; 55 | case FILTER_HW_DOWNLOADER: 56 | ret = vpi_prc_hwdw_process(vpi_ctx, indata, outdata); 57 | break; 58 | case FILTER_HW_UPLOAD: 59 | ret = vpi_prc_hwul_process(vpi_ctx, indata, outdata); 60 | break; 61 | default: 62 | VPILOGE("Unknown/Not supported format %d", vpi_ctx->filter_type); 63 | break; 64 | } 65 | return ret; 66 | } 67 | 68 | VpiRet vpi_vprc_control(VpiPrcCtx *vpi_ctx, void *indata, void *outdata) 69 | { 70 | VpiRet ret = VPI_SUCCESS; 71 | 72 | switch (vpi_ctx->filter_type) { 73 | case FILTER_PP: 74 | vpi_prc_pp_control(vpi_ctx, indata, outdata); 75 | break; 76 | case FILTER_SPLITER: 77 | break; 78 | case FILTER_HW_DOWNLOADER: 79 | vpi_prc_hwdw_control(vpi_ctx, indata, outdata); 80 | break; 81 | case FILTER_HW_UPLOAD: 82 | vpi_prc_hwul_control(vpi_ctx, indata, outdata); 83 | break; 84 | default: 85 | VPILOGE("Unknown/Not supported format %d", vpi_ctx->filter_type); 86 | ret = VPI_ERR_SW; 87 | } 88 | 89 | return ret; 90 | } 91 | 92 | int vpi_vprc_close(VpiPrcCtx *vpi_ctx) 93 | { 94 | int ret = VPI_SUCCESS; 95 | 96 | switch (vpi_ctx->filter_type) { 97 | case FILTER_PP: 98 | ret = vpi_prc_pp_close(vpi_ctx); 99 | break; 100 | case FILTER_SPLITER: 101 | break; 102 | case FILTER_HW_DOWNLOADER: 103 | ret = vpi_prc_hwdw_close(vpi_ctx); 104 | break; 105 | case FILTER_HW_UPLOAD: 106 | ret = vpi_prc_hwul_close(vpi_ctx); 107 | break; 108 | default: 109 | VPILOGE("Unknown/Not supported format %d", vpi_ctx->filter_type); 110 | ret = VPI_ERR_SW; 111 | } 112 | 113 | return ret; 114 | } 115 | -------------------------------------------------------------------------------- /vpi/utils/inc/vpi_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __VPI_ERR_H__ 31 | #define __VPI_ERR_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #ifndef NDEBUG 38 | #include 39 | #endif 40 | 41 | #ifndef SUCCESS 42 | #define SUCCESS (0) 43 | #endif 44 | 45 | typedef enum { 46 | VPI_SUCCESS = SUCCESS, 47 | VPI_ERR_SW = -1, 48 | VPI_ERR_SYSTEM = -2, 49 | VPI_ERR_NO_AP_MEM = -3, 50 | VPI_ERR_NO_EP_MEM = -4, 51 | VPI_ERR_WRONG_STATE = -5, 52 | VPI_ERR_DEVICE = -6, 53 | 54 | VPI_ERR_ENCODE = -100, 55 | VPI_ERR_EWL = -101, 56 | VPI_ERR_ENCODER_INIT = -102, 57 | VPI_ERR_ENCODER_OPITION = -103, 58 | VPI_ERR_ENCODE_WAITT_BUF = -104, 59 | 60 | VPI_ERR_DECODE = -200, 61 | VPI_ERR_DWL = -201, 62 | VPI_ERR_DECODER_INIT = -203, 63 | VPI_ERR_DECODER_OPITION = -204, 64 | VPI_ERR_DECODER_DATA = -205, 65 | VPI_ERR_DECODE_FORMAT = -206, 66 | 67 | VPI_ERR_PP = -300, 68 | VPI_ERR_PP_INIT = -301, 69 | VPI_ERR_PP_OPITION = -302, 70 | 71 | VPI_ERR_SPLITER = -400, 72 | VPI_ERR_SPLITER_INIT = -401, 73 | VPI_ERR_SPLITER_OPITION = -402, 74 | 75 | VPI_ERR_HWDOWNLOADER = -500, 76 | VPI_ERR_HWDOWNLOADER_INIT = -501, 77 | VPI_ERR_HWDOWNLOADER_OPITION = -502, 78 | 79 | VPI_ERR_HWUPLOADER = -600, 80 | VPI_ERR_HWUPLOADER_INIT = -601, 81 | VPI_ERR_HWUPLOADER_OPITION = -602, 82 | 83 | } VpiRet; 84 | 85 | /* ASSERT */ 86 | #ifndef ASSERT 87 | #ifndef NDEBUG 88 | #define ASSERT(x) assert(x) 89 | #else 90 | #define ASSERT(x) 91 | #endif 92 | #endif 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | 98 | #endif /* #ifndef __VPI_ERROR_H__ */ 99 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/common/stream_corrupt.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- Copyright (c) 2015-2017, VeriSilicon Inc. All rights reserved -- 3 | -- Copyright (c) 2011-2014, Google Inc. All rights reserved. -- 4 | -- Copyright (c) 2007-2010, Hantro OY. All rights reserved. -- 5 | -- -- 6 | -- This software is confidential and proprietary and may be used only as -- 7 | -- expressly authorized by VeriSilicon in a written licensing agreement. -- 8 | -- -- 9 | -- This entire notice must be reproduced on all copies -- 10 | -- and may not be removed. -- 11 | -- -- 12 | -------------------------------------------------------------------------------- 13 | -- Redistribution and use in source and binary forms, with or without -- 14 | -- modification, are permitted provided that the following conditions are met:-- 15 | -- * Redistributions of source code must retain the above copyright notice, -- 16 | -- this list of conditions and the following disclaimer. -- 17 | -- * Redistributions in binary form must reproduce the above copyright -- 18 | -- notice, this list of conditions and the following disclaimer in the -- 19 | -- documentation and/or other materials provided with the distribution. -- 20 | -- * Neither the names of Google nor the names of its contributors may be -- 21 | -- used to endorse or promote products derived from this software -- 22 | -- without specific prior written permission. -- 23 | -------------------------------------------------------------------------------- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"-- 25 | -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- 26 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- 27 | -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- 28 | -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- 29 | -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- 30 | -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- 31 | -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- 32 | -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- 33 | -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- 34 | -- POSSIBILITY OF SUCH DAMAGE. -- 35 | -------------------------------------------------------------------------------- 36 | ------------------------------------------------------------------------------*/ 37 | 38 | #ifndef STREAM_CORRUPT_H 39 | #define STREAM_CORRUPT_H 40 | 41 | #include "basetype.h" 42 | 43 | void InitializeRandom(u32 seed); 44 | 45 | u32 RandomizeBitSwapInStream(u8* stream, u32 stream_len, char* odds); 46 | 47 | u32 RandomizePacketLoss(char* odds, u8* packet_loss); 48 | 49 | u32 RandomizeU32(u32* value); 50 | 51 | /* u32 RandomizeBitLossInStream(u8* stream, 52 | u32* stream_len, 53 | char* odds); */ 54 | 55 | #endif /* STREAM_CORRUPT_H */ 56 | -------------------------------------------------------------------------------- /drivers/mem_test.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | /* 3 | * Copyright (C) 2020 VeriSilicon Holdings Co., Ltd. 4 | * 5 | * This is bigsea management driver for Linux. 6 | * Bigsea is a video encoder, has two cores, only support vp9 format. 7 | * This driver provide some IOCTL commands for userspace, 8 | * like reserve/release a hardware core, access registers. 9 | * At the same time, bigsea and vc8000e only one can work, so they use 10 | * same functions to reserve/release core. 11 | * How to operate Bigsea: reserve a idle core, config registers, 12 | * enable the core, wait interrupt, release the core. 13 | */ 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include "transcoder.h" 27 | 28 | typedef unsigned char u8; 29 | typedef unsigned short u16; 30 | typedef unsigned int u32; 31 | 32 | #define EP_COUNT 11 33 | #define RC_COUNT 5 34 | #define MAX_SIZE 36 // block max size is ~36MB 35 | 36 | int main(int argc, char **argv) 37 | { 38 | int task_id; 39 | int memdev_fd = -1; 40 | int i = 0, n = 0, j = 0, ret; 41 | int first, second; 42 | struct mem_info ep_region[200]; 43 | int mem_cnt = 5; 44 | 45 | if (argc < 2) { 46 | printf("command line: %s node count.\n", argv[0]); 47 | return -1; 48 | } 49 | memdev_fd = open(argv[1], O_RDWR); 50 | if (memdev_fd == -1) { 51 | printf("Failed to open dev: %s\n", argv[1]); 52 | goto end; 53 | } else 54 | printf("open /dev/trans_mem succeed.\n"); 55 | if (argc < 3) { 56 | printf("not input mem_cnt,so use default count=%d \n", mem_cnt); 57 | } else 58 | mem_cnt = strtoul(argv[2], 0, 0); 59 | 60 | ioctl(memdev_fd, CB_TRANX_MEM_GET_TASKID, &task_id); 61 | printf("get task id = %d. \n", task_id); 62 | 63 | for (j = 0; j < mem_cnt / MAX_SIZE; j++) 64 | for (i = 1; i <= MAX_SIZE; i++) { 65 | ep_region[n].size = 1024 * 1024 * i; 66 | ep_region[n].task_id = task_id; 67 | n++; 68 | } 69 | if (n < mem_cnt) 70 | for (i = 1; i <= MAX_SIZE; i++) { 71 | ep_region[n].size = 1024 * 1024 * i; 72 | ep_region[n].task_id = task_id; 73 | n++; 74 | } 75 | 76 | for (i = 1; i <= mem_cnt; i++) { 77 | ep_region[i].mem_location = EP_SIDE; 78 | ret = ioctl(memdev_fd, CB_TRANX_MEM_ALLOC, &ep_region[i]); // get 79 | if (ret) { 80 | printf("ioctl get ep mem failed.\n"); 81 | for (i = 0; i <= n; i++) { 82 | ioctl(memdev_fd, CB_TRANX_MEM_FREE, &ep_region[i]); // free 83 | } 84 | goto end; 85 | } 86 | n = i; 87 | printf("EP: alloc %d phy_addr=0x%lx size=0x%x.\n", i, 88 | ep_region[i].phy_addr, ep_region[i].size); 89 | usleep(10000); 90 | } 91 | 92 | getchar(); 93 | 94 | printf("\n"); 95 | 96 | for (i = 1; i <= mem_cnt; i++) { 97 | ioctl(memdev_fd, CB_TRANX_MEM_FREE, &ep_region[i]); 98 | printf("EP: free %d phy_addr=0x%lx size=0x%x.\n", i, 99 | ep_region[i].phy_addr, ep_region[i].size); 100 | } 101 | printf("\n"); 102 | 103 | ioctl(memdev_fd, CB_TRANX_MEM_FREE_TASKID, &task_id); 104 | 105 | end: 106 | close(memdev_fd); 107 | 108 | return 0; 109 | } 110 | -------------------------------------------------------------------------------- /vpi/utils/src/log_manager.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, VeriSilicon Holdings Co., Ltd. All rights reserved 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. Neither the name of the copyright holder nor the names of its contributors 15 | * may be used to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | #include "vpi_error.h" 35 | #include "vpi_log.h" 36 | #include "vpi_log_manager.h" 37 | 38 | static FILE *report_file; 39 | int report_file_level = LOG_LEVEL_DBG; 40 | 41 | #define MAX_LOG_BUF_SIZE (4096) 42 | 43 | void log_print(const char *p_format, ...) 44 | { 45 | char buf[MAX_LOG_BUF_SIZE] = { 0 }; 46 | va_list ap; 47 | 48 | if (!p_format) 49 | return; 50 | 51 | va_start(ap, p_format); 52 | vsnprintf(buf, MAX_LOG_BUF_SIZE-1, p_format, ap); 53 | va_end(ap); 54 | printf("%s", buf); 55 | } 56 | 57 | void log_write(LogLevel level, const char *p_header, const char *p_format, ...) 58 | { 59 | va_list ap; 60 | char buf[MAX_LOG_BUF_SIZE] = { 0 }; 61 | 62 | if (report_file_level < level) { 63 | return; 64 | } 65 | 66 | if (p_header) { 67 | strncpy(buf, p_header, MAX_LOG_BUF_SIZE-1); 68 | } 69 | 70 | if (strlen(buf) == MAX_LOG_BUF_SIZE) { 71 | return; 72 | } 73 | 74 | va_start(ap, p_format); 75 | vsnprintf(&buf[strlen(buf)], MAX_LOG_BUF_SIZE - strlen(buf), p_format, ap); 76 | va_end(ap); 77 | 78 | fputs(buf, report_file); 79 | fflush(report_file); 80 | } 81 | 82 | VpiRet log_setlevel(int level) 83 | { 84 | if( level >= LOG_LEVEL_OFF && level < LOG_LEVEL_MAX) 85 | report_file_level = level; 86 | return VPI_SUCCESS; 87 | } 88 | 89 | VpiRet log_open(char *file_name) 90 | { 91 | if (NULL == file_name) { 92 | return VPI_ERR_SW; 93 | } 94 | 95 | report_file = fopen(file_name, "w"); 96 | if (!report_file) { 97 | printf("Failed to open report \"%s\"\n", file_name); 98 | return VPI_ERR_SW; 99 | } 100 | return VPI_SUCCESS; 101 | } 102 | 103 | void log_close() 104 | { 105 | fclose(report_file); 106 | } 107 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/common/tiledref.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- Copyright (c) 2015-2017, VeriSilicon Inc. All rights reserved -- 3 | -- Copyright (c) 2011-2014, Google Inc. All rights reserved. -- 4 | -- Copyright (c) 2007-2010, Hantro OY. All rights reserved. -- 5 | -- -- 6 | -- This software is confidential and proprietary and may be used only as -- 7 | -- expressly authorized by VeriSilicon in a written licensing agreement. -- 8 | -- -- 9 | -- This entire notice must be reproduced on all copies -- 10 | -- and may not be removed. -- 11 | -- -- 12 | -------------------------------------------------------------------------------- 13 | -- Redistribution and use in source and binary forms, with or without -- 14 | -- modification, are permitted provided that the following conditions are met:-- 15 | -- * Redistributions of source code must retain the above copyright notice, -- 16 | -- this list of conditions and the following disclaimer. -- 17 | -- * Redistributions in binary form must reproduce the above copyright -- 18 | -- notice, this list of conditions and the following disclaimer in the -- 19 | -- documentation and/or other materials provided with the distribution. -- 20 | -- * Neither the names of Google nor the names of its contributors may be -- 21 | -- used to endorse or promote products derived from this software -- 22 | -- without specific prior written permission. -- 23 | -------------------------------------------------------------------------------- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"-- 25 | -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- 26 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- 27 | -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- 28 | -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- 29 | -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- 30 | -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- 31 | -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- 32 | -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- 33 | -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- 34 | -- POSSIBILITY OF SUCH DAMAGE. -- 35 | -------------------------------------------------------------------------------- 36 | ------------------------------------------------------------------------------*/ 37 | 38 | #ifndef TILEDREF_H_DEFINED 39 | #define TILEDREF_H_DEFINED 40 | 41 | #include "basetype.h" 42 | #include "decapicommon.h" 43 | 44 | #define TILED_REF_NONE (0) 45 | #define TILED_REF_8x4 (1) 46 | #define TILED_REF_8x4_INTERLACED (2) 47 | 48 | u32 DecSetupTiledReference( u32 *reg_base, u32 tiled_mode_support, 49 | enum DecDpbMode dpb_mode, u32 interlaced_stream ); 50 | u32 DecCheckTiledMode( u32 tiled_mode_support, enum DecDpbMode dpb_mode, 51 | u32 interlaced_stream ); 52 | 53 | #endif /* TILEDREF_H_DEFINED */ 54 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/common/errorhandling.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- Copyright (c) 2015-2017, VeriSilicon Inc. All rights reserved -- 3 | -- Copyright (c) 2011-2014, Google Inc. All rights reserved. -- 4 | -- Copyright (c) 2007-2010, Hantro OY. All rights reserved. -- 5 | -- -- 6 | -- This software is confidential and proprietary and may be used only as -- 7 | -- expressly authorized by VeriSilicon in a written licensing agreement. -- 8 | -- -- 9 | -- This entire notice must be reproduced on all copies -- 10 | -- and may not be removed. -- 11 | -- -- 12 | -------------------------------------------------------------------------------- 13 | -- Redistribution and use in source and binary forms, with or without -- 14 | -- modification, are permitted provided that the following conditions are met:-- 15 | -- * Redistributions of source code must retain the above copyright notice, -- 16 | -- this list of conditions and the following disclaimer. -- 17 | -- * Redistributions in binary form must reproduce the above copyright -- 18 | -- notice, this list of conditions and the following disclaimer in the -- 19 | -- documentation and/or other materials provided with the distribution. -- 20 | -- * Neither the names of Google nor the names of its contributors may be -- 21 | -- used to endorse or promote products derived from this software -- 22 | -- without specific prior written permission. -- 23 | -------------------------------------------------------------------------------- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"-- 25 | -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- 26 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- 27 | -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- 28 | -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- 29 | -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- 30 | -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- 31 | -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- 32 | -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- 33 | -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- 34 | -- POSSIBILITY OF SUCH DAMAGE. -- 35 | -------------------------------------------------------------------------------- 36 | ------------------------------------------------------------------------------*/ 37 | 38 | #ifndef ERRORHANDLING_H_DEFINED 39 | #define ERRORHANDLING_H_DEFINED 40 | 41 | #include "basetype.h" 42 | 43 | #ifndef HANTRO_TRUE 44 | #define HANTRO_TRUE (1) 45 | #endif /* HANTRO_TRUE */ 46 | 47 | #ifndef HANTRO_FALSE 48 | #define HANTRO_FALSE (0) 49 | #endif /* HANTRO_FALSE*/ 50 | 51 | void PreparePartialFreeze(u8 *dec_out, u32 vop_width, u32 vop_height); 52 | u32 ProcessPartialFreeze(u8 *dec_out, const u8 *ref_pic, u32 vop_width, 53 | u32 vop_height, u32 copy); 54 | u32 GetPartialFreezePos( u8 * dec_out, u32 vop_width, u32 vop_height); 55 | 56 | #endif /* ERRORHANDLING_H_DEFINED */ 57 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/vp9/vp9macroblocktools.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Abstract : Encoder instance 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | #ifndef VP9MACROBLOCK_TOOLS_H 21 | #define VP9MACROBLOCK_TOOLS_H 22 | 23 | /*------------------------------------------------------------------------------ 24 | Include headers 25 | ------------------------------------------------------------------------------*/ 26 | #include "base_type.h" 27 | #include "vp9instance.h" 28 | 29 | /*------------------------------------------------------------------------------ 30 | External compiler flags 31 | -------------------------------------------------------------------------------- 32 | 33 | -------------------------------------------------------------------------------- 34 | Module defines 35 | ------------------------------------------------------------------------------*/ 36 | 37 | typedef enum 38 | { 39 | /* Intra luma 16x16 or intra chroma 8x8 prediction modes */ 40 | DC_PRED, 41 | V_PRED, 42 | H_PRED, 43 | TM_PRED, 44 | 45 | /* Common name of intra predicted mb where partition size is 4x4 */ 46 | B_PRED, 47 | 48 | /* Intra 4x4 prediction modes */ 49 | B_DC_PRED, 50 | B_TM_PRED, 51 | B_VE_PRED, 52 | B_HE_PRED, 53 | B_LD_PRED, 54 | B_RD_PRED, 55 | B_VR_PRED, 56 | B_VL_PRED, 57 | B_HD_PRED, 58 | B_HU_PRED, 59 | 60 | /* Inter prediction (partitioning) types */ 61 | P_16x16, /* [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] */ 62 | P_16x8, /* [0,1,2,3,4,5,6,7,8][9,10,11,12,13,14,15] */ 63 | P_8x16, /* [0,1,4,5,8,9,12,13][2,3,6,7,10,11,14,15] */ 64 | P_8x8, /* [0,1,4,5][2,3,6,7][8,9,12,13][10,11,14,15] */ 65 | P_4x4 /* Every subblock gets its own vector */ 66 | } type; 67 | 68 | /*------------------------------------------------------------------------------ 69 | Function prototypes 70 | ------------------------------------------------------------------------------*/ 71 | void InitQuantTables(vp9Instance_s *); 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/vp9/vp9putbits.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | --------------------------------------------------------------------------------*/ 15 | 16 | #ifndef VP9PUT_BITS_H 17 | #define VP9PUT_BITS_H 18 | 19 | /*------------------------------------------------------------------------------ 20 | 1. Include headers 21 | ------------------------------------------------------------------------------*/ 22 | #include "base_type.h" 23 | 24 | /*------------------------------------------------------------------------------ 25 | 2. External compiler flags 26 | -------------------------------------------------------------------------------- 27 | 28 | -------------------------------------------------------------------------------- 29 | 3. Module defines 30 | ------------------------------------------------------------------------------*/ 31 | typedef struct 32 | { 33 | u8 *data; /* Pointer to next byte of data buffer */ 34 | u8 *pData; /* Pointer to beginning of data buffer */ 35 | i32 size; /* Size of *data in bytes */ 36 | i32 byteCnt; /* Data buffer stream byte count */ 37 | 38 | i32 range; /* Bool encoder range [128, 255] */ 39 | i32 bottom; /* Bool encoder left endpoint */ 40 | i32 bitsLeft; /* Bool encoder bits left before flush bottom */ 41 | } vp9buffer; 42 | 43 | typedef struct 44 | { 45 | i32 value; /* Bits describe the bool tree */ 46 | i32 number; /* Number, valid bit count in above tree */ 47 | i32 index[9]; /* Probability table index */ 48 | } tree; 49 | 50 | /*------------------------------------------------------------------------------ 51 | 4. Function prototypes 52 | ------------------------------------------------------------------------------*/ 53 | i32 VP9SetBuffer(vp9buffer *, u8 *, i32); 54 | i32 VP9BufferOverflow(vp9buffer *); 55 | i32 VP9BufferGap(vp9buffer *buffer, i32 gap); 56 | void VP9PutByte(vp9buffer *buffer, i32 byte); 57 | void VP9PutLit(vp9buffer *, i32, i32); 58 | void VP9PutBool(vp9buffer *buffer, i32 prob, i32 boolValue); 59 | void VP9PutTree(vp9buffer *buffer, tree const *tree, i32 *prob); 60 | void VP9FlushBuffer(vp9buffer *buffer); 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/h264high/h264_pp_pipeline.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- Copyright (c) 2015-2017, VeriSilicon Inc. All rights reserved -- 3 | -- Copyright (c) 2011-2014, Google Inc. All rights reserved. -- 4 | -- Copyright (c) 2007-2010, Hantro OY. All rights reserved. -- 5 | -- -- 6 | -- This software is confidential and proprietary and may be used only as -- 7 | -- expressly authorized by VeriSilicon in a written licensing agreement. -- 8 | -- -- 9 | -- This entire notice must be reproduced on all copies -- 10 | -- and may not be removed. -- 11 | -- -- 12 | -------------------------------------------------------------------------------- 13 | -- Redistribution and use in source and binary forms, with or without -- 14 | -- modification, are permitted provided that the following conditions are met:-- 15 | -- * Redistributions of source code must retain the above copyright notice, -- 16 | -- this list of conditions and the following disclaimer. -- 17 | -- * Redistributions in binary form must reproduce the above copyright -- 18 | -- notice, this list of conditions and the following disclaimer in the -- 19 | -- documentation and/or other materials provided with the distribution. -- 20 | -- * Neither the names of Google nor the names of its contributors may be -- 21 | -- used to endorse or promote products derived from this software -- 22 | -- without specific prior written permission. -- 23 | -------------------------------------------------------------------------------- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"-- 25 | -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- 26 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- 27 | -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- 28 | -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- 29 | -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- 30 | -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- 31 | -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- 32 | -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- 33 | -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- 34 | -- POSSIBILITY OF SUCH DAMAGE. -- 35 | -------------------------------------------------------------------------------- 36 | ------------------------------------------------------------------------------*/ 37 | 38 | #ifndef H264_PP_PIPELINE_H 39 | #define H264_PP_PIPELINE_H 40 | 41 | #include "decppif.h" 42 | 43 | i32 h264RegisterPP(const void *dec_inst, const void *pp_inst, 44 | void (*PPDecStart) (const void *, const DecPpInterface *), 45 | void (*PPDecWaitEnd) (const void *), 46 | void (*PPConfigQuery) (const void *, DecPpQuery *), 47 | void (*PPDisplayIndex) (const void *, u32)); 48 | 49 | i32 h264UnregisterPP(const void *dec_inst, const void *pp_inst); 50 | 51 | u32 h264UseDisplaySmoothing(const void *dec_inst); 52 | 53 | #endif /* #ifdef H264_PP_PIPELINE_H */ 54 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/h264high/h264decmc_internals.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- Copyright (c) 2015-2017, VeriSilicon Inc. All rights reserved -- 3 | -- Copyright (c) 2011-2014, Google Inc. All rights reserved. -- 4 | -- Copyright (c) 2007-2010, Hantro OY. All rights reserved. -- 5 | -- -- 6 | -- This software is confidential and proprietary and may be used only as -- 7 | -- expressly authorized by VeriSilicon in a written licensing agreement. -- 8 | -- -- 9 | -- This entire notice must be reproduced on all copies -- 10 | -- and may not be removed. -- 11 | -- -- 12 | -------------------------------------------------------------------------------- 13 | -- Redistribution and use in source and binary forms, with or without -- 14 | -- modification, are permitted provided that the following conditions are met:-- 15 | -- * Redistributions of source code must retain the above copyright notice, -- 16 | -- this list of conditions and the following disclaimer. -- 17 | -- * Redistributions in binary form must reproduce the above copyright -- 18 | -- notice, this list of conditions and the following disclaimer in the -- 19 | -- documentation and/or other materials provided with the distribution. -- 20 | -- * Neither the names of Google nor the names of its contributors may be -- 21 | -- used to endorse or promote products derived from this software -- 22 | -- without specific prior written permission. -- 23 | -------------------------------------------------------------------------------- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"-- 25 | -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- 26 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- 27 | -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- 28 | -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- 29 | -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- 30 | -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- 31 | -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- 32 | -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- 33 | -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- 34 | -- POSSIBILITY OF SUCH DAMAGE. -- 35 | -------------------------------------------------------------------------------- 36 | ------------------------------------------------------------------------------*/ 37 | 38 | #ifndef SOFTWARE_SOURCE_H264HIGH_H264DECMC_INTERNALS_H_ 39 | #define SOFTWARE_SOURCE_H264HIGH_H264DECMC_INTERNALS_H_ 40 | 41 | #include "basetype.h" 42 | #include "h264hwd_container.h" 43 | 44 | void h264MCPushOutputAll(decContainer_t *dec_cont); 45 | void h264MCWaitPicReadyAll(decContainer_t *dec_cont); 46 | 47 | void h264MCSetHwRdyCallback(decContainer_t *dec_cont); 48 | 49 | void h264MCSetRefPicStatus(volatile u8 *p_sync_mem, u32 is_field_pic, 50 | u32 is_bottom_field); 51 | 52 | void h264MCHwRdyCallback(void *args, i32 core_id); 53 | 54 | #endif /* SOFTWARE_SOURCE_H264HIGH_H264DECMC_INTERNALS_H_ */ 55 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/h264high/h264_pp_multibuffer.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- Copyright (c) 2015-2017, VeriSilicon Inc. All rights reserved -- 3 | -- Copyright (c) 2011-2014, Google Inc. All rights reserved. -- 4 | -- Copyright (c) 2007-2010, Hantro OY. All rights reserved. -- 5 | -- -- 6 | -- This software is confidential and proprietary and may be used only as -- 7 | -- expressly authorized by VeriSilicon in a written licensing agreement. -- 8 | -- -- 9 | -- This entire notice must be reproduced on all copies -- 10 | -- and may not be removed. -- 11 | -- -- 12 | -------------------------------------------------------------------------------- 13 | -- Redistribution and use in source and binary forms, with or without -- 14 | -- modification, are permitted provided that the following conditions are met:-- 15 | -- * Redistributions of source code must retain the above copyright notice, -- 16 | -- this list of conditions and the following disclaimer. -- 17 | -- * Redistributions in binary form must reproduce the above copyright -- 18 | -- notice, this list of conditions and the following disclaimer in the -- 19 | -- documentation and/or other materials provided with the distribution. -- 20 | -- * Neither the names of Google nor the names of its contributors may be -- 21 | -- used to endorse or promote products derived from this software -- 22 | -- without specific prior written permission. -- 23 | -------------------------------------------------------------------------------- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"-- 25 | -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- 26 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- 27 | -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- 28 | -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- 29 | -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- 30 | -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- 31 | -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- 32 | -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- 33 | -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- 34 | -- POSSIBILITY OF SUCH DAMAGE. -- 35 | -------------------------------------------------------------------------------- 36 | ------------------------------------------------------------------------------*/ 37 | 38 | #ifndef H264_PP_MULTIBUFFER_H 39 | #define H264_PP_MULTIBUFFER_H 40 | 41 | #include "basetype.h" 42 | #include "dwl.h" 43 | #include "h264hwd_container.h" 44 | 45 | void h264PpMultiInit(decContainer_t * dec_cont, u32 max_buff); 46 | u32 h264PpMultiAddPic(decContainer_t * dec_cont, const struct DWLLinearMem * data); 47 | u32 h264PpMultiRemovePic(decContainer_t * dec_cont, 48 | const struct DWLLinearMem * data); 49 | u32 h264PpMultiFindPic(decContainer_t * dec_cont, const struct DWLLinearMem * data); 50 | 51 | void h264PpMultiMvc(decContainer_t * dec_cont, u32 max_buff_id); 52 | 53 | #endif /* H264_PP_MULTIBUFFER_H */ 54 | -------------------------------------------------------------------------------- /sdk_inc/VC8000E/software/source/vp9/vp9seqparameterset.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- -- 3 | -- This software is confidential and proprietary and may be used -- 4 | -- only as expressly authorized by a licensing agreement from -- 5 | -- -- 6 | -- Verisilicon. -- 7 | -- -- 8 | -- (C) COPYRIGHT 2014 VERISILICON -- 9 | -- ALL RIGHTS RESERVED -- 10 | -- -- 11 | -- The entire notice above must be reproduced -- 12 | -- on all copies and should not be removed. -- 13 | -- -- 14 | -------------------------------------------------------------------------------- 15 | -- 16 | -- Abstract : Sequence parameter set 17 | -- 18 | ------------------------------------------------------------------------------*/ 19 | 20 | #ifndef VP9SEQ_PARAMETER_SET_H 21 | #define VP9SEQ_PARAMETER_SET_H 22 | 23 | /*------------------------------------------------------------------------------ 24 | 1. Include headers 25 | ------------------------------------------------------------------------------*/ 26 | #include "base_type.h" 27 | 28 | /*------------------------------------------------------------------------------ 29 | 2. External compiler flags 30 | -------------------------------------------------------------------------------- 31 | 32 | -------------------------------------------------------------------------------- 33 | 3. Module defines 34 | ------------------------------------------------------------------------------*/ 35 | typedef struct 36 | { 37 | i32 picWidthInMbs; 38 | i32 picHeightInMbs; 39 | i32 picWidthInPixel; 40 | i32 picHeightInPixel; 41 | i32 horizontalScaling; 42 | i32 verticalScaling; 43 | i32 colorType; 44 | i32 clampType; 45 | i32 dctPartitions; /* Dct data partitions 0=1, 1=2, 2=4, 3=8 */ 46 | i32 partitionCnt; /* Abbreviation: 2+(1<dctPartitions) */ 47 | i32 profile; 48 | i32 filterType; 49 | i32 filterLevel; 50 | i32 filterSharpness; 51 | i32 quarterPixelMv; 52 | i32 splitMv; 53 | i32 singBias[3]; /* SingBias: 0 = ipf, 1 = grf, 2 = arf */ 54 | 55 | i32 autoFilterLevel; 56 | i32 autoFilterSharpness; 57 | bool filterDeltaEnable; 58 | i32 modeDelta[4]; 59 | i32 oldModeDelta[4]; 60 | i32 refDelta[4]; 61 | i32 oldRefDelta[4]; 62 | 63 | i32 refreshEntropy; 64 | i32 qpDelta[5]; /* Quant deltas for Ydc, Y2dc, Y2ac, UVdc, UVac */ 65 | i32 autoQpDelta[5]; /* Automatic setting based on QP */ 66 | } sps; 67 | 68 | /*------------------------------------------------------------------------------ 69 | 4. Function prototypes 70 | ------------------------------------------------------------------------------*/ 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /sdk_inc/VC8000D/software/source/h264high/h264decapi_e.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | -- Copyright (c) 2015-2017, VeriSilicon Inc. All rights reserved -- 3 | -- Copyright (c) 2011-2014, Google Inc. All rights reserved. -- 4 | -- Copyright (c) 2007-2010, Hantro OY. All rights reserved. -- 5 | -- -- 6 | -- This software is confidential and proprietary and may be used only as -- 7 | -- expressly authorized by VeriSilicon in a written licensing agreement. -- 8 | -- -- 9 | -- This entire notice must be reproduced on all copies -- 10 | -- and may not be removed. -- 11 | -- -- 12 | -------------------------------------------------------------------------------- 13 | -- Redistribution and use in source and binary forms, with or without -- 14 | -- modification, are permitted provided that the following conditions are met:-- 15 | -- * Redistributions of source code must retain the above copyright notice, -- 16 | -- this list of conditions and the following disclaimer. -- 17 | -- * Redistributions in binary form must reproduce the above copyright -- 18 | -- notice, this list of conditions and the following disclaimer in the -- 19 | -- documentation and/or other materials provided with the distribution. -- 20 | -- * Neither the names of Google nor the names of its contributors may be -- 21 | -- used to endorse or promote products derived from this software -- 22 | -- without specific prior written permission. -- 23 | -------------------------------------------------------------------------------- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"-- 25 | -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- 26 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- 27 | -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- 28 | -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- 29 | -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- 30 | -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- 31 | -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- 32 | -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- 33 | -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- 34 | -- POSSIBILITY OF SUCH DAMAGE. -- 35 | -------------------------------------------------------------------------------- 36 | ------------------------------------------------------------------------------*/ 37 | 38 | #ifndef __H264DECAPI_E_H__ 39 | #define __H264DECAPI_E_H__ 40 | 41 | #ifdef __cplusplus 42 | extern "C" 43 | { 44 | #endif 45 | 46 | #include "h264decapi.h" 47 | 48 | /*------------------------------------------------------------------------------ 49 | Prototypes of Decoder API extension functions 50 | ------------------------------------------------------------------------------*/ 51 | 52 | enum DecRet H264DecNextChPicture(H264DecInst dec_inst, 53 | u32 **output_picture, 54 | addr_t *output_picture_bus_address); 55 | 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /* __H264DECAPI_E_H__ */ 62 | --------------------------------------------------------------------------------