mirror of
https://github.com/sipeed/LicheeRV-Nano-Build.git
synced 2026-09-11 05:09:56 -05:00
fix missing dep
This commit is contained in:
@@ -102,7 +102,6 @@ package:
|
||||
@echo "package done"
|
||||
endif
|
||||
clean:
|
||||
@if [ -d mod_tmp ]; then mv mod_tmp modules; fi;
|
||||
@rm -rf include/isp
|
||||
@make -C modules/ clean
|
||||
@make -C 3rdparty/ clean
|
||||
|
||||
177
middleware/v2/include/acodec.h
Normal file
177
middleware/v2/include/acodec.h
Normal file
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/acodec.h
|
||||
* Description: audio codec define and api
|
||||
*/
|
||||
#ifndef _ACODEC_H_
|
||||
#define _ACODEC_H_
|
||||
|
||||
#define IOC_TYPE_ACODEC 'A'
|
||||
|
||||
typedef enum cviACODEC_FS_E {
|
||||
ACODEC_FS_8000 = 0x1,
|
||||
ACODEC_FS_11025 = 0x2,
|
||||
ACODEC_FS_12000 = 0x3,
|
||||
ACODEC_FS_16000 = 0x4,
|
||||
ACODEC_FS_22050 = 0x5,
|
||||
ACODEC_FS_24000 = 0x6,
|
||||
ACODEC_FS_32000 = 0x7,
|
||||
ACODEC_FS_44100 = 0x8,
|
||||
ACODEC_FS_48000 = 0x9,
|
||||
ACODEC_FS_64000 = 0xa,
|
||||
ACODEC_FS_96000 = 0xb,
|
||||
|
||||
ACODEC_FS_BUTT = 0x1c,
|
||||
} ACODEC_FS_E;
|
||||
|
||||
typedef enum cviACODEC_MIXER_E {
|
||||
ACODEC_MIXER_IN0 = 0x0, /* 16CV500/16DV300 Unsupport IN0. */
|
||||
ACODEC_MIXER_IN1 = 0x1,
|
||||
ACODEC_MIXER_IN_D = 0x2,
|
||||
|
||||
ACODEC_MIXER_BUTT,
|
||||
} ACODEC_MIXER_E;
|
||||
|
||||
typedef struct {
|
||||
/*volume control, 0x00~0x7e, 0x7F:mute*/
|
||||
unsigned int vol_ctrl;
|
||||
/*adc/dac mute control, 1:mute, 0:unmute*/
|
||||
unsigned int vol_ctrl_mute;
|
||||
} ACODEC_VOL_CTRL;
|
||||
|
||||
typedef enum cviACODEC_IOCTL_E {
|
||||
IOC_NR_SOFT_RESET_CTRL = 0x0,
|
||||
|
||||
IOC_NR_SET_INPUT_VOL,
|
||||
IOC_NR_SET_OUTPUT_VOL,
|
||||
IOC_NR_GET_INPUT_VOL,
|
||||
IOC_NR_GET_OUTPUT_VOL,
|
||||
|
||||
IOC_NR_SET_I2S1_FS,
|
||||
IOC_NR_SET_MIXER_MIC,
|
||||
IOC_NR_SEL_DAC_CLK,
|
||||
IOC_NR_SEL_ADC_CLK,
|
||||
IOC_NR_SEL_ANA_MCLK,
|
||||
IOC_NR_SET_GAIN_MICL,
|
||||
IOC_NR_SET_GAIN_MICR,
|
||||
IOC_NR_SET_DACL_VOL,
|
||||
IOC_NR_SET_DACR_VOL,
|
||||
IOC_NR_SET_ADCL_VOL,
|
||||
IOC_NR_SET_ADCR_VOL,
|
||||
IOC_NR_SET_MICL_MUTE,
|
||||
IOC_NR_SET_MICR_MUTE,
|
||||
IOC_NR_SET_DACL_MUTE,
|
||||
IOC_NR_SET_DACR_MUTE,
|
||||
IOC_NR_BOOSTL_ENABLE,
|
||||
IOC_NR_BOOSTR_ENABLE,
|
||||
|
||||
IOC_NR_GET_GAIN_MICL,
|
||||
IOC_NR_GET_GAIN_MICR,
|
||||
IOC_NR_GET_DACL_VOL,
|
||||
IOC_NR_GET_DACR_VOL,
|
||||
IOC_NR_GET_ADCL_VOL,
|
||||
IOC_NR_GET_ADCR_VOL,
|
||||
|
||||
IOC_NR_SET_PD_DACL,
|
||||
IOC_NR_SET_PD_DACR,
|
||||
IOC_NR_SET_PD_ADCL,
|
||||
IOC_NR_SET_PD_ADCR,
|
||||
IOC_NR_SET_PD_LINEINL,
|
||||
IOC_NR_SET_PD_LINEINR,
|
||||
|
||||
IOC_NR_SET_DAC_DE_EMPHASIS,
|
||||
IOC_NR_SET_ADC_HP_FILTER,
|
||||
|
||||
IOC_NR_SET_I2S1_DATAWIDTH,
|
||||
} ACODEC_IOCTL_E;
|
||||
|
||||
/*reset the audio code to the default config*/
|
||||
#define ACODEC_SOFT_RESET_CTRL \
|
||||
_IO(IOC_TYPE_ACODEC, IOC_NR_SOFT_RESET_CTRL)
|
||||
/*ACODEC_FS_E*/
|
||||
#define ACODEC_SET_I2S1_FS \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_I2S1_FS, unsigned int)
|
||||
|
||||
/*select the micpga's input, micin linein, or differential input(ACODEC_MIXER_E)*/
|
||||
#define ACODEC_SET_MIXER_MIC \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_MIXER_MIC, unsigned int)
|
||||
/*analog part input volume control(left channel 0~0x1f)*/
|
||||
#define ACODEC_SET_GAIN_MICL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_GAIN_MICL, unsigned int)
|
||||
/*analog part input volume control(right channel 0~0x1f)*/
|
||||
#define ACODEC_SET_GAIN_MICR \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_GAIN_MICR, unsigned int)
|
||||
/*Output volume control(left channel) ACODEC_VOL_CTRL*/
|
||||
#define ACODEC_SET_DACL_VOL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_DACL_VOL, ACODEC_VOL_CTRL)
|
||||
/*Output volume control(right channel) ACODEC_VOL_CTRL*/
|
||||
#define ACODEC_SET_DACR_VOL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_DACR_VOL, ACODEC_VOL_CTRL)
|
||||
/*Input volume control(left channel) ACODEC_VOL_CTRL*/
|
||||
#define ACODEC_SET_ADCL_VOL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_ADCL_VOL, ACODEC_VOL_CTRL)
|
||||
/*Input volume control(right channel) ACODEC_VOL_CTRL*/
|
||||
#define ACODEC_SET_ADCR_VOL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_ADCR_VOL, ACODEC_VOL_CTRL)
|
||||
/*Input mute control(left channel), 1:mute, 0:unmute*/
|
||||
#define ACODEC_SET_MICL_MUTE \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_MICL_MUTE, unsigned int)
|
||||
/*Input mute control(right channel), 1:mute, 0:unmute*/
|
||||
#define ACODEC_SET_MICR_MUTE \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_MICR_MUTE, unsigned int)
|
||||
/*Output mute control(left channel), 1:mute, 0:unmute*/
|
||||
#define ACODEC_SET_DACL_MUTE \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_DACL_MUTE, unsigned int)
|
||||
/*Output mute control(right channel), 1:mute, 0:unmute*/
|
||||
#define ACODEC_SET_DACR_MUTE \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_DACR_MUTE, unsigned int)
|
||||
#define ACODEC_GET_GAIN_MICL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_GET_GAIN_MICL, unsigned int)
|
||||
#define ACODEC_GET_GAIN_MICR \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_GET_GAIN_MICR, unsigned int)
|
||||
#define ACODEC_GET_DACL_VOL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_GET_DACL_VOL, ACODEC_VOL_CTRL)
|
||||
#define ACODEC_GET_DACR_VOL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_GET_DACR_VOL, ACODEC_VOL_CTRL)
|
||||
#define ACODEC_GET_ADCL_VOL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_GET_ADCL_VOL, ACODEC_VOL_CTRL)
|
||||
#define ACODEC_GET_ADCR_VOL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_GET_ADCR_VOL, ACODEC_VOL_CTRL)
|
||||
|
||||
/*set adcl power, 0: power up, 1: power down*/
|
||||
#define ACODEC_SET_PD_DACL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_PD_DACL, unsigned int)
|
||||
/*set adcr power, 0: power up, 1: power down*/
|
||||
#define ACODEC_SET_PD_DACR \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_PD_DACR, unsigned int)
|
||||
/*set adcl power, 0: power up, 1: power down*/
|
||||
#define ACODEC_SET_PD_ADCL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_PD_ADCL, unsigned int)
|
||||
/*set adcr power, 0: power up, 1: power down*/
|
||||
#define ACODEC_SET_PD_ADCR \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_PD_ADCR, unsigned int)
|
||||
/*set adcl power, 0: power up, 1: power down*/
|
||||
#define ACODEC_SET_PD_LINEINL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_PD_LINEINL, unsigned int)
|
||||
/*set adcr power, 0: power up, 1: power down*/
|
||||
#define ACODEC_SET_PD_LINEINR \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_PD_LINEINR, unsigned int)
|
||||
|
||||
/* Don't need to set, the driver will set a default value */
|
||||
/*clock of dac and adc is reverse or obverse*/
|
||||
#define ACODEC_SET_DAC_DE_EMPHASIS \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_DAC_DE_EMPHASIS, unsigned int)
|
||||
#define ACODEC_SET_ADC_HP_FILTER \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_ADC_HP_FILTER, unsigned int)
|
||||
|
||||
#define ACODEC_SET_INPUT_VOL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_INPUT_VOL, unsigned int)
|
||||
#define ACODEC_SET_OUTPUT_VOL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_SET_OUTPUT_VOL, unsigned int)
|
||||
#define ACODEC_GET_INPUT_VOL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_GET_INPUT_VOL, unsigned int)
|
||||
#define ACODEC_GET_OUTPUT_VOL \
|
||||
_IOWR(IOC_TYPE_ACODEC, IOC_NR_GET_OUTPUT_VOL, unsigned int)
|
||||
|
||||
#endif /* End of #ifndef _ACODEC_H_ */
|
||||
96
middleware/v2/include/cli.h
Normal file
96
middleware/v2/include/cli.h
Normal file
@@ -0,0 +1,96 @@
|
||||
#ifndef __CLIAPI_H__
|
||||
#define __CLIAPI_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define CLI_UART_SUPPORT 0x01
|
||||
#define CLI_TELNET_SUPPORT 0x02
|
||||
#define CLI_UART_CLIENT_SUPPORT 0x04
|
||||
|
||||
|
||||
#define DECLARE_TELNET_CLI_CMD_MACRO(name, child, Cbfunc, help, usermode) { \
|
||||
(#name), \
|
||||
child, \
|
||||
Cbfunc, \
|
||||
(#help), \
|
||||
usermode, \
|
||||
0, \
|
||||
0, \
|
||||
0 \
|
||||
}
|
||||
|
||||
#define DECLARE_TELNET_CLI_CMD_MACRO_END() { \
|
||||
(0), \
|
||||
(0), \
|
||||
(0), \
|
||||
(0), \
|
||||
(0), \
|
||||
(0), \
|
||||
(0), \
|
||||
(0) \
|
||||
}
|
||||
|
||||
typedef enum{
|
||||
DEBUG_EN_TRACE_NONE = 0, //always print
|
||||
DEBUG_EN_TRACE_ERROR,
|
||||
DEBUG_EN_TRACE_WARNING,
|
||||
DEBUG_EN_TRACE_INFO,
|
||||
DEBUG_EN_TRACE_BUTT
|
||||
} DEBUG_EN_LEVEL;
|
||||
|
||||
typedef struct TELNET_CLI_S_COMMANDtag {
|
||||
char *pcName;
|
||||
struct TELNET_CLI_S_COMMANDtag *pChildren;
|
||||
int (*pCallback)(int argc, char *argv[]);
|
||||
char *pcCmdHelp;
|
||||
int i32UserMode;
|
||||
struct TELNET_CLI_S_COMMANDtag *next;
|
||||
struct TELNET_CLI_S_COMMANDtag *parent;
|
||||
struct TELNET_CLI_S_COMMANDtag *prev;
|
||||
} TELNET_CLI_S_COMMAND, *TELNET_CLI_S_COMMAND_PTR;
|
||||
|
||||
// for_register_cmd
|
||||
typedef TELNET_CLI_S_COMMAND TELNET_S_CLICMD;
|
||||
|
||||
#define DECLARE_CLI_CMD_MACRO(name, child, Cbfunc, help, usermode) \
|
||||
DECLARE_TELNET_CLI_CMD_MACRO(name, child, Cbfunc, help, usermode)
|
||||
|
||||
#define DECLARE_CLI_CMD_MACRO_END() DECLARE_TELNET_CLI_CMD_MACRO_END()
|
||||
// end for_register_cmd
|
||||
|
||||
extern void TelnetTracePrint(const DEBUG_EN_LEVEL enLevel, char *pcpathname,
|
||||
const unsigned int u32Line, const char *fmt, ...);
|
||||
extern int RegisterCliCommand(void *pstCliCmd);
|
||||
extern void CliInit(int flag);
|
||||
extern void CliDeInit(void);
|
||||
|
||||
|
||||
#ifndef tcli_info
|
||||
#define tcli_info(fmt...) TelnetTracePrint(DEBUG_EN_TRACE_INFO, __FILE__, __LINE__, fmt)
|
||||
#endif
|
||||
|
||||
#ifndef tcli_warning
|
||||
#define tcli_warning(fmt...) TelnetTracePrint(DEBUG_EN_TRACE_WARNING, __FILE__, __LINE__, fmt)
|
||||
#endif
|
||||
|
||||
#ifndef tcli_error
|
||||
#define tcli_error(fmt...) TelnetTracePrint(DEBUG_EN_TRACE_ERROR, __FILE__, __LINE__, fmt)
|
||||
#endif
|
||||
|
||||
|
||||
//always print,can not be control
|
||||
#ifndef tcli_print
|
||||
#define tcli_print(fmt...) TelnetTracePrint(DEBUG_EN_TRACE_NONE, __FILE__, __LINE__, fmt)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
164
middleware/v2/include/cmpr_canvas.h
Normal file
164
middleware/v2/include/cmpr_canvas.h
Normal file
@@ -0,0 +1,164 @@
|
||||
#ifndef __CMPR_CANVAS__
|
||||
#define __CMPR_CANVAS__
|
||||
|
||||
#include <float.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "osd_cmpr.h"
|
||||
|
||||
#define BUF_GUARD_SIZE (1 << 12)
|
||||
#define OSDEC_RL_BD (6)
|
||||
#define OSDEC_PAL_BD (3)
|
||||
#define OSDEC_MAX_RL (1 << OSDEC_RL_BD)
|
||||
|
||||
#define MIN_THICKNESS (1)
|
||||
#define MAX_THICKNESS (32)
|
||||
|
||||
#define BG_COLOR_CODE (2)
|
||||
#define CMPR_CANVAS_DBG (0)
|
||||
|
||||
enum DRAW_OBJ_TYPE {
|
||||
RECT = 0,
|
||||
STROKE_RECT,
|
||||
BIT_MAP,
|
||||
LINE,
|
||||
CMPR_BIT_MAP,
|
||||
NUM_OF_DRAW_OBJ
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int width;
|
||||
int height;
|
||||
OSD_FORMAT format;
|
||||
uint32_t bg_color_code;
|
||||
} Canvas_Attr;
|
||||
|
||||
typedef union _COLOR {
|
||||
uint32_t code;
|
||||
uint8_t *buf;
|
||||
} COLOR;
|
||||
|
||||
typedef struct {
|
||||
int x0; // start position
|
||||
int x1; // end position
|
||||
uint16_t obj_id;
|
||||
} OBJ_SLICE;
|
||||
|
||||
typedef struct {
|
||||
bool is_const;
|
||||
bool is_cmpr;
|
||||
uint16_t width;
|
||||
union {
|
||||
uint32_t stride;
|
||||
uint16_t *bs_len;
|
||||
};
|
||||
COLOR color;
|
||||
uint16_t id;
|
||||
} SEGMENT;
|
||||
|
||||
typedef struct {
|
||||
int x;
|
||||
int y;
|
||||
int width;
|
||||
int height;
|
||||
int thickness;
|
||||
} RECT_ATTR;
|
||||
|
||||
typedef struct {
|
||||
RECT_ATTR rect;
|
||||
union {
|
||||
uint32_t stride;
|
||||
uint32_t bs_offset;
|
||||
};
|
||||
} BITMAP_ATTR;
|
||||
|
||||
typedef struct {
|
||||
float _mx; // slope of two end-point vector
|
||||
float _bx[2];
|
||||
float _by[2];
|
||||
float _ex[2];
|
||||
float _ey[2];
|
||||
float ts_h; // thickness proj. on horizontal slice
|
||||
} LINE_ATTR;
|
||||
|
||||
typedef struct {
|
||||
DRAW_OBJ_TYPE type;
|
||||
union {
|
||||
RECT_ATTR rect;
|
||||
LINE_ATTR line;
|
||||
BITMAP_ATTR bitmap;
|
||||
};
|
||||
COLOR color;
|
||||
int _max_y;
|
||||
int _min_y;
|
||||
} DRAW_OBJ;
|
||||
|
||||
typedef struct {
|
||||
OSDCmpr_Ctrl osdCmpr_ctrl;
|
||||
StreamBuffer bitstream;
|
||||
RGBA last_color;
|
||||
int rl_cnt;
|
||||
MODE_TYPE md;
|
||||
CODE code;
|
||||
} Cmpr_Canvas_Ctrl;
|
||||
|
||||
uint32_t est_cmpr_canvas_size(Canvas_Attr *canvas, DRAW_OBJ *objs, uint32_t obj_num);
|
||||
|
||||
int draw_cmpr_canvas(Canvas_Attr *canvas, DRAW_OBJ *objs, uint32_t obj_num,
|
||||
uint8_t *obuf, int buf_size, uint32_t *p_osize);
|
||||
|
||||
void set_rect_obj_attr(DRAW_OBJ *obj, Canvas_Attr *canvas, uint32_t color_code,
|
||||
int pt_x, int pt_y, int width, int height,
|
||||
bool is_filled, int thickness);
|
||||
void set_bitmap_obj_attr(DRAW_OBJ *obj_attr, Canvas_Attr *canvas, uint8_t *buf,
|
||||
int pt_x, int pt_y, int width, int height,
|
||||
bool is_cmpr);
|
||||
void set_line_obj_attr(DRAW_OBJ *obj, Canvas_Attr *canvas, uint32_t color_code,
|
||||
int pt_x0, int pt_y0, int pt_x1, int pt_y1,
|
||||
int thickness);
|
||||
int cmpr_bitmap(Canvas_Attr *canvas, uint8_t *ibuf, uint8_t *obuf, int width,
|
||||
int height, int buf_size, uint32_t *p_osize);
|
||||
|
||||
#if (CMPR_CANVAS_DBG)
|
||||
int draw_canvas_raw_buffer(Canvas_Attr &canvas, vector<DRAW_OBJ> obj_vec,
|
||||
uint8_t *obuf);
|
||||
int draw_canvas_raw_buffer2(Canvas_Attr &canvas, vector<DRAW_OBJ> obj_vec,
|
||||
uint8_t *obuf);
|
||||
#endif
|
||||
|
||||
//==============================================================================================
|
||||
//CVI interface
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
uint32_t CVI_OSDC_est_cmpr_canvas_size(Canvas_Attr *canvas, DRAW_OBJ *objs, uint32_t obj_num);
|
||||
|
||||
int CVI_OSDC_draw_cmpr_canvas(Canvas_Attr *canvas, DRAW_OBJ *objs, uint32_t obj_num,
|
||||
uint8_t *obuf, uint32_t buf_size, uint32_t *p_osize);
|
||||
|
||||
void CVI_OSDC_set_rect_obj_attr(Canvas_Attr *canvas, DRAW_OBJ *obj, uint32_t color_code,
|
||||
int pt_x, int pt_y, int width, int height, bool is_filled, int thickness);
|
||||
|
||||
void CVI_OSDC_set_bitmap_obj_attr(Canvas_Attr *canvas, DRAW_OBJ *obj_attr, uint8_t *buf,
|
||||
int pt_x, int pt_y, int width, int height, bool is_cmpr);
|
||||
|
||||
void CVI_OSDC_set_line_obj_attr(Canvas_Attr *canvas, DRAW_OBJ *obj, uint32_t color_code,
|
||||
int pt_x0, int pt_y0, int pt_x1, int pt_y1, int thickness);
|
||||
|
||||
int CVI_OSDC_cmpr_bitmap(Canvas_Attr *canvas, uint8_t *ibuf, uint8_t *obuf, int width, int height,
|
||||
int buf_size, uint32_t *p_osize);
|
||||
|
||||
#if (CMPR_CANVAS_DBG)
|
||||
int CVI_OSDC_draw_canvas_raw_buffer(Canvas_Attr &canvas, vector<DRAW_OBJ> obj_vec, uint8_t *obuf);
|
||||
int CVI_OSDC_draw_canvas_raw_buffer2(Canvas_Attr &canvas, vector<DRAW_OBJ> obj_vec, uint8_t *obuf);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __CMPR_CANVAS__ */
|
||||
587
middleware/v2/include/cvi_audio.h
Normal file
587
middleware/v2/include/cvi_audio.h
Normal file
@@ -0,0 +1,587 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_audio.h
|
||||
* Description: basic audio api for application layer
|
||||
*/
|
||||
|
||||
#ifndef __CVI_AUDIO_H__
|
||||
#define __CVI_AUDIO_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <linux/cvi_type.h>
|
||||
#include <linux/cvi_common.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "cvi_comm_aio.h"
|
||||
#include "cvi_comm_aenc.h"
|
||||
#include "cvi_comm_adec.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define AENC_ADAPT_MAGIC 0Xfcfcfcfc
|
||||
#ifdef CVI_MODIFIED
|
||||
CVI_S32 CVI_AUDIO_DEBUG(void);
|
||||
#endif
|
||||
//define print level -------------------------------------[start]
|
||||
#define CVI_AUD_MASK_ERR (0x00)
|
||||
#define CVI_AUD_MASK_INFO (0x01)
|
||||
#define CVI_AUD_MASK_DBG (0x02)
|
||||
|
||||
/* =====Audio function api===== */
|
||||
|
||||
/**
|
||||
* @brief Audio init
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AUDIO_INIT(void);
|
||||
|
||||
/**
|
||||
* @brief Audio deinit
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AUDIO_DEINIT(void);
|
||||
|
||||
/**
|
||||
* @brief Set the binding properties of the audio
|
||||
* @param pstSrcChn Source information of bind mode
|
||||
* @param pstDestChn Target information of bind mode
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AUD_SYS_Bind(const MMF_CHN_S *pstSrcChn, const MMF_CHN_S *pstDestChn);
|
||||
|
||||
/**
|
||||
* @brief Unregister the binding mode of the system
|
||||
* @param pstSrcChn Source information of bind mode
|
||||
* @param pstDestChn Target information of bind mode
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AUD_SYS_UnBind(const MMF_CHN_S *pstSrcChn, const MMF_CHN_S *pstDestChn);
|
||||
/* AI function api. */
|
||||
|
||||
/**
|
||||
* @brief Set the parameter to audio
|
||||
* @param AiDevId the number of audio device
|
||||
* @param pstAttr pointer that describes an ai property
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_SetPubAttr(AUDIO_DEV AiDevId, const AIO_ATTR_S *pstAttr);
|
||||
|
||||
/**
|
||||
* @brief Get the parameter to audio
|
||||
* @param AiDevId the number of audio device
|
||||
* @param pstAttr pointer that describes an ai property
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_GetPubAttr(AUDIO_DEV AiDevId, AIO_ATTR_S *pstAttr);
|
||||
|
||||
/**
|
||||
* @brief Create and initial ai device.
|
||||
* @param AiDevId the number of audio device
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_Enable(AUDIO_DEV AiDevId);
|
||||
|
||||
/**
|
||||
* @brief Destroy ai device
|
||||
* @param AiDevId the number of audio device
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_Disable(AUDIO_DEV AiDevId);
|
||||
|
||||
/**
|
||||
* @brief Create and initial ai channel.
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_EnableChn(AUDIO_DEV AiDevId, AI_CHN AiChn);
|
||||
|
||||
/**
|
||||
* @brief Destroy ai channels
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_DisableChn(AUDIO_DEV AiDevId, AI_CHN AiChn);
|
||||
|
||||
/**
|
||||
* @brief Record and get audio data
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @param pstFrm the starting address of the obtained audio data
|
||||
* @param pstAecFrm the starting address of the obtained Reference signal
|
||||
* @param s32MilliSec -1:block mode/0:non-blocking/s32MilliSec
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_GetFrame(AUDIO_DEV AiDevId, AI_CHN AiChn,
|
||||
AUDIO_FRAME_S *pstFrm, AEC_FRAME_S *pstAecFrm, CVI_S32 s32MilliSec);
|
||||
|
||||
/**
|
||||
* @brief Release record frame
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @param pstFrm the starting address of the obtained audio data
|
||||
* @param pstAecFrm the starting address of the obtained Reference signal
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_ReleaseFrame(AUDIO_DEV AiDevId, AI_CHN AiChn,
|
||||
const AUDIO_FRAME_S *pstFrm, const AEC_FRAME_S *pstAecFrm);
|
||||
|
||||
/**
|
||||
* @brief Sets the frame depth of audio data
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @param pstChnParam frame depth struct
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_SetChnParam(AUDIO_DEV AiDevId, AI_CHN AiChn,
|
||||
const AI_CHN_PARAM_S *pstChnParam);
|
||||
/**
|
||||
* @brief Get the frame depth of audio data
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @param pstChnParam frame depth struct
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_GetChnParam(AUDIO_DEV AiDevId, AI_CHN AiChn,
|
||||
AI_CHN_PARAM_S *pstChnParam);
|
||||
/**
|
||||
* @brief Set record volume
|
||||
* @param AiDevId the number of audio device
|
||||
* @param s32VolumeStep input gain
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_SetVolume(AUDIO_DEV AiDevId, CVI_S32 s32VolumeStep);
|
||||
|
||||
/**
|
||||
* @brief Get record volume
|
||||
* @param AiDevId the number of audio device
|
||||
* @param ps32VolumeStep pointer to s32VolumeStep that indicates ai gain
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_GetVolume(AUDIO_DEV AiDevId, CVI_S32 *ps32VolumeStep);
|
||||
/**
|
||||
* @brief Set record volume
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @param s32VolumeDb input gain [0-100]
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_SetVqeVolume(AUDIO_DEV AiDevId, AI_CHN AiChn, CVI_S32 s32VolumeDb);
|
||||
/**
|
||||
* @brief Get record volume
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @param ps32VolumeDb pointer to s32VolumeStep that indicates ai gain
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_GetVqeVolume(AUDIO_DEV AiDevId, AI_CHN AiChn, CVI_S32 *ps32VolumeDb);
|
||||
/**
|
||||
* @brief Start Vqe(AGC+ANR+AES+AEC)
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_EnableVqe(AUDIO_DEV AiDevId, AI_CHN AiChn);
|
||||
|
||||
/**
|
||||
* @brief Destroy Vqe(AGC+ANR+AES+AEC)
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_DisableVqe(AUDIO_DEV AiDevId, AI_CHN AiChn);
|
||||
|
||||
/**
|
||||
* @brief Config Vqe(AGC+ANR+AES+AEC)
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @param u32Mask Select mask for vqe function
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_VqeFunConfig(AUDIO_DEV AiDevId, AI_CHN AiChn, int u32Mask);
|
||||
/**
|
||||
* @brief Start resample
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @param enOutSampleRate target sample rate
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_EnableReSmp(AUDIO_DEV AiDevId, AI_CHN AiChn,
|
||||
AUDIO_SAMPLE_RATE_E enOutSampleRate);
|
||||
/**
|
||||
* @brief Destroy resample
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_DisableReSmp(AUDIO_DEV AiDevId, AI_CHN AiChn);
|
||||
|
||||
/**
|
||||
* @brief Set audio input track status
|
||||
* @param AiDevId the number of audio device
|
||||
* @param enTrackMode the mode of track
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_SetTrackMode(AUDIO_DEV AiDevId,
|
||||
AUDIO_TRACK_MODE_E enTrackMode);
|
||||
/**
|
||||
* @brief Get audio input track status
|
||||
* @param AiDevId the number of audio device
|
||||
* @param penTrackMode the mode of track
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_GetTrackMode(AUDIO_DEV AiDevId,
|
||||
AUDIO_TRACK_MODE_E *penTrackMode);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Empty the parameters
|
||||
* @param AiDevId the number of audio device
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_ClrPubAttr(AUDIO_DEV AiDevId);
|
||||
|
||||
/**
|
||||
* @brief Set vqe attr and enable talk vqe
|
||||
* @param AiDevId the number of input device
|
||||
* @param AiChn the number of input channels
|
||||
* @param AoDevId the number of output device
|
||||
* @param AoChn the number of output channels
|
||||
* @param pstVqeConfig the config of vqe
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_SetTalkVqeAttr(AUDIO_DEV AiDevId, AI_CHN AiChn,
|
||||
AUDIO_DEV AoDevId, AO_CHN AoChn, const AI_TALKVQE_CONFIG_S *pstVqeConfig);
|
||||
|
||||
/**
|
||||
* @brief Get vqe attr
|
||||
* @param AiDevId the number of audio device
|
||||
* @param AiChn the number of audio channels
|
||||
* @param pstVqeConfig the config of vqe
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AI_GetTalkVqeAttr(AUDIO_DEV AiDevId, AI_CHN AiChn,
|
||||
AI_TALKVQE_CONFIG_S *pstVqeConfig);
|
||||
|
||||
/* AO function api. */
|
||||
|
||||
/**
|
||||
* @brief Transfer data bitdepth
|
||||
* @param InPt input buffer addr
|
||||
* @param pu32InSizeByte input buffer size
|
||||
* @param OutPt output buffer addr
|
||||
* @param pu32OutSizeByte output buffer size
|
||||
* @param s32BitOut target bitdepth to transfer only support 24 bit / 32 bit
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_BitOut_Transfer(CVI_CHAR **InPt, CVI_U32 *pu32InSizeByte,
|
||||
CVI_CHAR **OutPt,
|
||||
CVI_U32 *pu32OutSizeByte, CVI_S32 s32BitOut);
|
||||
/**
|
||||
* @brief Set the parameter to audio output
|
||||
* @param AoDevId the number of output device
|
||||
* @param pstAttr pointer that describes an ao property
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_SetPubAttr(AUDIO_DEV AoDevId, const AIO_ATTR_S *pstAttr);
|
||||
|
||||
/**
|
||||
* @brief Get the parameter to audio output
|
||||
* @param AoDevId the number of output device
|
||||
* @param pstAttr pointer that describes an ao property
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_GetPubAttr(AUDIO_DEV AoDevId, AIO_ATTR_S *pstAttr);
|
||||
|
||||
/**
|
||||
* @brief Create and initial ao device.
|
||||
* @param AoDevId the number of output device
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_Enable(AUDIO_DEV AoDevId);
|
||||
/**
|
||||
* @brief Destroy ao device
|
||||
* @param AoDevId the number of output device
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_Disable(AUDIO_DEV AoDevId);
|
||||
/**
|
||||
* @brief Create and initial ao channel.
|
||||
* @param AoDevId the number of ao device
|
||||
* @param AoChn the number of audio channels
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_EnableChn(AUDIO_DEV AoDevId, AO_CHN AoChn);
|
||||
/**
|
||||
* @brief Destroy ao channels
|
||||
* @param AoDevId the number of output device
|
||||
* @param AoChn the number of output channels
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_DisableChn(AUDIO_DEV AoDevId, AO_CHN AoChn);
|
||||
|
||||
/**
|
||||
* @brief aplay and send audio data
|
||||
* @param AoDevId the number of output device
|
||||
* @param AoChn the number of output channels
|
||||
* @param pstData the address of data that you want to send
|
||||
* @param s32MilliSec -1:block mode/0:non-blocking/s32MilliSec
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_SendFrame(AUDIO_DEV AoDevId, AO_CHN AoChn,
|
||||
const AUDIO_FRAME_S *pstData, CVI_S32 s32MilliSec);
|
||||
|
||||
/**
|
||||
* @brief Start resample
|
||||
* @param AoDevId the number of output device
|
||||
* @param AoDevId the number of output channels
|
||||
* @param enInSampleRate input sample rate
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_EnableReSmp(AUDIO_DEV AoDevId, AO_CHN AoChn,
|
||||
AUDIO_SAMPLE_RATE_E enInSampleRate);
|
||||
/**
|
||||
* @brief Destroy resample
|
||||
* @param AoDevId the number of output device
|
||||
* @param AoChn the number of output channels
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_DisableReSmp(AUDIO_DEV AoDevId, AO_CHN AoChn);
|
||||
/**
|
||||
* @brief Clear channel data
|
||||
* @param AoDevId the number of output device
|
||||
* @param AoChn the number of output channels
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_ClearChnBuf(AUDIO_DEV AoDevId, AO_CHN AoChn);
|
||||
/**
|
||||
* @brief Gets the current status of the AO channel
|
||||
* @param AoDevId the number of output device
|
||||
* @param AoChn the number of output channels
|
||||
* @param pstStatus structure that describes the state of a channel
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_QueryChnStat(AUDIO_DEV AoDevId, AO_CHN AoChn,
|
||||
AO_CHN_STATE_S *pstStatus);
|
||||
/**
|
||||
* @brief Pause send data
|
||||
* @param AoDevId the number of output device
|
||||
* @param AoChn the number of output channels
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_PauseChn(AUDIO_DEV AoDevId, AO_CHN AoChn);
|
||||
/**
|
||||
* @brief Recovery of transmitted data
|
||||
* @param AoDevId the number of output device
|
||||
* @param AoChn the number of output channels
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_ResumeChn(AUDIO_DEV AoDevId, AO_CHN AoChn);
|
||||
/**
|
||||
* @brief Set aplay volume
|
||||
* @param AoDevId the number of output device
|
||||
* @param s32VolumeDb output gain
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_SetVolume(AUDIO_DEV AoDevId, CVI_S32 s32VolumeDb);
|
||||
/**
|
||||
* @brief Get aplay volume
|
||||
* @param AoDevId the number of output device
|
||||
* @param ps32VolumeDb pointer to s32VolumeDb that indicates ao gain
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_GetVolume(AUDIO_DEV AoDevId, CVI_S32 *ps32VolumeDb);
|
||||
/**
|
||||
* @brief Set ao mute
|
||||
* @param AoDevId the number of output device
|
||||
* @param bEnable Select whether to enable mute mode
|
||||
* @param pstFade structure that describes fadein and fadeout
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_SetMute(AUDIO_DEV AoDevId, CVI_BOOL bEnable,
|
||||
const AUDIO_FADE_S *pstFade);
|
||||
/**
|
||||
* @brief Get ao mute status
|
||||
* @param AoDevId the number of output device
|
||||
* @param bEnable Select whether to enable mute mode
|
||||
* @param pstFade structure that describes fadein and fadeout
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_GetMute(AUDIO_DEV AoDevId, CVI_BOOL *pbEnable,
|
||||
AUDIO_FADE_S *pstFade);
|
||||
/**
|
||||
* @brief Set audio output track status
|
||||
* @param AoDevId the number of output device
|
||||
* @param enTrackMode the mode of track
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_SetTrackMode(AUDIO_DEV AoDevId,
|
||||
AUDIO_TRACK_MODE_E enTrackMode);
|
||||
/**
|
||||
* @brief Get audio output track status
|
||||
* @param AoDevId the number of output device
|
||||
* @param penTrackMode the mode of track
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AO_GetTrackMode(AUDIO_DEV AoDevId,
|
||||
AUDIO_TRACK_MODE_E *penTrackMode);
|
||||
|
||||
/* AENC function api. */
|
||||
/**
|
||||
* @brief Enable and create channel to encode
|
||||
* @param AeChn the number of aenc channel
|
||||
* @param pstAttr pointer that describes an aenc property
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AENC_CreateChn(AENC_CHN AeChn, const AENC_CHN_ATTR_S *pstAttr);
|
||||
/**
|
||||
* @brief Destroy aenc channel
|
||||
* @param AeChn the number of aenc channel
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AENC_DestroyChn(AENC_CHN AeChn);
|
||||
/**
|
||||
* @brief Send audio data to channel
|
||||
* @param AeChn the number of aenc channel
|
||||
* @param pstFrm data that you want to send
|
||||
* @param pstAecFrm Reference signal
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AENC_SendFrame(AENC_CHN AeChn, const AUDIO_FRAME_S *pstFrm,
|
||||
const AEC_FRAME_S *pstAecFrm);
|
||||
/**
|
||||
* @brief Encode pcm and get data
|
||||
* @param AeChn the number of aenc channel
|
||||
* @param pstStream data that you get
|
||||
* @param s32MilliSec -1:block mode/0:non-blocking/s32MilliSec
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AENC_GetStream(AENC_CHN AeChn, AUDIO_STREAM_S *pstStream,
|
||||
CVI_S32 s32MilliSec);
|
||||
/**
|
||||
* @brief Release aenc stream
|
||||
* @param AeChn the number of aenc channel
|
||||
* @param pstStream the information obtained by calling CVI_AENC_GetStream
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AENC_ReleaseStream(AENC_CHN AeChn,
|
||||
const AUDIO_STREAM_S *pstStream);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get aenc channel data len and EncInBuff
|
||||
* @param AeChn the number of aenc channel
|
||||
* @param pu64PhysAddr the address of EncInBuff
|
||||
* @param pu32Size data len in aenc channel
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AENC_GetStreamBufInfo(AENC_CHN AeChn, CVI_U64 *pu64PhysAddr,
|
||||
CVI_U32 *pu32Size);
|
||||
|
||||
/**
|
||||
* @brief Registered AAC encoder
|
||||
* Please using api:CVI_MPI_AENC_AacInit instead
|
||||
* @param ps32Handle aenc handle
|
||||
* @param pstEncoder Registered encode api
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AENC_RegisterExternalEncoder(CVI_S32 *ps32Handle, const AAC_AENC_ENCODER_S *pstEncoder);
|
||||
|
||||
/**
|
||||
* @brief Unregistered AAC encoder
|
||||
* Please using api:CVI_MPI_AENC_AacDeInit instead
|
||||
* @param ps32Handle aenc handle
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_AENC_UnRegisterExternalEncoder(CVI_S32 s32Handle);
|
||||
|
||||
/* ADEC function api. */
|
||||
/**
|
||||
* @brief Enable and create channel to decode
|
||||
* @param AdChn the number of adec channel
|
||||
* @param pstAttr pointer that describes an adec property
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_ADEC_CreateChn(ADEC_CHN AdChn, const ADEC_CHN_ATTR_S *pstAttr);
|
||||
/**
|
||||
* @brief Destroy adec channel
|
||||
* @param AdChn the number of adec channel
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_ADEC_DestroyChn(ADEC_CHN AdChn);
|
||||
|
||||
/**
|
||||
* @brief Send audio data to channel
|
||||
* @param AdChn the number of adec channel
|
||||
* @param pstStream data that you want to send
|
||||
* @param bBlock Select whether to block
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_ADEC_SendStream(ADEC_CHN AdChn, const AUDIO_STREAM_S *pstStream,
|
||||
CVI_BOOL bBlock);
|
||||
|
||||
/**
|
||||
* @brief Clear channel data
|
||||
* @param AdChn the number of adec channel
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_ADEC_ClearChnBuf(ADEC_CHN AdChn);
|
||||
|
||||
/**
|
||||
* @brief Registered AAC decoder
|
||||
* Please using api:CVI_MPI_ADEC_AacInit instead
|
||||
* @param ps32Handle adec handle
|
||||
* @param pstDecoder Registered decoder api
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_ADEC_RegisterExternalDecoder(CVI_S32 *ps32Handle,
|
||||
const ADEC_DECODER_S *pstDecoder);
|
||||
/**
|
||||
* @brief Unregistered AAC decoder
|
||||
* Please using api:CVI_MPI_ADEC_AacDeInit instead
|
||||
* @param s32Handle adec handle
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_ADEC_UnRegisterExternalDecoder(CVI_S32 s32Handle);
|
||||
/**
|
||||
* @brief Decode pcm and get data
|
||||
* @param AdChn the number of adec channel
|
||||
* @param pstFrmInfo data that you get
|
||||
* @param bBlock Select whether to block
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_ADEC_GetFrame(ADEC_CHN AdChn, AUDIO_FRAME_INFO_S *pstFrmInfo,
|
||||
CVI_BOOL bBlock);
|
||||
|
||||
/**
|
||||
* @brief Clear channel buffer
|
||||
* @param pstFrmInfo data that you get
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_ADEC_ReleaseFrame(ADEC_CHN AdChn, const AUDIO_FRAME_INFO_S *pstFrmInfo);
|
||||
|
||||
/**
|
||||
* @brief Send end flag to Decoder
|
||||
* @param AdChn the number of adec channel
|
||||
* @param bInstant end flag
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_ADEC_SendEndOfStream(ADEC_CHN AdChn, CVI_BOOL bInstant);
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __CVI_AUDIO_H__ */
|
||||
|
||||
156
middleware/v2/include/cvi_bin.h
Normal file
156
middleware/v2/include/cvi_bin.h
Normal file
@@ -0,0 +1,156 @@
|
||||
#ifndef __CVI_BIN_H__
|
||||
#define __CVI_BIN_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "stdio.h"
|
||||
#include <linux/cvi_type.h>
|
||||
#include <linux/cvi_comm_video.h>
|
||||
|
||||
// ++++++++ If you want to change these interfaces, please contact the isp team. ++++++++
|
||||
#define BIN_FILE_LENGTH 256
|
||||
|
||||
#define CVI_BIN_NULL_POINT 0xCB000001
|
||||
#define CVI_BIN_REG_ATTR_ERR 0xCB000002
|
||||
#define CVI_BIN_MALLOC_ERR 0xCB000003
|
||||
#define CVI_BIN_CHIP_ERR 0xCB000004
|
||||
#define CVI_BIN_CRC_ERR 0xCB000005
|
||||
#define CVI_BIN_SIZE_ERR 0xCB000006 /*size of inputing data is error.*/
|
||||
#define CVI_BIN_LEBLE_ERR 0xCB000007
|
||||
#define CVI_BIN_DATA_ERR 0xCB000008 /*data abnormal*/
|
||||
#define CVI_BIN_SECURITY_SOLUTION_FAILED 0xCB00000A
|
||||
#define CVI_BIN_COMPRESS_ERROR 0xCB00000B /*json compress buffer fail.*/
|
||||
#define CVI_BIN_UNCOMPRESS_ERROR 0xCB00000C /*json uncompress fail.*/
|
||||
#define CVI_BIN_SAPCE_ERR 0xCB00000D /*Input buffer space isn't enough.*/
|
||||
#define CVI_BIN_JSON_ERR 0xCB00000E /*json is inexistence in current bin file.*/
|
||||
#define CVI_BIN_UPDATE_ERROR 0xCB00000F /*Update bin para fail automatically*/
|
||||
#define CVI_BIN_FINDBINFILE_ERROR 0xCB000010 /*can't find bin file*/
|
||||
#define CVI_BIN_NOJSON_ERROR 0xCB000011 /*invalid json in current bin file*/
|
||||
#define CVI_BIN_JSONHANLE_ERROR 0xCB000012 /*creat json handle fail*/
|
||||
#define CVI_BIN_ID_ERROR 0xCB000013 /*invalid id error*/
|
||||
#define CVI_BIN_READ_ERROR 0xCB000014 /*read para from file fail*/
|
||||
#define CVI_BIN_FILE_ERROR 0xCB000015 /*PQbin file is invalid.*/
|
||||
#define CVI_BIN_SENSORNUM_ERROR 0xCB000016 /*Sensor number exceeds specified sensor number in the current bin file.*/
|
||||
|
||||
enum CVI_BIN_SECTION_ID {
|
||||
CVI_BIN_ID_MIN = 0,
|
||||
CVI_BIN_ID_HEADER = CVI_BIN_ID_MIN,
|
||||
CVI_BIN_ID_ISP0,
|
||||
CVI_BIN_ID_ISP1,
|
||||
CVI_BIN_ID_ISP2,
|
||||
CVI_BIN_ID_ISP3,
|
||||
CVI_BIN_ID_VPSS,
|
||||
CVI_BIN_ID_VDEC,
|
||||
CVI_BIN_ID_VENC,
|
||||
CVI_BIN_ID_VO,
|
||||
CVI_BIN_ID_MAX
|
||||
};
|
||||
|
||||
enum CVI_BIN_CREATMODE {
|
||||
CVI_BIN_AUTO = 0,
|
||||
CVI_BIN_MANUAL,
|
||||
CVI_BIN_MODE_MAX
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
CVI_UCHAR Author[32];
|
||||
CVI_UCHAR Desc[1024];
|
||||
CVI_UCHAR Time[32];
|
||||
} CVI_BIN_EXTRA_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_U32 u32InitSize;
|
||||
CVI_U32 u32CompreSize;
|
||||
} CVI_JSON_INFO;
|
||||
|
||||
typedef struct _CVI_JSON_HEADER {
|
||||
CVI_JSON_INFO size[CVI_BIN_ID_MAX];
|
||||
} CVI_JSON_HEADER;
|
||||
|
||||
typedef struct _CVI_BIN_HEADER {
|
||||
CVI_U32 chipId;
|
||||
CVI_BIN_EXTRA_S extraInfo;
|
||||
CVI_U32 size[CVI_BIN_ID_MAX];
|
||||
} CVI_BIN_HEADER;
|
||||
|
||||
CVI_S32 CVI_BIN_GetBinExtraAttr(FILE *fp, CVI_BIN_EXTRA_S *extraInfo);
|
||||
CVI_S32 CVI_BIN_SaveParamToBin(FILE *fp, CVI_BIN_EXTRA_S *extraInfo);
|
||||
CVI_S32 CVI_BIN_LoadParamFromBin(enum CVI_BIN_SECTION_ID id, CVI_U8 *buf);
|
||||
CVI_S32 CVI_BIN_SetBinName(WDR_MODE_E wdrMode, const CVI_CHAR *binName);
|
||||
CVI_S32 CVI_BIN_GetBinName(CVI_CHAR *binName);
|
||||
|
||||
/* CVI_BIN_LoadParamFromBinEx:
|
||||
* get bin data from buffer
|
||||
*
|
||||
* [in] buf: input buf
|
||||
* u32DataLength:length of bin data
|
||||
* [Out]void
|
||||
* return: please refer to CVI_BIN_ImportBinData
|
||||
*/
|
||||
CVI_S32 CVI_BIN_LoadParamFromBinEx(enum CVI_BIN_SECTION_ID id, CVI_U8 *buf, CVI_U32 u32DataLength);
|
||||
/* CVI_BIN_GetBinTotalLen:
|
||||
* Get length of bin data
|
||||
*
|
||||
* [in]void
|
||||
* [Out]void
|
||||
* return: length of bin data
|
||||
*/
|
||||
CVI_U32 CVI_BIN_GetBinTotalLen(void);
|
||||
/* CVI_BIN_ExportBinData:
|
||||
* get bin data from buffer
|
||||
*
|
||||
* [in] pu8Buffer:save bin data
|
||||
* u32DataLength:length of bin data
|
||||
* [Out]void.
|
||||
* return: 0: Success;
|
||||
* error codes:
|
||||
* 0xCB000001:input pointer is null.
|
||||
* 0xCB000003: malloc fail.
|
||||
* 0xCB000008: data error.
|
||||
* 0xCB00000A: security solution fail.
|
||||
* 0xCB00000B: json compress fail.
|
||||
* 0xCB00000D: Input buffer space isn't enough.
|
||||
* 0xCB000012: creat json handle fail.
|
||||
* 0xCB000013: invalid id error.
|
||||
*/
|
||||
CVI_S32 CVI_BIN_ExportBinData(CVI_U8 *pu8Buffer, CVI_U32 u32DataLength);
|
||||
/* CVI_BIN_ImportBinData:
|
||||
* set bin data from buffer
|
||||
*
|
||||
* [in] pu8Buffer:save bin data
|
||||
* u32DataLength:length of bin data
|
||||
* [Out]void
|
||||
* return: 0: Success;
|
||||
* error codes:
|
||||
* 0xCB000001: input pointer is null.
|
||||
* 0xCB000003: malloc fail.
|
||||
* 0xCB000006: size of inputing data is error.
|
||||
* 0xCB000008: data error.
|
||||
* 0xCB00000C: json uncompress fail.
|
||||
* 0xCB00000E: json inexistence fail.
|
||||
* 0xCB00000F: update bin para from json fail automatically.
|
||||
* 0xCB000010: can't find bin file.
|
||||
* 0xCB000011: invalid json in current bin file.
|
||||
* 0xCB000012: creat json handle fail.
|
||||
* 0xCB000013: invalid id error.
|
||||
* 0xCB000014: read para from file fail.
|
||||
* 0xCB000015: current PQbin file is invalid.
|
||||
* 0xCB000016: Sensor number exceeds specified sensor number in bin file.
|
||||
*/
|
||||
CVI_S32 CVI_BIN_ImportBinData(CVI_U8 *pu8Buffer, CVI_U32 u32DataLength);
|
||||
// -------- If you want to change these interfaces, please contact the isp team. --------
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
334
middleware/v2/include/cvi_buffer.h
Normal file
334
middleware/v2/include/cvi_buffer.h
Normal file
@@ -0,0 +1,334 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_buffer.h
|
||||
* Description:
|
||||
* The count defination of buffer size
|
||||
*/
|
||||
|
||||
#ifndef __CVI_BUFFER_H__
|
||||
#define __CVI_BUFFER_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <linux/cvi_math.h>
|
||||
#include <linux/cvi_type.h>
|
||||
#include <linux/cvi_common.h>
|
||||
#include <linux/cvi_comm_video.h>
|
||||
|
||||
#ifndef UNUSED
|
||||
#define UNUSED(x) ((void)(x))
|
||||
#endif
|
||||
|
||||
#define CV183X_WA_FMT(x) (((x) == PIXEL_FORMAT_YUV_PLANAR_420) || ((x) == PIXEL_FORMAT_YUV_PLANAR_422) || \
|
||||
((x) == PIXEL_FORMAT_YUV_PLANAR_444) || ((x) == PIXEL_FORMAT_RGB_888_PLANAR) || \
|
||||
((x) == PIXEL_FORMAT_BGR_888_PLANAR) || ((x) == PIXEL_FORMAT_HSV_888_PLANAR))
|
||||
|
||||
static inline CVI_VOID COMMON_GetPicBufferConfig(CVI_U32 u32Width, CVI_U32 u32Height,
|
||||
PIXEL_FORMAT_E enPixelFormat, DATA_BITWIDTH_E enBitWidth,
|
||||
COMPRESS_MODE_E enCmpMode, CVI_U32 u32Align, VB_CAL_CONFIG_S *pstCalConfig)
|
||||
{
|
||||
CVI_U8 u8BitWidth = 0;
|
||||
CVI_U32 u32VBSize = 0;
|
||||
CVI_U32 u32AlignHeight = 0;
|
||||
CVI_U32 u32MainStride = 0;
|
||||
CVI_U32 u32CStride = 0;
|
||||
CVI_U32 u32MainSize = 0;
|
||||
CVI_U32 u32YSize = 0;
|
||||
CVI_U32 u32CSize = 0;
|
||||
|
||||
/* u32Align: 0 is automatic mode, alignment size following system. Non-0 for specified alignment size */
|
||||
if (u32Align == 0)
|
||||
u32Align = DEFAULT_ALIGN;
|
||||
else if (u32Align > MAX_ALIGN)
|
||||
u32Align = MAX_ALIGN;
|
||||
else
|
||||
u32Align = (ALIGN(u32Align, DEFAULT_ALIGN));
|
||||
|
||||
switch (enBitWidth) {
|
||||
case DATA_BITWIDTH_8: {
|
||||
u8BitWidth = 8;
|
||||
break;
|
||||
}
|
||||
case DATA_BITWIDTH_10: {
|
||||
u8BitWidth = 10;
|
||||
break;
|
||||
}
|
||||
case DATA_BITWIDTH_12: {
|
||||
u8BitWidth = 12;
|
||||
break;
|
||||
}
|
||||
case DATA_BITWIDTH_14: {
|
||||
u8BitWidth = 14;
|
||||
break;
|
||||
}
|
||||
case DATA_BITWIDTH_16: {
|
||||
u8BitWidth = 16;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
u8BitWidth = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((enPixelFormat == PIXEL_FORMAT_YUV_PLANAR_420)
|
||||
|| (enPixelFormat == PIXEL_FORMAT_NV12)
|
||||
|| (enPixelFormat == PIXEL_FORMAT_NV21)) {
|
||||
u32AlignHeight = ALIGN(u32Height, 2);
|
||||
} else
|
||||
u32AlignHeight = u32Height;
|
||||
|
||||
if (enCmpMode == COMPRESS_MODE_NONE) {
|
||||
u32MainStride = ALIGN((u32Width * u8BitWidth + 7) >> 3, u32Align);
|
||||
u32YSize = u32MainStride * u32AlignHeight;
|
||||
|
||||
if (enPixelFormat == PIXEL_FORMAT_YUV_PLANAR_420) {
|
||||
u32CStride = ALIGN(((u32Width >> 1) * u8BitWidth + 7) >> 3, u32Align);
|
||||
u32CSize = (u32CStride * u32AlignHeight) >> 1;
|
||||
|
||||
u32MainStride = u32CStride * 2;
|
||||
u32YSize = u32MainStride * u32AlignHeight;
|
||||
u32MainSize = u32YSize + (u32CSize << 1);
|
||||
pstCalConfig->plane_num = 3;
|
||||
} else if (enPixelFormat == PIXEL_FORMAT_YUV_PLANAR_422) {
|
||||
u32CStride = ALIGN(((u32Width >> 1) * u8BitWidth + 7) >> 3, u32Align);
|
||||
u32CSize = u32CStride * u32AlignHeight;
|
||||
|
||||
u32MainSize = u32YSize + (u32CSize << 1);
|
||||
pstCalConfig->plane_num = 3;
|
||||
} else if (enPixelFormat == PIXEL_FORMAT_RGB_888_PLANAR ||
|
||||
enPixelFormat == PIXEL_FORMAT_BGR_888_PLANAR ||
|
||||
enPixelFormat == PIXEL_FORMAT_HSV_888_PLANAR ||
|
||||
enPixelFormat == PIXEL_FORMAT_YUV_PLANAR_444) {
|
||||
u32CStride = u32MainStride;
|
||||
u32CSize = u32YSize;
|
||||
|
||||
u32MainSize = u32YSize + (u32CSize << 1);
|
||||
pstCalConfig->plane_num = 3;
|
||||
} else if (enPixelFormat == PIXEL_FORMAT_RGB_BAYER_12BPP) {
|
||||
u32MainSize = u32YSize;
|
||||
pstCalConfig->plane_num = 1;
|
||||
} else if (enPixelFormat == PIXEL_FORMAT_YUV_400) {
|
||||
u32MainSize = u32YSize;
|
||||
pstCalConfig->plane_num = 1;
|
||||
} else if (enPixelFormat == PIXEL_FORMAT_NV12 || enPixelFormat == PIXEL_FORMAT_NV21) {
|
||||
u32CStride = ALIGN((u32Width * u8BitWidth + 7) >> 3, u32Align);
|
||||
u32CSize = (u32CStride * u32AlignHeight) >> 1;
|
||||
|
||||
u32MainSize = u32YSize + u32CSize;
|
||||
pstCalConfig->plane_num = 2;
|
||||
} else if (enPixelFormat == PIXEL_FORMAT_NV16 || enPixelFormat == PIXEL_FORMAT_NV61) {
|
||||
u32CStride = ALIGN((u32Width * u8BitWidth + 7) >> 3, u32Align);
|
||||
u32CSize = u32CStride * u32AlignHeight;
|
||||
|
||||
u32MainSize = u32YSize + u32CSize;
|
||||
pstCalConfig->plane_num = 2;
|
||||
} else if (enPixelFormat == PIXEL_FORMAT_YUYV || enPixelFormat == PIXEL_FORMAT_YVYU ||
|
||||
enPixelFormat == PIXEL_FORMAT_UYVY || enPixelFormat == PIXEL_FORMAT_VYUY) {
|
||||
u32MainStride = ALIGN(((u32Width * u8BitWidth + 7) >> 3) * 2, u32Align);
|
||||
u32YSize = u32MainStride * u32AlignHeight;
|
||||
u32MainSize = u32YSize;
|
||||
pstCalConfig->plane_num = 1;
|
||||
} else if (enPixelFormat == PIXEL_FORMAT_ARGB_1555 || enPixelFormat == PIXEL_FORMAT_ARGB_4444) {
|
||||
// packed format
|
||||
u32MainStride = ALIGN((u32Width * 16 + 7) >> 3, u32Align);
|
||||
u32YSize = u32MainStride * u32AlignHeight;
|
||||
u32MainSize = u32YSize;
|
||||
pstCalConfig->plane_num = 1;
|
||||
} else if (enPixelFormat == PIXEL_FORMAT_ARGB_8888) {
|
||||
// packed format
|
||||
u32MainStride = ALIGN((u32Width * 32 + 7) >> 3, u32Align);
|
||||
u32YSize = u32MainStride * u32AlignHeight;
|
||||
u32MainSize = u32YSize;
|
||||
pstCalConfig->plane_num = 1;
|
||||
} else {
|
||||
// packed format
|
||||
u32MainStride = ALIGN(((u32Width * u8BitWidth + 7) >> 3) * 3, u32Align);
|
||||
u32YSize = u32MainStride * u32AlignHeight;
|
||||
u32MainSize = u32YSize;
|
||||
pstCalConfig->plane_num = 1;
|
||||
}
|
||||
|
||||
u32VBSize = u32MainSize;
|
||||
} else {
|
||||
// TODO: compression mode
|
||||
pstCalConfig->plane_num = 0;
|
||||
}
|
||||
|
||||
pstCalConfig->u32VBSize = u32VBSize;
|
||||
pstCalConfig->u32MainStride = u32MainStride;
|
||||
pstCalConfig->u32CStride = u32CStride;
|
||||
pstCalConfig->u32MainYSize = u32YSize;
|
||||
pstCalConfig->u32MainCSize = u32CSize;
|
||||
pstCalConfig->u32MainSize = u32MainSize;
|
||||
pstCalConfig->u16AddrAlign = u32Align;
|
||||
}
|
||||
|
||||
static inline CVI_U32 COMMON_GetPicBufferSize(CVI_U32 u32Width, CVI_U32 u32Height, PIXEL_FORMAT_E enPixelFormat,
|
||||
DATA_BITWIDTH_E enBitWidth, COMPRESS_MODE_E enCmpMode, CVI_U32 u32Align)
|
||||
{
|
||||
VB_CAL_CONFIG_S stCalConfig;
|
||||
|
||||
COMMON_GetPicBufferConfig(u32Width, u32Height, enPixelFormat, enBitWidth, enCmpMode, u32Align, &stCalConfig);
|
||||
|
||||
return stCalConfig.u32VBSize;
|
||||
}
|
||||
|
||||
|
||||
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
|
||||
|
||||
static inline CVI_U32 COMMON_GetVencFrameBufferSize(CVI_S32 s32Codec, CVI_U32 u32Width, CVI_U32 u32Height)
|
||||
{
|
||||
CVI_U32 u32RetSize = 0;
|
||||
|
||||
if (s32Codec == PT_H264) {
|
||||
CVI_U32 u32WidthAlign = (ALIGN(u32Width, DEFAULT_ALIGN));
|
||||
CVI_U32 u32HeightAlign = (ALIGN(u32Width, DEFAULT_ALIGN));
|
||||
|
||||
u32RetSize = (u32WidthAlign * u32HeightAlign * 2 * 3) / 2;
|
||||
} else if (s32Codec == PT_H265) {
|
||||
u32RetSize = ((u32Width * u32Height * 3) / 2);
|
||||
u32RetSize = ROUND_UP(u32RetSize, 4096) * 2;
|
||||
} else
|
||||
u32RetSize = 0;
|
||||
|
||||
return u32RetSize;
|
||||
}
|
||||
static inline CVI_U32 VI_GetRawBufferSize(CVI_U32 u32Width, CVI_U32 u32Height, PIXEL_FORMAT_E enPixelFormat,
|
||||
COMPRESS_MODE_E enCmpMode, CVI_U32 u32Align, CVI_BOOL isTile)
|
||||
{
|
||||
CVI_U32 u32BitWidth;
|
||||
CVI_U32 u32Size = 0;
|
||||
CVI_U32 u32Stride = 0;
|
||||
|
||||
/* u32Align: 0 is automatic mode, alignment size following system. Non-0 for specified alignment size */
|
||||
if (u32Align == 0)
|
||||
u32Align = DEFAULT_ALIGN;
|
||||
else if (u32Align > MAX_ALIGN)
|
||||
u32Align = MAX_ALIGN;
|
||||
else
|
||||
u32Align = (ALIGN(u32Align, DEFAULT_ALIGN));
|
||||
|
||||
switch (enPixelFormat) {
|
||||
case PIXEL_FORMAT_RGB_BAYER_8BPP: {
|
||||
u32BitWidth = 8;
|
||||
break;
|
||||
}
|
||||
|
||||
case PIXEL_FORMAT_RGB_BAYER_10BPP: {
|
||||
u32BitWidth = 10;
|
||||
break;
|
||||
}
|
||||
|
||||
case PIXEL_FORMAT_RGB_BAYER_12BPP: {
|
||||
u32BitWidth = 12;
|
||||
break;
|
||||
}
|
||||
|
||||
case PIXEL_FORMAT_RGB_BAYER_14BPP: {
|
||||
u32BitWidth = 14;
|
||||
break;
|
||||
}
|
||||
|
||||
case PIXEL_FORMAT_RGB_BAYER_16BPP: {
|
||||
u32BitWidth = 16;
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
u32BitWidth = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (enCmpMode == COMPRESS_MODE_NONE) {
|
||||
u32Stride = ALIGN(ALIGN(u32Width * u32BitWidth, 8) / 8, u32Align);
|
||||
u32Size = u32Stride * u32Height;
|
||||
} else if (enCmpMode == COMPRESS_MODE_TILE || enCmpMode == COMPRESS_MODE_FRAME) {
|
||||
u32Width = (isTile) ? ((u32Width + 8) >> 1) : (u32Width >> 1);
|
||||
u32Width = 3 * ((u32Width + 1) >> 1);
|
||||
|
||||
u32Stride = ALIGN(u32Width, 16);
|
||||
u32Size = u32Stride * u32Height;
|
||||
}
|
||||
|
||||
return u32Size;
|
||||
}
|
||||
|
||||
static inline CVI_VOID VDEC_GetPicBufferConfig(PAYLOAD_TYPE_E enType,
|
||||
CVI_U32 u32Width, CVI_U32 u32Height,
|
||||
PIXEL_FORMAT_E enPixelFormat, DATA_BITWIDTH_E enBitWidth,
|
||||
COMPRESS_MODE_E enCmpMode, VB_CAL_CONFIG_S *pstVbCfg)
|
||||
{
|
||||
CVI_U32 u32AlignWidth = 0, u32AlignHeight = 0, u32Align = 0;
|
||||
|
||||
if (enType == PT_H264) {
|
||||
u32AlignWidth = ALIGN(u32Width, H264D_ALIGN_W);
|
||||
u32AlignHeight = ALIGN(u32Height, H264D_ALIGN_H);
|
||||
u32Align = H264D_ALIGN_W;
|
||||
} else if (enType == PT_H265) {
|
||||
u32AlignWidth = ALIGN(u32Width, H265D_ALIGN_W);
|
||||
u32AlignHeight = ALIGN(u32Height, H265D_ALIGN_H);
|
||||
u32Align = H265D_ALIGN_W;
|
||||
} else if ((enType == PT_JPEG) || (enType == PT_MJPEG)) {
|
||||
u32AlignWidth = ALIGN(u32Width, JPEGD_ALIGN_W);
|
||||
u32AlignHeight = ALIGN(u32Height, JPEGD_ALIGN_H);
|
||||
u32Align = JPEGD_ALIGN_W;
|
||||
} else {
|
||||
u32AlignWidth = ALIGN(u32Width, DEFAULT_ALIGN);
|
||||
u32AlignHeight = ALIGN(u32Height, DEFAULT_ALIGN);
|
||||
u32Align = DEFAULT_ALIGN;
|
||||
}
|
||||
|
||||
COMMON_GetPicBufferConfig(u32AlignWidth, u32AlignHeight, enPixelFormat,
|
||||
enBitWidth, enCmpMode, u32Align, pstVbCfg);
|
||||
}
|
||||
|
||||
static inline CVI_U32 VDEC_GetPicBufferSize(PAYLOAD_TYPE_E enType,
|
||||
CVI_U32 u32Width, CVI_U32 u32Height,
|
||||
PIXEL_FORMAT_E enPixelFormat, DATA_BITWIDTH_E enBitWidth,
|
||||
COMPRESS_MODE_E enCmpMode)
|
||||
{
|
||||
VB_CAL_CONFIG_S stVbCfg;
|
||||
|
||||
memset(&stVbCfg, 0, sizeof(stVbCfg));
|
||||
VDEC_GetPicBufferConfig(enType, u32Width, u32Height, enPixelFormat, enBitWidth, enCmpMode, &stVbCfg);
|
||||
return stVbCfg.u32VBSize;
|
||||
}
|
||||
|
||||
static inline CVI_VOID VENC_GetPicBufferConfig(CVI_U32 u32Width, CVI_U32 u32Height,
|
||||
PIXEL_FORMAT_E enPixelFormat, DATA_BITWIDTH_E enBitWidth, COMPRESS_MODE_E enCmpMode,
|
||||
VB_CAL_CONFIG_S *pstVbCfg)
|
||||
{
|
||||
CVI_U32 u32AlignWidth = ALIGN(u32Width, VENC_ALIGN_W);
|
||||
CVI_U32 u32AlignHeight = ALIGN(u32Height, VENC_ALIGN_H);
|
||||
CVI_U32 u32Align = VENC_ALIGN_W;
|
||||
|
||||
COMMON_GetPicBufferConfig(u32AlignWidth, u32AlignHeight, enPixelFormat,
|
||||
enBitWidth, enCmpMode, u32Align, pstVbCfg);
|
||||
}
|
||||
|
||||
static inline CVI_U32 VENC_GetPicBufferSize(CVI_U32 u32Width, CVI_U32 u32Height,
|
||||
PIXEL_FORMAT_E enPixelFormat, DATA_BITWIDTH_E enBitWidth, COMPRESS_MODE_E enCmpMode)
|
||||
{
|
||||
VB_CAL_CONFIG_S stVbCfg;
|
||||
|
||||
memset(&stVbCfg, 0, sizeof(stVbCfg));
|
||||
VENC_GetPicBufferConfig(u32Width, u32Height, enPixelFormat, enBitWidth, enCmpMode, &stVbCfg);
|
||||
return stVbCfg.u32VBSize;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __CVI_BUFFER_H__ */
|
||||
132
middleware/v2/include/cvi_comm_adec.h
Normal file
132
middleware/v2/include/cvi_comm_adec.h
Normal file
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_comm_adec.h
|
||||
* Description: basic audio decoder api for application layer
|
||||
*/
|
||||
|
||||
#ifndef __CVI_COMM_ADEC_H__
|
||||
#define __CVI_COMM_ADEC_H__
|
||||
|
||||
|
||||
#include <linux/cvi_type.h>
|
||||
#include <linux/cvi_common.h>
|
||||
#include "cvi_comm_aio.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
typedef struct _ADEC_ATTR_G711_S {
|
||||
CVI_U32 resv;
|
||||
} ADEC_ATTR_G711_S;
|
||||
|
||||
typedef struct _ADEC_ATTR_G726_S {
|
||||
G726_BPS_E enG726bps;
|
||||
} ADEC_ATTR_G726_S;
|
||||
|
||||
typedef struct _ADEC_ATTR_ADPCM_S {
|
||||
ADPCM_TYPE_E enADPCMType;
|
||||
} ADEC_ATTR_ADPCM_S;
|
||||
|
||||
typedef struct _ADEC_ATTR_LPCM_S {
|
||||
CVI_U32 resv;
|
||||
} ADEC_ATTR_LPCM_S;
|
||||
|
||||
typedef enum _ADEC_MODE_E {
|
||||
ADEC_MODE_PACK = 0,
|
||||
/*require input is valid dec pack(a */
|
||||
/*complete frame encode result),*/
|
||||
/*e.g.the stream get from AENC is a*/
|
||||
/*valid dec pack, the stream know actually*/
|
||||
/*pack len from file is also a dec pack.*/
|
||||
/*this mode is high-performative*/
|
||||
ADEC_MODE_STREAM,
|
||||
/*input is stream,low-performative, */
|
||||
/*if you couldn't find out whether a stream is*/
|
||||
/*valid dec pack,you could use*/
|
||||
/*this mode*/
|
||||
ADEC_MODE_BUTT
|
||||
} ADEC_MODE_E;
|
||||
|
||||
typedef struct _ADEC_CH_ATTR_S {
|
||||
PAYLOAD_TYPE_E enType;
|
||||
CVI_U32 u32BufSize; /*buf size[2~CVI_MAX_AUDIO_FRAME_NUM]*/
|
||||
ADEC_MODE_E enMode;/*decode mode*/
|
||||
/* CVI_VOID ATTRIBUTE *pValue;*/
|
||||
CVI_VOID *pValue;
|
||||
CVI_BOOL bFileDbgMode;
|
||||
//------user should update these information if
|
||||
//ao not enable
|
||||
CVI_S32 s32BytesPerSample;
|
||||
CVI_S32 s32frame_size; //in samples
|
||||
CVI_S32 s32ChannelNums; // 1 or 2
|
||||
CVI_S32 s32Sample_rate;
|
||||
} ADEC_CHN_ATTR_S;
|
||||
|
||||
typedef struct _ADEC_CHN_STATE_S {
|
||||
CVI_BOOL bEndOfStream; /* EOS flag */
|
||||
CVI_U32 u32BufferFrmNum; /* total number of channel buffer */
|
||||
CVI_U32 u32BufferFreeNum; /* free number of channel buffer */
|
||||
CVI_U32 u32BufferBusyNum; /* busy number of channel buffer */
|
||||
} ADEC_CHN_STATE_S;
|
||||
|
||||
typedef struct _ADEC_DECODER_S {
|
||||
PAYLOAD_TYPE_E enType;
|
||||
CVI_CHAR aszName[17];
|
||||
|
||||
CVI_S32 (*pfnOpenDecoder)(CVI_VOID *pDecoderAttr, CVI_VOID **ppDecoder);
|
||||
CVI_S32 (*pfnDecodeFrm)(CVI_VOID *pDecoder, CVI_U8 **pu8Inbuf,
|
||||
CVI_S32 *ps32LeftByte,
|
||||
CVI_U16 *pu16Outbuf, CVI_U32 *pu32OutLen, CVI_U32 *pu32Chns);
|
||||
CVI_S32 (*pfnGetFrmInfo)(CVI_VOID *pDecoder, CVI_VOID *pInfo);
|
||||
CVI_S32 (*pfnCloseDecoder)(CVI_VOID *pDecoder);
|
||||
CVI_S32 (*pfnResetDecoder)(CVI_VOID *pDecoder);
|
||||
} ADEC_DECODER_S;
|
||||
|
||||
/* invalid device ID */
|
||||
#define CVI_ERR_ADEC_INVALID_DEVID 0xA3000001
|
||||
/* invalid channel ID */
|
||||
#define CVI_ERR_ADEC_INVALID_CHNID 0xA3000002
|
||||
/* at least one parameter is illegal ,eg, an illegal enumeration value */
|
||||
#define CVI_ERR_ADEC_ILLEGAL_PARAM 0xA3000003
|
||||
/* channel exists */
|
||||
#define CVI_ERR_ADEC_EXIST 0xA3000004
|
||||
/* channel unexists */
|
||||
#define CVI_ERR_ADEC_UNEXIST 0xA3000005
|
||||
/* using a NULL point */
|
||||
#define CVI_ERR_ADEC_NULL_PTR 0xA3000006
|
||||
/* try to enable or initialize system,device or channel, before configing attribute */
|
||||
#define CVI_ERR_ADEC_NOT_CONFIG 0xA3000007
|
||||
/* operation is not supported by NOW */
|
||||
#define CVI_ERR_ADEC_NOT_SUPPORT 0xA3000008
|
||||
/* operation is not permitted ,eg, try to change stati attribute */
|
||||
#define CVI_ERR_ADEC_NOT_PERM 0xA3000009
|
||||
/* failure caused by malloc memory */
|
||||
#define CVI_ERR_ADEC_NOMEM 0xA300000A
|
||||
/* failure caused by malloc buffer */
|
||||
#define CVI_ERR_ADEC_NOBUF 0xA300000B
|
||||
/* no data in buffer */
|
||||
#define CVI_ERR_ADEC_BUF_EMPTY 0xA300000C
|
||||
/* no buffer for new data */
|
||||
#define CVI_ERR_ADEC_BUF_FULL 0xA300000D
|
||||
/* system is not ready,had not initialized or loaded*/
|
||||
#define CVI_ERR_ADEC_SYS_NOTREADY 0xA300000E
|
||||
/* decoder internal err */
|
||||
#define CVI_ERR_ADEC_DECODER_ERR 0xA300000F
|
||||
/* input buffer not enough to decode one frame */
|
||||
#define CVI_ERR_ADEC_BUF_LACK 0xA3000010
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif/* End of #ifndef __CVI_COMM_ADEC_H__*/
|
||||
|
||||
112
middleware/v2/include/cvi_comm_aenc.h
Normal file
112
middleware/v2/include/cvi_comm_aenc.h
Normal file
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_comm_aenc.h
|
||||
* Description: basic audio audio
|
||||
* encoder api for application layer
|
||||
*/
|
||||
#ifndef __CVI_COMM_AENC_H__
|
||||
#define __CVI_COMM_AENC_H__
|
||||
|
||||
#include <linux/cvi_type.h>
|
||||
#include <linux/cvi_common.h>
|
||||
#include "cvi_comm_aio.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
typedef struct _AENC_ATTR_G711_S {
|
||||
CVI_U32 resv; /*reserve item*/
|
||||
} AENC_ATTR_G711_S;
|
||||
|
||||
typedef struct _AENC_ATTR_G726_S {
|
||||
G726_BPS_E enG726bps;
|
||||
} AENC_ATTR_G726_S;
|
||||
|
||||
typedef struct _AENC_ATTR_ADPCM_S {
|
||||
ADPCM_TYPE_E enADPCMType;
|
||||
} AENC_ATTR_ADPCM_S;
|
||||
|
||||
typedef struct _AENC_ATTR_LPCM_S {
|
||||
CVI_U32 resv; /*reserve item*/
|
||||
} AENC_ATTR_LPCM_S;
|
||||
|
||||
typedef struct _AAC_AENC_ENCODER_S {
|
||||
PAYLOAD_TYPE_E enType;
|
||||
CVI_U32 u32MaxFrmLen;
|
||||
CVI_CHAR aszName[17];
|
||||
/* encoder type,be used to print proc information */
|
||||
CVI_S32 (*pfnOpenEncoder)(CVI_VOID *pEncoderAttr, CVI_VOID **ppEncoder);
|
||||
/* pEncoder is the handle to control the encoder */
|
||||
#if 0
|
||||
CVI_S32 (*pfnEncodeFrm)(CVI_VOID *pEncoder, const AUDIO_FRAME_S *pstData,
|
||||
CVI_U8 *pu8Outbuf, CVI_U32 *pu32OutLen);
|
||||
#endif
|
||||
CVI_S32 (*pfnEncodeFrm)(CVI_VOID *pEncoder, CVI_S16 * inputdata, CVI_U8 * pu8Outbuf,
|
||||
CVI_S32 s32InputSizeBytes, CVI_U32 *pu32OutLen);
|
||||
CVI_S32 (*pfnCloseEncoder)(CVI_VOID *pEncoder);
|
||||
} AAC_AENC_ENCODER_S;
|
||||
|
||||
typedef struct _AENC_CHN_ATTR_S {
|
||||
PAYLOAD_TYPE_E enType; /*payload type ()*/
|
||||
CVI_U32 u32PtNumPerFrm;
|
||||
CVI_U32 u32BufSize; /*buf size [2~CVI_MAX_AUDIO_FRAME_NUM]*/
|
||||
/* CVI_VOID ATTRIBUTE *pValue; point to attribute of definite audio encoder*/
|
||||
CVI_VOID *pValue;
|
||||
CVI_BOOL bFileDbgMode;
|
||||
} AENC_CHN_ATTR_S;
|
||||
|
||||
typedef enum _EN_AENC_ERR_CODE_E {
|
||||
AENC_ERR_ENCODER_ERR = 64,
|
||||
AENC_ERR_VQE_ERR = 65,
|
||||
|
||||
} EN_AENC_ERR_CODE_E;
|
||||
|
||||
|
||||
/* invalid device ID */
|
||||
#define CVI_ERR_AENC_INVALID_DEVID 0xA2000001
|
||||
/* invalid channel ID */
|
||||
#define CVI_ERR_AENC_INVALID_CHNID 0xA2000002
|
||||
/* at least one parameter is illegal ,eg, an illegal enumeration value */
|
||||
#define CVI_ERR_AENC_ILLEGAL_PARAM 0xA2000003
|
||||
/* channel exists */
|
||||
#define CVI_ERR_AENC_EXIST 0xA2000004
|
||||
/* channel unexists */
|
||||
#define CVI_ERR_AENC_UNEXIST 0xA2000005
|
||||
/* using a NULL point */
|
||||
#define CVI_ERR_AENC_NULL_PTR 0xA2000006
|
||||
/* try to enable or initialize system,device or channel, before configing attribute */
|
||||
#define CVI_ERR_AENC_NOT_CONFIG 0xA2000007
|
||||
/* operation is not supported by NOW */
|
||||
#define CVI_ERR_AENC_NOT_SUPPORT 0xA2000008
|
||||
/* operation is not permitted ,eg, try to change static attribute */
|
||||
#define CVI_ERR_AENC_NOT_PERM 0xA2000009
|
||||
/* failure caused by malloc memory */
|
||||
#define CVI_ERR_AENC_NOMEM 0xA200000A
|
||||
/* failure caused by malloc buffer */
|
||||
#define CVI_ERR_AENC_NOBUF 0xA200000B
|
||||
/* no data in buffer */
|
||||
#define CVI_ERR_AENC_BUF_EMPTY 0xA200000C
|
||||
/* no buffer for new data */
|
||||
#define CVI_ERR_AENC_BUF_FULL 0xA200000D
|
||||
/* system is not ready,had not initialized or loaded*/
|
||||
#define CVI_ERR_AENC_SYS_NOTREADY 0xA200000E
|
||||
/* encoder internal err */
|
||||
#define CVI_ERR_AENC_ENCODER_ERR 0xA200000F
|
||||
/* vqe internal err */
|
||||
#define CVI_ERR_AENC_VQE_ERR 0xA2000010
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif/* End of #ifndef __CVI_COMM_AENC_H__*/
|
||||
|
||||
580
middleware/v2/include/cvi_comm_aio.h
Normal file
580
middleware/v2/include/cvi_comm_aio.h
Normal file
@@ -0,0 +1,580 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_comm_aio.h
|
||||
* Description: basic audio in out definition
|
||||
*/
|
||||
|
||||
#ifndef __CVI_COMM_AIO_H__
|
||||
#define __CVI_COMM_AIO_H__
|
||||
|
||||
#include <linux/cvi_common.h>
|
||||
#include <linux/cvi_errno.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
|
||||
#define CVI_MAX_AUDIO_FRAME_NUM 300 /*max count of audio frame in Buffer */
|
||||
#define CVI_AUD_MAX_VOICE_POINT_NUM 1280 /*max sample per frame for voice encode */
|
||||
#define CVI_AUD_MAX_AUDIO_POINT_NUM 2048 /*max sample per frame for all encoder(aacplus:2048)*/
|
||||
#define CVI_AUD_MAX_CHANNEL_NUM 3
|
||||
#define CVI_MAX_AUDIO_STREAM_LEN (4 * 4096)
|
||||
|
||||
|
||||
|
||||
#define MAX_AUDIO_FILE_PATH_LEN 256
|
||||
#define MAX_AUDIO_FILE_NAME_LEN 256
|
||||
#define MAX_AUDIO_VQE_CUSTOMIZE_NAME 64
|
||||
|
||||
/*The VQE EQ Band num.*/
|
||||
#define VQE_EQ_BAND_NUM 10
|
||||
|
||||
#define AI_RECORDVQE_MASK_HPF 0x1
|
||||
#define AI_RECORDVQE_MASK_RNR 0x2
|
||||
#define AI_RECORDVQE_MASK_HDR 0x4
|
||||
#define AI_RECORDVQE_MASK_DRC 0x8
|
||||
#define AI_RECORDVQE_MASK_EQ 0x10
|
||||
#define AI_RECORDVQE_MASK_AGC 0x20
|
||||
|
||||
|
||||
//#define AI_TALKVQE_MASK_HPF 0x1//not support
|
||||
#define AI_TALKVQE_MASK_AEC 0x3
|
||||
#define AI_TALKVQE_MASK_ANR 0x4
|
||||
#define AI_TALKVQE_MASK_AGC 0x8
|
||||
#define AI_TALKVQE_MASK_NOTCH_FILTER 0x30
|
||||
//#define AI_TALKVQE_MASK_EQ 0x10//not supoort
|
||||
#define NEXT_SSP_ALGO 1
|
||||
|
||||
|
||||
/* LP AEC Control */
|
||||
#define LP_AEC_ENABLE 0x1 /* bit 0 */
|
||||
/* NLP AES Control */
|
||||
#define NLP_AES_ENABLE 0x2 /* bit 1 */
|
||||
/* NR Control */
|
||||
#define NR_ENABLE 0x4 /* bit 2 */
|
||||
/* AGC Control */
|
||||
#define AGC_ENABLE 0x8 /* bit 3 */
|
||||
/* Notch Filter Control */
|
||||
#define NOTCH_ENABLE 0x10 /* bit 4 */
|
||||
/* DC Filter Control */
|
||||
#define DCREMOVER_ENABLE 0x20 /* bit 5 */
|
||||
/* DG Control */
|
||||
#define DG_ENABLE 0x40 /* bit 6 */
|
||||
/* Delay Control */
|
||||
#define DELAY_ENABLE 0x80 /* bit 7 */
|
||||
|
||||
//control for AO_VQE
|
||||
/* AGC Control in SPK Path */
|
||||
#define SPK_AGC_ENABLE 0x1 /* bit 0 */
|
||||
#define SPK_EQ_ENABLE 0x2 /* bit 1 */
|
||||
|
||||
#define CVI_MAX_AI_DEVICE_ID_NUM 3
|
||||
#define CVI_MAX_AO_DEVICE_ID_NUM 3
|
||||
/* define macro */
|
||||
|
||||
#define CHECK_AI_DEVID_VALID(x) \
|
||||
((((x) > (CVI_MAX_AI_DEVICE_ID_NUM-1))) ? 1:0)
|
||||
#define CHECK_AO_DEVID_VALID(x) \
|
||||
((((x) > (CVI_MAX_AO_DEVICE_ID_NUM-1))) ? 1:0)
|
||||
#define CHECK_AENC_DEVID_VALID(x) \
|
||||
((((x) > (AENC_MAX_CHN_NUM-1))) ? 1:0)
|
||||
#define CHECK_ADEC_DEVID_VALID(x) \
|
||||
((((x) > (ADEC_MAX_CHN_NUM-1))) ? 1:0)
|
||||
|
||||
|
||||
typedef enum _AUDIO_SAMPLE_RATE_E {
|
||||
AUDIO_SAMPLE_RATE_8000 = 8000, /* 8K samplerate*/
|
||||
/* 12K samplerate(not support in this version)*/
|
||||
AUDIO_SAMPLE_RATE_11025 = 11025, /* 11.025K samplerate*/
|
||||
AUDIO_SAMPLE_RATE_16000 = 16000, /* 16K samplerate*/
|
||||
AUDIO_SAMPLE_RATE_22050 = 22050, /* 22.050K samplerate*/
|
||||
AUDIO_SAMPLE_RATE_24000 = 24000, /* 24K samplerate*/
|
||||
AUDIO_SAMPLE_RATE_32000 = 32000, /* 32K samplerate*/
|
||||
AUDIO_SAMPLE_RATE_44100 = 44100, /* 44.1K samplerate*/
|
||||
AUDIO_SAMPLE_RATE_48000 = 48000, /* 48K samplerate*/
|
||||
AUDIO_SAMPLE_RATE_64000 = 64000, /* 64K samplerate*/
|
||||
/* 96K samplerate is not support in cv183x series*/
|
||||
AUDIO_SAMPLE_RATE_BUTT,
|
||||
} AUDIO_SAMPLE_RATE_E;
|
||||
|
||||
typedef enum _AUDIO_BIT_WIDTH_E {
|
||||
AUDIO_BIT_WIDTH_8 = 0, /* 8bit width */
|
||||
AUDIO_BIT_WIDTH_16 = 1, /* 16bit width*/
|
||||
AUDIO_BIT_WIDTH_24 = 2, /* 24bit width*/
|
||||
AUDIO_BIT_WIDTH_32 = 3, /* 24bit width*/
|
||||
AUDIO_BIT_WIDTH_BUTT,
|
||||
} AUDIO_BIT_WIDTH_E;
|
||||
|
||||
typedef enum _AIO_MODE_E {
|
||||
AIO_MODE_I2S_MASTER = 0, /* AIO I2S master mode */
|
||||
AIO_MODE_I2S_SLAVE, /* AIO I2S slave mode */
|
||||
AIO_MODE_PCM_SLAVE_STD, /* AIO PCM slave standard mode */
|
||||
AIO_MODE_PCM_SLAVE_NSTD, /* AIO PCM slave non-standard mode */
|
||||
AIO_MODE_PCM_MASTER_STD, /* AIO PCM master standard mode */
|
||||
AIO_MODE_PCM_MASTER_NSTD, /* AIO PCM master non-standard mode */
|
||||
AIO_MODE_BUTT
|
||||
} AIO_MODE_E;
|
||||
|
||||
typedef enum {
|
||||
AIO_I2STYPE_INNERCODEC = 0, /* AIO I2S connect inner audio CODEC */
|
||||
AIO_I2STYPE_INNERHDMI, /* AIO I2S connect Inner HDMI */
|
||||
AIO_I2STYPE_EXTERN, /* AIO I2S connect extern hardware */
|
||||
} AIO_I2STYPE_E;
|
||||
|
||||
typedef enum _AIO_SOUND_MODE_E {
|
||||
AUDIO_SOUND_MODE_MONO = 0, /*mono*/
|
||||
AUDIO_SOUND_MODE_STEREO = 1, /*stereo only support interlace mode*/
|
||||
AUDIO_SOUND_MODE_BUTT
|
||||
} AUDIO_SOUND_MODE_E;
|
||||
|
||||
/*An example of the packing scheme for G726-32 codewords is as */
|
||||
/*shown, and bit A3 is the least significant */
|
||||
/*bit of the first codeword:*/
|
||||
/*RTP G726-32:*/
|
||||
/*0 1*/
|
||||
/*0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5*/
|
||||
/*+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*/
|
||||
/*|B B B B|A A A A|D D D D|C C C C| ...*/
|
||||
/*|0 1 2 3|0 1 2 3|0 1 2 3|0 1 2 3|*/
|
||||
/*+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*/
|
||||
/*MEDIA G726-32:*/
|
||||
/*0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5*/
|
||||
/*+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*/
|
||||
/*|A A A A|B B B B|C C C C|D D D D| ...*/
|
||||
/*|3 2 1 0|3 2 1 0|3 2 1 0|3 2 1 0|*/
|
||||
/*+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*/
|
||||
typedef enum _G726_BPS_E {
|
||||
G726_16K = 0, /* G726 16kbps, see RFC3551.txt 4.5.4 G726-16 */
|
||||
G726_24K, /* G726 24kbps, see RFC3551.txt 4.5.4 G726-24 */
|
||||
G726_32K, /* G726 32kbps, see RFC3551.txt 4.5.4 G726-32 */
|
||||
G726_40K, /* G726 40kbps, see RFC3551.txt 4.5.4 G726-40 */
|
||||
MEDIA_G726_16K, /* G726 16kbps for ASF ... */
|
||||
MEDIA_G726_24K, /* G726 24kbps for ASF ... */
|
||||
MEDIA_G726_32K, /* G726 32kbps for ASF ... */
|
||||
MEDIA_G726_40K, /* G726 40kbps for ASF ... */
|
||||
G726_BUTT,
|
||||
} G726_BPS_E;
|
||||
|
||||
typedef enum _ADPCM_TYPE_E {
|
||||
/* see DVI4 diiffers in three respects from the IMA ADPCM at RFC3551.txt 4.5.1 DVI4 */
|
||||
|
||||
ADPCM_TYPE_DVI4 = 0, /* 32kbps ADPCM(DVI4) for RTP */
|
||||
ADPCM_TYPE_IMA, /* 32kbps ADPCM(IMA),NOTICE:point num must be 161/241/321/481 */
|
||||
ADPCM_TYPE_ORG_DVI4,
|
||||
ADPCM_TYPE_BUTT,
|
||||
} ADPCM_TYPE_E;
|
||||
|
||||
#define AI_EXPAND 0x01
|
||||
#define AI_CUT 0x02
|
||||
|
||||
typedef struct _AIO_ATTR_S {
|
||||
AUDIO_SAMPLE_RATE_E enSamplerate; /* sample rate */
|
||||
AUDIO_BIT_WIDTH_E enBitwidth; /* bitwidth */
|
||||
AIO_MODE_E enWorkmode; /* master or slave mode */
|
||||
AUDIO_SOUND_MODE_E enSoundmode; /* momo or steror */
|
||||
CVI_U32 u32EXFlag;
|
||||
/* expand 8bit to 16bit,use AI_EXPAND(only valid for AI 8bit),*/
|
||||
/*use AI_CUT(only valid for extern Codec for 24bit) */
|
||||
CVI_U32 u32FrmNum;
|
||||
/* frame num in buf[2,CVI_MAX_AUDIO_FRAME_NUM] */
|
||||
CVI_U32 u32PtNumPerFrm;
|
||||
/* point num per frame (80/160/240/320/480/1024/2048) */
|
||||
/*(ADPCM IMA should add 1 point, AMR only support 160) */
|
||||
CVI_U32 u32ChnCnt; /* channel number on FS, valid value:1/2/4/8 */
|
||||
CVI_U32 u32ClkSel; /* 0: AI and AO clock is separate*/
|
||||
/* 1: AI and AO clock is inseparate, AI use AO's clock*/
|
||||
AIO_I2STYPE_E enI2sType; /* i2s type */
|
||||
} AIO_ATTR_S;
|
||||
|
||||
typedef struct _AI_CHN_PARAM_S {
|
||||
CVI_U32 u32UsrFrmDepth;
|
||||
} AI_CHN_PARAM_S;
|
||||
|
||||
typedef struct _AUDIO_FRAME_S {
|
||||
AUDIO_BIT_WIDTH_E enBitwidth;/*audio frame bitwidth*/
|
||||
AUDIO_SOUND_MODE_E enSoundmode;/*audio frame momo or stereo mode*/
|
||||
CVI_U8 * u64VirAddr[2];
|
||||
CVI_U64 u64PhyAddr[2];
|
||||
CVI_U64 u64TimeStamp; /*audio frame timestamp*/
|
||||
CVI_U32 u32Seq; /*audio frame seq*/
|
||||
CVI_U32 u32Len; /*data length per channel in frame*/
|
||||
CVI_U32 u32PoolId[2];
|
||||
} AUDIO_FRAME_S;
|
||||
|
||||
typedef struct _AEC_FRAME_S {
|
||||
AUDIO_FRAME_S stRefFrame; /* AEC reference audio frame */
|
||||
CVI_BOOL bValid; /* whether frame is valid */
|
||||
CVI_BOOL bSysBind; /* whether is sysbind */
|
||||
} AEC_FRAME_S;
|
||||
|
||||
|
||||
typedef struct _AUDIO_FRAME_INFO_S {
|
||||
AUDIO_FRAME_S *pstFrame;/*frame ptr*/
|
||||
CVI_U32 u32Id; /*frame id*/
|
||||
} AUDIO_FRAME_INFO_S;
|
||||
|
||||
typedef struct _AUDIO_STREAM_S {
|
||||
/* CVI_U8 ATTRIBUTE *pStream;the virtual address of stream */
|
||||
/* CVI_U64 ATTRIBUTE u64PhyAddr; the physics address of stream */
|
||||
CVI_U8 *pStream; /* the virtual address of stream */
|
||||
CVI_U64 u64PhyAddr; /* the physics address of stream */
|
||||
CVI_U32 u32Len; /* stream length, by bytes */
|
||||
CVI_U64 u64TimeStamp; /* frame time stamp*/
|
||||
CVI_U32 u32Seq; /* frame seq,if stream is not a valid frame,u32Seq is 0*/
|
||||
} AUDIO_STREAM_S;
|
||||
|
||||
|
||||
typedef struct _AO_CHN_STATE_S {
|
||||
CVI_U32 u32ChnTotalNum; /* total number of channel buffer */
|
||||
CVI_U32 u32ChnFreeNum; /* free number of channel buffer */
|
||||
CVI_U32 u32ChnBusyNum; /* busy number of channel buffer */
|
||||
} AO_CHN_STATE_S;
|
||||
|
||||
typedef enum _AUDIO_TRACK_MODE_E {
|
||||
AUDIO_TRACK_NORMAL = 0,
|
||||
AUDIO_TRACK_BOTH_LEFT = 1,
|
||||
AUDIO_TRACK_BOTH_RIGHT = 2,
|
||||
AUDIO_TRACK_EXCHANGE = 3,
|
||||
AUDIO_TRACK_MIX = 4,
|
||||
AUDIO_TRACK_LEFT_MUTE = 5,
|
||||
AUDIO_TRACK_RIGHT_MUTE = 6,
|
||||
AUDIO_TRACK_BOTH_MUTE = 7,
|
||||
|
||||
AUDIO_TRACK_BUTT
|
||||
} AUDIO_TRACK_MODE_E;
|
||||
|
||||
|
||||
typedef enum _AUDIO_FADE_RATE_E {
|
||||
AUDIO_FADE_RATE_NONE = 0,
|
||||
AUDIO_FADE_RATE_10 = 10,
|
||||
AUDIO_FADE_RATE_20 = 20,
|
||||
AUDIO_FADE_RATE_30 = 30,
|
||||
AUDIO_FADE_RATE_50 = 50,
|
||||
AUDIO_FADE_RATE_100 = 100,
|
||||
AUDIO_FADE_RATE_200 = 200,
|
||||
AUDIO_FADE_RATE_BUTT = -1
|
||||
} AUDIO_FADE_RATE_E;
|
||||
|
||||
typedef struct _AUDIO_FADE_S {
|
||||
CVI_BOOL bFade;
|
||||
AUDIO_FADE_RATE_E enFadeInRate;
|
||||
AUDIO_FADE_RATE_E enFadeOutRate;
|
||||
} AUDIO_FADE_S;
|
||||
|
||||
/**Defines the configure parameters of AEC.*/
|
||||
typedef struct _AI_AEC_CONFIG_S {
|
||||
CVI_U16 para_aec_filter_len;
|
||||
CVI_U16 para_aes_std_thrd; /* the threshold of STD/DTD, [0, 35] */
|
||||
CVI_U16 para_aes_supp_coeff; /* the residual echo suppression level in AES, [0, 24] */
|
||||
} AI_AEC_CONFIG_S;
|
||||
|
||||
/**Defines the configure parameters of UPVQE work state.*/
|
||||
typedef enum _VQE_WORKSTATE_E {
|
||||
VQE_WORKSTATE_COMMON = 0,
|
||||
/* common environment, Applicable to the family of voice calls. */
|
||||
VQE_WORKSTATE_MUSIC = 1,
|
||||
/* music environment , Applicable to the family of music environment. */
|
||||
VQE_WORKSTATE_NOISY = 2,
|
||||
/* noisy environment , Applicable to the noisy voice calls. */
|
||||
} VQE_WORKSTATE_E;
|
||||
|
||||
/**Defines record type*/
|
||||
typedef enum _VQE_RECORD_TYPE {
|
||||
VQE_RECORD_NORMAL = 0,
|
||||
/*<double micphone recording. */
|
||||
VQE_RECORD_BUTT,
|
||||
} VQE_RECORD_TYPE;
|
||||
|
||||
|
||||
/* HDR Set CODEC GAIN Function Handle type */
|
||||
typedef CVI_S32(*pFuncGainCallBack)(CVI_S32 s32SetGain);
|
||||
|
||||
|
||||
|
||||
|
||||
//#define CVIAUDIO_ALGO_SSP 0x11//defalut algorithm
|
||||
//#define CVIAUDIO_ALGO_SSP_NOTCH 0x12//customize algorithm with notch filter
|
||||
#define CVIAUDIO_ALGO_ONLINE_PARAM 0xC0 //customize parameter from /mnt/data/audvqe.cfg
|
||||
typedef struct _AUDIO_DELAY_CONFIG_S {
|
||||
/* the initial filter length of linear AEC to support up for echo tail, [1, 13] */
|
||||
CVI_U16 para_aec_init_filter_len;
|
||||
/* the digital gain target, [1, 12] */
|
||||
CVI_U16 para_dg_target;
|
||||
/* the delay sample for ref signal, [1, 3000] */
|
||||
CVI_U16 para_delay_sample;
|
||||
} AUDIO_DELAY_CONFIG_S;
|
||||
typedef struct _AUDIO_AGC_CONFIG_S {
|
||||
/* the max boost gain for AGC release processing, [0, 3] */
|
||||
/* para_obj.para_agc_max_gain = 1; */
|
||||
CVI_S8 para_agc_max_gain;
|
||||
/* the gain level of target high of AGC, [0, 36] */
|
||||
/* para_obj.para_agc_target_high = 2; */
|
||||
CVI_S8 para_agc_target_high;
|
||||
/* the gain level of target low of AGC, [0, 36] */
|
||||
/* para_obj.para_agc_target_low = 6; */
|
||||
CVI_S8 para_agc_target_low;
|
||||
/* speech-activated AGC functionality, [0, 1] */
|
||||
/* para_obj.para_agc_vad_enable = 1; */
|
||||
CVI_BOOL para_agc_vad_ena;
|
||||
} AUDIO_AGC_CONFIG_S;
|
||||
|
||||
|
||||
typedef struct _AUDIO_SPK_AGC_CONFIG_S {
|
||||
/* the max boost gain for AGC release processing, [0, 3] */
|
||||
/* para_obj.para_agc_max_gain = 1; */
|
||||
CVI_S8 para_agc_max_gain;
|
||||
/* the gain level of target high of AGC, [0, 36] */
|
||||
/* para_obj.para_agc_target_high = 2; */
|
||||
CVI_S8 para_agc_target_high;
|
||||
/* the gain level of target low of AGC, [0, 36] */
|
||||
/* para_obj.para_agc_target_low = 6; */
|
||||
CVI_S8 para_agc_target_low;
|
||||
} AUDIO_SPK_AGC_CONFIG_S;
|
||||
|
||||
typedef struct _AUDIO_SPK_EQ_CONFIG_S {
|
||||
CVI_U16 para_spk_eq_nband;
|
||||
CVI_U16 para_spk_eq_freq[5];
|
||||
CVI_U16 para_spk_eq_gain[5];
|
||||
CVI_U16 para_spk_eq_qfactor[5];
|
||||
} AUDIO_SPK_EQ_CONFIG_S;
|
||||
|
||||
typedef struct _AUDIO_ANR_CONFIG_S {
|
||||
/* the coefficient of NR priori SNR tracking, [0, 20] */
|
||||
/* para_obj.para_nr_snr_coeff = 15; */
|
||||
CVI_U16 para_nr_snr_coeff;
|
||||
/* the coefficient of NR noise tracking, [0, 14] */
|
||||
/* para_obj.para_nr_noise_coeff = 2; */
|
||||
//CVI_S8 para_nr_noise_coeff;
|
||||
CVI_U16 para_nr_init_sile_time;
|
||||
} AUDIO_ANR_CONFIG_S;
|
||||
|
||||
typedef struct _AI_TALKVQE_CONFIG_S {
|
||||
CVI_U16 para_client_config;
|
||||
CVI_U32 u32OpenMask;
|
||||
CVI_S32 s32WorkSampleRate;
|
||||
/* Sample Rate: 8KHz/16KHz. default: 8KHz*/
|
||||
//MIC IN VQE setting
|
||||
AI_AEC_CONFIG_S stAecCfg;
|
||||
AUDIO_ANR_CONFIG_S stAnrCfg;
|
||||
AUDIO_AGC_CONFIG_S stAgcCfg;
|
||||
AUDIO_DELAY_CONFIG_S stAecDelayCfg;
|
||||
CVI_S32 s32RevMask;//turn this flag to default 0x11
|
||||
CVI_S32 para_notch_freq;//user can ignore this flag
|
||||
CVI_CHAR customize[MAX_AUDIO_VQE_CUSTOMIZE_NAME];
|
||||
} AI_TALKVQE_CONFIG_S;
|
||||
|
||||
typedef struct _AO_VQE_CONFIG_S {
|
||||
CVI_U32 u32OpenMask;
|
||||
CVI_S32 s32WorkSampleRate;
|
||||
/* Sample Rate: 8KHz/16KHz default: 8KHz*/
|
||||
AUDIO_SPK_AGC_CONFIG_S stAgcCfg;
|
||||
AUDIO_SPK_EQ_CONFIG_S stEqCfg;
|
||||
} AO_VQE_CONFIG_S;
|
||||
|
||||
/**Defines the configure parameters of Record VQE.*/
|
||||
typedef struct _AI_RECORDVQE_CONFIG_S {
|
||||
CVI_U32 u32OpenMask;
|
||||
CVI_S32 s32WorkSampleRate;
|
||||
/* Sample Rate:16KHz/48KHz*/
|
||||
CVI_S32 s32FrameSample;
|
||||
CVI_S32 s32BytesPerSample;
|
||||
/* VQE frame length:80-4096 */
|
||||
VQE_WORKSTATE_E enWorkstate;
|
||||
CVI_S32 s32InChNum;
|
||||
CVI_S32 s32OutChNum;
|
||||
VQE_RECORD_TYPE enRecordType;
|
||||
AUDIO_AGC_CONFIG_S stAgcCfg;
|
||||
} AI_RECORDVQE_CONFIG_S;
|
||||
/* Defines the module register configure of VQE. */
|
||||
typedef struct _VQE_MODULE_CONFIG_S {
|
||||
CVI_VOID *pHandle;
|
||||
} VQE_MODULE_CONFIG_S;
|
||||
|
||||
typedef struct _AUDIO_VQE_REGISTER_S {
|
||||
VQE_MODULE_CONFIG_S stResModCfg;
|
||||
VQE_MODULE_CONFIG_S stHpfModCfg;
|
||||
VQE_MODULE_CONFIG_S stHdrModCfg;
|
||||
VQE_MODULE_CONFIG_S stGainModCfg;
|
||||
|
||||
// Record VQE
|
||||
VQE_MODULE_CONFIG_S stRecordModCfg;
|
||||
|
||||
// Talk VQE
|
||||
VQE_MODULE_CONFIG_S stAecModCfg;
|
||||
VQE_MODULE_CONFIG_S stAnrModCfg;
|
||||
VQE_MODULE_CONFIG_S stAgcModCfg;
|
||||
VQE_MODULE_CONFIG_S stEqModCfg;
|
||||
|
||||
// CviFi VQE
|
||||
VQE_MODULE_CONFIG_S stRnrModCfg;
|
||||
VQE_MODULE_CONFIG_S stDrcModCfg;
|
||||
VQE_MODULE_CONFIG_S stPeqModCfg;
|
||||
} AUDIO_VQE_REGISTER_S;
|
||||
|
||||
/*Defines the configure parameters of AI saving file.*/
|
||||
typedef struct _AUDIO_SAVE_FILE_INFO_S {
|
||||
CVI_BOOL bCfg;
|
||||
CVI_CHAR aFilePath[MAX_AUDIO_FILE_PATH_LEN];
|
||||
CVI_CHAR aFileName[MAX_AUDIO_FILE_NAME_LEN];
|
||||
CVI_U32 u32FileSize; /*in KB*/
|
||||
} AUDIO_SAVE_FILE_INFO_S;
|
||||
|
||||
/*Defines whether the file is saving or not .*/
|
||||
typedef struct _AUDIO_FILE_STATUS_S {
|
||||
CVI_BOOL bSaving;
|
||||
} AUDIO_FILE_STATUS_S;
|
||||
|
||||
/**Defines audio clksel type*/
|
||||
typedef enum _AUDIO_CLKSEL_E {
|
||||
AUDIO_CLKSEL_BASE = 0, /*<Audio base clk. */
|
||||
AUDIO_CLKSEL_SPARE, /*<Audio spare clk. */
|
||||
|
||||
AUDIO_CLKSEL_BUTT,
|
||||
} AUDIO_CLKSEL_E;
|
||||
|
||||
/*Defines audio mode parameter.*/
|
||||
typedef struct _AUDIO_MOD_PARAM_S {
|
||||
AUDIO_CLKSEL_E enClkSel;
|
||||
} AUDIO_MOD_PARAM_S;
|
||||
|
||||
|
||||
typedef struct _cvi_wavHEADER {
|
||||
/* RIFF string */
|
||||
CVI_U8 riff[4];
|
||||
// overall size of file in bytes
|
||||
CVI_U32 overall_size;
|
||||
// WAVE string
|
||||
CVI_U8 wave[4];
|
||||
// fmt string with trailing null char
|
||||
CVI_U8 fmt_chunk_marker[4];
|
||||
// length of the format data
|
||||
CVI_U32 length_of_fmt;
|
||||
// format type. 1-PCM, 3- IEEE float, 6 - 8bit A law, 7 - 8bit mu law
|
||||
CVI_U16 format_type;
|
||||
// no.of channels
|
||||
CVI_U16 channels;
|
||||
// sampling rate (blocks per second)
|
||||
CVI_U32 sample_rate;
|
||||
// SampleRate * NumChannels * BitsPerSample/8
|
||||
CVI_U32 byterate;
|
||||
// NumChannels * BitsPerSample/8
|
||||
CVI_U16 block_align;
|
||||
// bits per sample, 8- 8bits, 16- 16 bits etc
|
||||
CVI_U16 bits_per_sample;
|
||||
// DATA string or FLLR string
|
||||
CVI_U8 data_chunk_header[4];
|
||||
// NumSamples * NumChannels * BitsPerSample/8 - size of the next chunk that will be read
|
||||
CVI_U32 data_size;
|
||||
} ST_CVI_WAV_HEADER;
|
||||
|
||||
|
||||
typedef struct _AudioUnitTestCfg {
|
||||
CVI_S32 channels;
|
||||
CVI_S32 Time_in_second;
|
||||
CVI_S32 sample_rate;
|
||||
CVI_CHAR format[64]; //pcm/ g711//g726...
|
||||
CVI_S32 period_size;
|
||||
CVI_S32 bitdepth;
|
||||
CVI_S32 unit_test;
|
||||
CVI_S32 s32TestMode;
|
||||
CVI_CHAR filename[256];
|
||||
CVI_BOOL bOptCfg;
|
||||
} ST_AudioUnitTestCfg;
|
||||
|
||||
|
||||
typedef struct _ST_CVIAUDIO_SPEEDPLAY_USR_CONFIG {
|
||||
int sampleRate;
|
||||
int channels;
|
||||
float speed;
|
||||
float pitch;
|
||||
float rate;
|
||||
float volume;
|
||||
} ST_CVIAO_SPEEDPLAY_CONFIG;
|
||||
|
||||
extern ST_AudioUnitTestCfg stAudTestCfg;
|
||||
/* at least one parameter is illegal ,eg, an illegal enumeration value */
|
||||
#define CVI_ERR_AIO_ILLEGAL_PARAM 0xAA000001
|
||||
/* using a NULL point */
|
||||
#define CVI_ERR_AIO_NULL_PTR 0xAA000002
|
||||
/* operation is not supported by NOW */
|
||||
#define CVI_ERR_AIO_NOT_PERM 0xAA000003
|
||||
/* vqe err */
|
||||
#define CVI_ERR_AIO_REGISTER_ERR 0xAA000004
|
||||
|
||||
/* invalid device ID */
|
||||
#define CVI_ERR_AI_INVALID_DEVID 0xA0000005
|
||||
/* invalid channel ID */
|
||||
#define CVI_ERR_AI_INVALID_CHNID 0xA0000006
|
||||
/* at least one parameter is illegal ,eg, an illegal enumeration value */
|
||||
#define CVI_ERR_AI_ILLEGAL_PARAM 0xA0000001
|
||||
/* using a NULL point */
|
||||
#define CVI_ERR_AI_NULL_PTR 0xA0000002
|
||||
/* try to enable or initialize system,device or channel, before configing attribute */
|
||||
#define CVI_ERR_AI_NOT_CONFIG 0xA0000007
|
||||
/* operation is not supported by NOW */
|
||||
#define CVI_ERR_AI_NOT_SUPPORT 0xA0000008
|
||||
/* operation is not permitted ,eg, try to change stati attribute */
|
||||
#define CVI_ERR_AI_NOT_PERM 0xA0000003
|
||||
/* the devide is not enabled */
|
||||
#define CVI_ERR_AI_NOT_ENABLED 0xA0000009
|
||||
/* failure caused by malloc memory */
|
||||
#define CVI_ERR_AI_NOMEM 0xA000000A
|
||||
/* failure caused by malloc buffer */
|
||||
#define CVI_ERR_AI_NOBUF 0xA000000B
|
||||
/* no data in buffer */
|
||||
#define CVI_ERR_AI_BUF_EMPTY 0xA000000C
|
||||
/* no buffer for new data */
|
||||
#define CVI_ERR_AI_BUF_FULL 0xA000000D
|
||||
/* system is not ready,had not initialized or loaded*/
|
||||
#define CVI_ERR_AI_SYS_NOTREADY 0xA000000E
|
||||
|
||||
#define CVI_ERR_AI_BUSY 0xA000000F
|
||||
/* vqe err */
|
||||
#define CVI_ERR_AI_VQE_ERR 0xA0000010
|
||||
#define CVI_ERR_AI_VQE_BUF_FULL 0xA0000011
|
||||
#define CVI_ERR_AI_VQE_FILE_UNEXIST 0xA0000012
|
||||
/* invalid device ID */
|
||||
#define CVI_ERR_AO_INVALID_DEVID 0xA1000001
|
||||
/* invalid channel ID */
|
||||
#define CVI_ERR_AO_INVALID_CHNID 0xA1000002
|
||||
/* at least one parameter is illegal ,eg, an illegal enumeration value */
|
||||
#define CVI_ERR_AO_ILLEGAL_PARAM 0xA1000003
|
||||
/* using a NULL point */
|
||||
#define CVI_ERR_AO_NULL_PTR 0xA1000004
|
||||
/* try to enable or initialize system,device or channel, before configing attribute */
|
||||
#define CVI_ERR_AO_NOT_CONFIG 0xA1000005
|
||||
/* operation is not supported by NOW */
|
||||
#define CVI_ERR_AO_NOT_SUPPORT 0xA1000006
|
||||
/* operation is not permitted ,eg, try to change stati attribute */
|
||||
#define CVI_ERR_AO_NOT_PERM 0xA1000007
|
||||
/* the devide is not enabled */
|
||||
#define CVI_ERR_AO_NOT_ENABLED 0xA1000008
|
||||
/* failure caused by malloc memory */
|
||||
#define CVI_ERR_AO_NOMEM 0xA1000009
|
||||
/* failure caused by malloc buffer */
|
||||
#define CVI_ERR_AO_NOBUF 0xA100000A
|
||||
/* no data in buffer */
|
||||
#define CVI_ERR_AO_BUF_EMPTY 0xA100000B
|
||||
/* no buffer for new data */
|
||||
#define CVI_ERR_AO_BUF_FULL 0xA100000C
|
||||
/* system is not ready,had not initialized or loaded*/
|
||||
#define CVI_ERR_AO_SYS_NOTREADY 0xA100000D
|
||||
|
||||
#define CVI_ERR_AO_BUSY 0xA100000E
|
||||
/* vqe err */
|
||||
#define CVI_ERR_AO_VQE_ERR 0xA100000F
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* End of #ifndef __CVI_COMM_AI_H__ */
|
||||
|
||||
27
middleware/v2/include/cvi_comm_ao.h
Normal file
27
middleware/v2/include/cvi_comm_ao.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_comm_ao.h
|
||||
* Description: basic audio output define
|
||||
*/
|
||||
|
||||
#ifndef __CVI_COMM_AO_H__
|
||||
#define __CVI_COMM_AO_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* End of #ifndef __CVI_COMM_AO_H__ */
|
||||
|
||||
96
middleware/v2/include/cvi_comm_osdc.h
Normal file
96
middleware/v2/include/cvi_comm_osdc.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_comm_vpss.h
|
||||
* Description:
|
||||
* The common data type defination for VPSS module.
|
||||
*/
|
||||
|
||||
#ifndef __CVI_COMM_OSDC_H__
|
||||
#define __CVI_COMM_OSDC_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef enum _OSDC_OSD_FORMAT_E {
|
||||
OSD_ARGB8888 = 0,
|
||||
OSD_ARGB4444 = 4,
|
||||
OSD_ARGB1555 = 5,
|
||||
OSD_LUT8 = 8,
|
||||
OSD_LUT4 = 10,
|
||||
NUM_OF_FORMAT
|
||||
} OSDC_OSD_FORMAT_E;
|
||||
|
||||
typedef enum _OSDC_DRAW_OBJ_TYPE_E {
|
||||
RECT = 0,
|
||||
STROKE_RECT,
|
||||
BIT_MAP,
|
||||
LINE,
|
||||
CMPR_BIT_MAP,
|
||||
NUM_OF_DRAW_OBJ
|
||||
} OSDC_DRAW_OBJ_TYPE_E;
|
||||
|
||||
typedef struct _OSDC_Canvas_Attr_S {
|
||||
int width;
|
||||
int height;
|
||||
OSDC_OSD_FORMAT_E format;
|
||||
uint32_t bg_color_code;
|
||||
} OSDC_Canvas_Attr_S;
|
||||
|
||||
typedef struct _OSDC_RECT_ATTR_S {
|
||||
int x;
|
||||
int y;
|
||||
int width;
|
||||
int height;
|
||||
int thickness;
|
||||
} OSDC_RECT_ATTR_S;
|
||||
|
||||
typedef struct _OSDC_POINT_ATTR_S {
|
||||
int x;
|
||||
int y;
|
||||
} OSDC_POINT_ATTR_S;
|
||||
|
||||
typedef struct _OSDC_LINE_ATTR_S {
|
||||
float _mx; // slope of two end-point vector
|
||||
float _bx[2];
|
||||
float _by[2];
|
||||
float _ex[2];
|
||||
float _ey[2];
|
||||
float ts_h; // thickness proj. on horizontal slice
|
||||
} OSDC_LINE_ATTR_S;
|
||||
|
||||
typedef struct _OSDC_BITMAP_ATTR_S {
|
||||
OSDC_RECT_ATTR_S rect;
|
||||
union {
|
||||
uint32_t stride;
|
||||
uint32_t bs_offset;
|
||||
};
|
||||
} OSDC_BITMAP_ATTR_S;
|
||||
|
||||
typedef union _OSDC_COLOR_S {
|
||||
uint32_t code;
|
||||
uint8_t *buf;
|
||||
} OSDC_COLOR_S;
|
||||
|
||||
typedef struct _OSDC_DRAW_OBJ_S {
|
||||
OSDC_DRAW_OBJ_TYPE_E type;
|
||||
union {
|
||||
OSDC_RECT_ATTR_S rect;
|
||||
OSDC_LINE_ATTR_S line;
|
||||
OSDC_BITMAP_ATTR_S bitmap;
|
||||
};
|
||||
OSDC_COLOR_S color;
|
||||
int _max_y;
|
||||
int _min_y;
|
||||
} OSDC_DRAW_OBJ_S;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __CVI_COMM_OSDC_H__ */
|
||||
95
middleware/v2/include/cvi_comm_sns.h
Normal file
95
middleware/v2/include/cvi_comm_sns.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_common_sns.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef _CVI_COMM_SNS_H_
|
||||
#define _CVI_COMM_SNS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <linux/cvi_type.h>
|
||||
#include <linux/cvi_defines.h>
|
||||
#include "cvi_debug.h"
|
||||
#include "cvi_comm_isp.h"
|
||||
|
||||
// ++++++++ If you want to change these interfaces, please contact the isp team. ++++++++
|
||||
|
||||
#define NOISE_PROFILE_CHANNEL_NUM 4
|
||||
#define NOISE_PROFILE_LEVEL_NUM 2
|
||||
#define NOISE_PROFILE_ISO_NUM 16
|
||||
#define USE_USER_SEN_DRIVER 1
|
||||
|
||||
|
||||
typedef struct _ISP_CMOS_SENSOR_IMAGE_MODE_S {
|
||||
CVI_U16 u16Width;
|
||||
CVI_U16 u16Height;
|
||||
CVI_FLOAT f32Fps;
|
||||
CVI_U8 u8SnsMode;
|
||||
} ISP_CMOS_SENSOR_IMAGE_MODE_S;
|
||||
|
||||
typedef struct _ISP_CMOS_BLACK_LEVEL_S {
|
||||
CVI_BOOL bUpdate;
|
||||
ISP_BLACK_LEVEL_ATTR_S blcAttr;
|
||||
} ISP_CMOS_BLACK_LEVEL_S;
|
||||
|
||||
typedef struct _ISP_SNS_ATTR_INFO_S {
|
||||
CVI_U32 eSensorId;
|
||||
} ISP_SNS_ATTR_INFO_S;
|
||||
|
||||
typedef struct cviISP_CMOS_NOISE_CALIBRATION_S {
|
||||
CVI_FLOAT CalibrationCoef[NOISE_PROFILE_ISO_NUM][NOISE_PROFILE_CHANNEL_NUM][NOISE_PROFILE_LEVEL_NUM];
|
||||
} ISP_CMOS_NOISE_CALIBRATION_S;
|
||||
|
||||
typedef struct _ISP_CMOS_DEFAULT_S {
|
||||
ISP_CMOS_NOISE_CALIBRATION_S stNoiseCalibration;
|
||||
} ISP_CMOS_DEFAULT_S;
|
||||
|
||||
typedef struct _ISP_SENSOR_EXP_FUNC_S {
|
||||
CVI_VOID (*pfn_cmos_sensor_init)(VI_PIPE ViPipe);
|
||||
CVI_VOID (*pfn_cmos_sensor_exit)(VI_PIPE ViPipe);
|
||||
CVI_VOID (*pfn_cmos_sensor_global_init)(VI_PIPE ViPipe);
|
||||
CVI_S32 (*pfn_cmos_set_image_mode)(VI_PIPE ViPipe, ISP_CMOS_SENSOR_IMAGE_MODE_S *pstSensorImageMode);
|
||||
CVI_S32 (*pfn_cmos_set_wdr_mode)(VI_PIPE ViPipe, CVI_U8 u8Mode);
|
||||
|
||||
/* the algs get data which is associated with sensor, except 3a */
|
||||
CVI_S32 (*pfn_cmos_get_isp_default)(VI_PIPE ViPipe, ISP_CMOS_DEFAULT_S *pstDef);
|
||||
CVI_S32 (*pfn_cmos_get_isp_black_level)(VI_PIPE ViPipe, ISP_CMOS_BLACK_LEVEL_S *pstBlackLevel);
|
||||
CVI_S32 (*pfn_cmos_get_sns_reg_info)(VI_PIPE ViPipe, ISP_SNS_SYNC_INFO_S *pstSnsRegsInfo);
|
||||
|
||||
/* the function of sensor set pixel detect */
|
||||
//CVI_VOID (*pfn_cmos_set_pixel_detect)(VI_PIPE ViPipe, bool bEnable);
|
||||
} ISP_SENSOR_EXP_FUNC_S;
|
||||
|
||||
typedef struct bmISP_SENSOR_REGISTER_S {
|
||||
ISP_SENSOR_EXP_FUNC_S stSnsExp;
|
||||
} ISP_SENSOR_REGISTER_S;
|
||||
|
||||
typedef enum _MCLK_FREQ_E {
|
||||
MCLK_FREQ_NONE = 0,
|
||||
MCLK_FREQ_37P125M,
|
||||
MCLK_FREQ_25M,
|
||||
MCLK_FREQ_27M,
|
||||
MCLK_FREQ_NUM
|
||||
} MCLK_FREQ_E;
|
||||
|
||||
typedef struct _SNS_MCLK_S {
|
||||
CVI_U32 u8Cam;
|
||||
MCLK_FREQ_E enFreq;
|
||||
} SNS_MCLK_S;
|
||||
|
||||
// -------- If you want to change these interfaces, please contact the isp team. --------
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _CVI_COMM_SNS_H_ */
|
||||
135
middleware/v2/include/cvi_comm_vb.h
Normal file
135
middleware/v2/include/cvi_comm_vb.h
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_comm_vb.h
|
||||
* Description:
|
||||
* The common data type defination for VB module.
|
||||
*/
|
||||
|
||||
#ifndef __CVI_COMM_VB_H__
|
||||
#define __CVI_COMM_VB_H__
|
||||
|
||||
#include <linux/cvi_type.h>
|
||||
#include <linux/cvi_defines.h>
|
||||
#include <linux/cvi_errno.h>
|
||||
#include "cvi_debug.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#define VB_INVALID_POOLID (-1U)
|
||||
#define VB_INVALID_HANDLE (-1U)
|
||||
#define VB_STATIC_POOLID (-2U)
|
||||
#define VB_EXTERNAL_POOLID (-3U)
|
||||
|
||||
#define VB_MAX_COMM_POOLS (16)
|
||||
#define VB_POOL_MAX_BLK (64)
|
||||
|
||||
/* user ID for VB */
|
||||
#define VB_MAX_USER VB_UID_BUTT
|
||||
|
||||
typedef enum _VB_UID_E {
|
||||
VB_UID_VI = 0,
|
||||
VB_UID_VO = 1,
|
||||
VB_UID_VPSS = 2,
|
||||
VB_UID_VENC = 3,
|
||||
VB_UID_VDEC = 4,
|
||||
VB_UID_H265E = 5,
|
||||
VB_UID_H264E = 6,
|
||||
VB_UID_JPEGE = 7,
|
||||
VB_UID_H264D = 8,
|
||||
VB_UID_JPEGD = 9,
|
||||
VB_UID_DIS = 10,
|
||||
VB_UID_USER = 11,
|
||||
VB_UID_AI = 12,
|
||||
VB_UID_AENC = 13,
|
||||
VB_UID_RC = 14,
|
||||
VB_UID_VFMW = 15,
|
||||
VB_UID_GDC = 16,
|
||||
VB_UID_BUTT,
|
||||
|
||||
} VB_UID_E;
|
||||
|
||||
/* Generall common pool use this owner id, module common pool use VB_UID as owner id */
|
||||
#define POOL_OWNER_COMMON -1
|
||||
|
||||
/* Private pool use this owner id */
|
||||
#define POOL_OWNER_PRIVATE -2
|
||||
|
||||
typedef CVI_U32 VB_POOL;
|
||||
#ifdef __arm__
|
||||
typedef CVI_U32 VB_BLK;
|
||||
#else
|
||||
typedef CVI_U64 VB_BLK;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* VB_REMAP_MODE_NONE: no remap.
|
||||
* VB_REMAP_MODE_NOCACHE: no cache remap.
|
||||
* VB_REMAP_MODE_CACHED: cache remap. flush cache is needed.
|
||||
*/
|
||||
typedef enum _VB_REMAP_MODE_E {
|
||||
VB_REMAP_MODE_NONE = 0,
|
||||
VB_REMAP_MODE_NOCACHE = 1,
|
||||
VB_REMAP_MODE_CACHED = 2,
|
||||
VB_REMAP_MODE_BUTT
|
||||
} VB_REMAP_MODE_E;
|
||||
|
||||
/*
|
||||
* u32BlkSize: size of blk in the pool.
|
||||
* u32BlkCnt: number of blk in the pool.
|
||||
* enRemapMode: remap mode.
|
||||
*/
|
||||
#define MAX_VB_POOL_NAME_LEN (32)
|
||||
typedef struct _VB_POOL_CONFIG_S {
|
||||
CVI_U32 u32BlkSize;
|
||||
CVI_U32 u32BlkCnt;
|
||||
VB_REMAP_MODE_E enRemapMode;
|
||||
CVI_CHAR acName[MAX_VB_POOL_NAME_LEN];
|
||||
} VB_POOL_CONFIG_S;
|
||||
|
||||
/*
|
||||
* au64PhyAddr: Y/U/V base addr.
|
||||
*/
|
||||
typedef struct _VB_USER_BLOCK_S {
|
||||
CVI_U64 au64PhyAddr[3];
|
||||
} VB_USER_BLOCK_S;
|
||||
|
||||
/*
|
||||
* u32BlkCnt: number of blk in the pool.
|
||||
* VB_USER_BLOCK_S: block addr.
|
||||
*/
|
||||
typedef struct _VB_POOL_CONFIG_EX_S {
|
||||
CVI_U32 u32BlkCnt;
|
||||
VB_USER_BLOCK_S astUserBlk[VB_POOL_MAX_BLK];
|
||||
} VB_POOL_CONFIG_EX_S;
|
||||
|
||||
/*
|
||||
* u32MaxPoolCnt: number of common pools used.
|
||||
* astCommPool: pool cfg for the pools.
|
||||
*/
|
||||
typedef struct _VB_CONFIG_S {
|
||||
CVI_U32 u32MaxPoolCnt;
|
||||
VB_POOL_CONFIG_S astCommPool[VB_MAX_COMM_POOLS];
|
||||
} VB_CONFIG_S;
|
||||
|
||||
#define VB_SUPPLEMENT_JPEG_MASK 0x1
|
||||
#define VB_SUPPLEMENT_ISPINFO_MASK 0x2
|
||||
#define VB_SUPPLEMENT_MOTION_DATA_MASK 0x4
|
||||
#define VB_SUPPLEMENT_DNG_MASK 0x8
|
||||
|
||||
typedef struct _VB_SUPPLEMENT_CONFIG_S {
|
||||
CVI_U32 u32SupplementConfig;
|
||||
} VB_SUPPLEMENT_CONFIG_S;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __CVI_COMM_VB_H_ */
|
||||
137
middleware/v2/include/cvi_debug.h
Normal file
137
middleware/v2/include/cvi_debug.h
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_debug.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __CVI_DEBUG_H__
|
||||
#define __CVI_DEBUG_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include <string.h>
|
||||
#include <linux/cvi_common.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
/*
|
||||
* Debug Config
|
||||
*/
|
||||
#define CONFIG_CVI_GDB_NO 1
|
||||
#define CONFIG_CVI_GDB "n"
|
||||
#define CONFIG_CVI_LOG_TRACE_SUPPORT 1
|
||||
#define CONFIG_CVI_LOG_TRACE_ALL 1
|
||||
#define CONFIG_CVI_LOG_TRACE_LEVEL 4
|
||||
|
||||
|
||||
#define CVI_DBG_EMERG 0 /* system is unusable */
|
||||
#define CVI_DBG_ALERT 1 /* action must be taken immediately */
|
||||
#define CVI_DBG_CRIT 2 /* critical conditions */
|
||||
#define CVI_DBG_ERR 3 /* error conditions */
|
||||
#define CVI_DBG_WARN 4 /* warning conditions */
|
||||
#define CVI_DBG_NOTICE 5 /* normal but significant condition */
|
||||
#define CVI_DBG_INFO 6 /* informational */
|
||||
#define CVI_DBG_DEBUG 7 /* debug-level messages */
|
||||
|
||||
typedef struct _LOG_LEVEL_CONF_S {
|
||||
MOD_ID_E enModId;
|
||||
CVI_S32 s32Level;
|
||||
char cModName[16];
|
||||
} LOG_LEVEL_CONF_S;
|
||||
|
||||
#define CVI_PRINT printf
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
|
||||
extern CVI_S32 * log_levels;
|
||||
extern CVI_CHAR const *log_name[8];
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#define _GENERATE_STRING(STRING) (#STRING),
|
||||
static const char *const MOD_STRING[] = FOREACH_MOD(_GENERATE_STRING);
|
||||
#define CVI_GET_MOD_NAME(id) (id < CVI_ID_BUTT)? MOD_STRING[id] : "UNDEF"
|
||||
|
||||
/* #ifdef CVI_DEBUG */
|
||||
#ifdef CONFIG_CVI_LOG_TRACE_SUPPORT
|
||||
|
||||
#define CVI_ASSERT(expr) \
|
||||
do { \
|
||||
if (!(expr)) { \
|
||||
printf("\nASSERT at:\n" \
|
||||
" >Function : %s\n" \
|
||||
" >Line No. : %d\n" \
|
||||
" >Condition: %s\n", \
|
||||
__func__, __LINE__, #expr); \
|
||||
_exit(-1); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#ifndef FPGA_PORTING
|
||||
|
||||
#define CVI_TRACE(level, enModId, fmt, ...) \
|
||||
do { \
|
||||
CVI_S32 LogLevel = (log_levels == NULL) ? CONFIG_CVI_LOG_TRACE_LEVEL : log_levels[enModId]; \
|
||||
if (level <= LogLevel) \
|
||||
syslog(LOG_LOCAL5|level, "[%s-%s] " fmt, CVI_GET_MOD_NAME(enModId), log_name[level], \
|
||||
##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#else
|
||||
#define CVI_TRACE(level, enModId, fmt, ...) \
|
||||
printf(fmt, ##__VA_ARGS__)
|
||||
#endif
|
||||
#else
|
||||
#define CVI_ASSERT(expr)
|
||||
#define CVI_TRACE(level, enModId, fmt...)
|
||||
#endif
|
||||
|
||||
#define CVI_TRACE_ID(level, id, fmt, ...) \
|
||||
CVI_TRACE(level, id, "%s:%d:%s(): " fmt, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
|
||||
#define CVI_TRACE_LOG(level, fmt, ...) \
|
||||
CVI_TRACE(level, CVI_ID_LOG, "%s:%d:%s(): " fmt, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
|
||||
#define CVI_TRACE_SYS(level, fmt, ...) \
|
||||
CVI_TRACE(level, CVI_ID_SYS, "%s:%d:%s(): " fmt, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
|
||||
#define CVI_TRACE_VB(level, fmt, ...) \
|
||||
CVI_TRACE(level, CVI_ID_VB, "%s:%d:%s(): " fmt, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
|
||||
#define CVI_TRACE_SNS(level, fmt, ...) \
|
||||
CVI_TRACE(level, CVI_ID_VI, "%s:%d:%s(): " fmt, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
|
||||
#define CVI_TRACE_VI(level, fmt, ...) \
|
||||
CVI_TRACE(level, CVI_ID_VI, "%s:%d:%s(): " fmt, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
|
||||
#define CVI_TRACE_VPSS(level, fmt, ...) \
|
||||
CVI_TRACE(level, CVI_ID_VPSS, "%s:%d:%s(): " fmt, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
|
||||
#define CVI_TRACE_VO(level, fmt, ...) \
|
||||
CVI_TRACE(level, CVI_ID_VO, "%s:%d:%s(): " fmt, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
|
||||
#define CVI_TRACE_GDC(level, fmt, ...) \
|
||||
CVI_TRACE(level, CVI_ID_GDC, "%s:%d:%s(): " fmt, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
|
||||
#define CVI_TRACE_RGN(level, fmt, ...) \
|
||||
CVI_TRACE(level, CVI_ID_RGN, "%s:%d:%s(): " fmt, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
|
||||
#define CVI_TRACE_MISC(level, fmt, ...) \
|
||||
CVI_TRACE(level, CVI_ID_SYS, "%s:%d:%s(): " fmt, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __CVI_COMM_SYS_H__ */
|
||||
|
||||
166
middleware/v2/include/cvi_gdc.h
Normal file
166
middleware/v2/include/cvi_gdc.h
Normal file
@@ -0,0 +1,166 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_gdc.h
|
||||
* Description:
|
||||
* gdc interfaces.
|
||||
*/
|
||||
|
||||
#ifndef __CVI_GDC_H__
|
||||
#define __CVI_GDC_H__
|
||||
|
||||
#include <linux/cvi_common.h>
|
||||
#include <linux/cvi_comm_video.h>
|
||||
#include <linux/cvi_comm_gdc.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @brief Begin a gdc job,then add task into the job,gdc will finish all the task in the job.
|
||||
*
|
||||
* @param hHandle(In), handle creat by CVI_GDC_BeginJob
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_BeginJob(GDC_HANDLE *phHandle);
|
||||
|
||||
/**
|
||||
* @brief End a job,all tasks in the job will be submmitted to gdc
|
||||
*
|
||||
* @param hHandle(In), handle creat by CVI_GDC_BeginJob
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_EndJob(GDC_HANDLE hHandle);
|
||||
|
||||
/**
|
||||
* @brief Cancel a job ,then all tasks in the job will not be submmitted to gdc
|
||||
*
|
||||
* @param hHandle(In), handle creat by CVI_GDC_BeginJob
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_CancelJob(GDC_HANDLE hHandle);
|
||||
|
||||
/**
|
||||
* @brief Add a fisheye task to a gdc job
|
||||
*
|
||||
* @param hHandle(In), handle creat by CVI_GDC_BeginJob
|
||||
* @param pstTask(In), GDC task attribute
|
||||
* @param pstFisheyeAttr(In), for further settings
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_AddCorrectionTask(GDC_HANDLE hHandle, const GDC_TASK_ATTR_S *pstTask
|
||||
, const FISHEYE_ATTR_S *pstFisheyeAttr);
|
||||
|
||||
/**
|
||||
* @brief Add a rotation task to a gdc job
|
||||
*
|
||||
* @param hHandle(In), handle creat by CVI_GDC_BeginJob
|
||||
* @param pstTask(In), GDC task attribute
|
||||
* @param enRotation(In), for further settings
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_AddRotationTask(GDC_HANDLE hHandle, const GDC_TASK_ATTR_S *pstTask, ROTATION_E enRotation);
|
||||
|
||||
/**
|
||||
* @brief Add a affine task to a gdc job
|
||||
*
|
||||
* @param hHandle(In), handle creat by CVI_GDC_BeginJob
|
||||
* @param pstTask(In), GDC task attribute
|
||||
* @param pstAffineAttr(In), for further settings
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_AddAffineTask(GDC_HANDLE hHandle, const GDC_TASK_ATTR_S *pstTask, const AFFINE_ATTR_S *pstAffineAttr);
|
||||
|
||||
/**
|
||||
* @brief Add a LDC task to a gdc job
|
||||
*
|
||||
* @param pstTask(In), GDC task attribute.
|
||||
* @param pstLDCAttr(In), GDC LDC attribute
|
||||
* @param enRotation(In), for further settings
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_AddLDCTask(GDC_HANDLE hHandle, const GDC_TASK_ATTR_S *pstTask
|
||||
, const LDC_ATTR_S *pstLDCAttr, ROTATION_E enRotation);
|
||||
|
||||
/**
|
||||
* @brief this function is abandoned, do not support yet.
|
||||
*/
|
||||
CVI_S32 CVI_GDC_AddCnvWarpTask(const float *pfmesh_data, GDC_HANDLE hHandle, const GDC_TASK_ATTR_S *pstTask
|
||||
, const FISHEYE_ATTR_S *pstAffineAttr, bool *bReNew);
|
||||
|
||||
/**
|
||||
* @brief this function is abandoned, do not support yet.
|
||||
*/
|
||||
CVI_S32 CVI_GDC_AddCorrectionTaskCNV(GDC_HANDLE hHandle, const GDC_TASK_ATTR_S *pstTask
|
||||
, const FISHEYE_ATTR_S *pstFishEyeAttr, uint8_t *p_tbl, uint8_t *p_idl, uint32_t *tbl_param);
|
||||
|
||||
/**
|
||||
* @brief set meshsize for GDC
|
||||
*
|
||||
* @param nMeshHor(In), mesh counts horizontal
|
||||
* @param nMeshVer(In), mesh counts vertical
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_SetMeshSize(int nMeshHor, int nMeshVer);
|
||||
|
||||
/**
|
||||
* @brief gen GDC LDC(Lens Distortion Correction) mesh table
|
||||
*
|
||||
* @param u32Width(In), mesh region width
|
||||
* @param u32Height(In), mesh region height
|
||||
* @param pstLDCAttr(In), GDC LDC attribute
|
||||
* @param pu64PhyAddr(Out), mesh table physical addr in memory
|
||||
* @param ppVirAddr(Out), mesh table virtual addr in memory
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_GenLDCMesh(CVI_U32 u32Width, CVI_U32 u32Height, const LDC_ATTR_S *pstLDCAttr
|
||||
, const char *name, CVI_U64 *pu64PhyAddr, CVI_VOID **ppVirAddr);
|
||||
|
||||
CVI_S32 CVI_GDC_LoadLDCMesh(CVI_U32 u32Width, CVI_U32 u32Height, const char *fileNname
|
||||
, const char *tskName, CVI_U64 *pu64PhyAddr, CVI_VOID **ppVirAddr);
|
||||
|
||||
/**
|
||||
* @brief set GDC wrap buf attribute
|
||||
*
|
||||
* @param hHandle(In), handle creat by CVI_GDC_BeginJob
|
||||
* @param pstTask(In), GDC task attribute
|
||||
* @param pstBufWrap(In), GDC wrap buf attribute
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_SetBufWrapAttr(GDC_HANDLE hHandle, const GDC_TASK_ATTR_S *pstTask, const DWA_BUF_WRAP_S *pstBufWrap);
|
||||
|
||||
/**
|
||||
* @brief get GDC wrap buf attribute
|
||||
*
|
||||
* @param hHandle(In), handle creat by CVI_GDC_BeginJob
|
||||
* @param pstTask(In), GDC task attribute
|
||||
* @param pstBufWrap(Out), GDC wrap buf attribute
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_GetBufWrapAttr(GDC_HANDLE hHandle, const GDC_TASK_ATTR_S *pstTask, DWA_BUF_WRAP_S *pstBufWrap);
|
||||
|
||||
/**
|
||||
* @brief dump mesh data for GDC
|
||||
*
|
||||
* @param pMeshDumpAttr(In), mesh dump attribute
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_DumpMesh(MESH_DUMP_ATTR_S *pMeshDumpAttr);
|
||||
|
||||
/**
|
||||
* @brief load mesh for GDC, mesh data is load from user
|
||||
*
|
||||
* @param pMeshDumpAttr(In), mesh dump attribute
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed
|
||||
*/
|
||||
CVI_S32 CVI_GDC_LoadMesh(MESH_DUMP_ATTR_S *pMeshDumpAttr);
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __CVI_GDC_H__ */
|
||||
962
middleware/v2/include/cvi_ive.h
Normal file
962
middleware/v2/include/cvi_ive.h
Normal file
@@ -0,0 +1,962 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: cvi_ive.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __CVI_IVE_H__
|
||||
#define __CVI_IVE_H__
|
||||
|
||||
#include "linux/cvi_type.h"
|
||||
#include "linux/cvi_comm_ive.h"
|
||||
#include "linux/cvi_comm_video.h"
|
||||
#ifndef UNUSED
|
||||
#define UNUSED(x) ((void)(x))
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
extern __attribute__((weak)) void *__dso_handle;
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
CVI_S32 CVI_IVE_CompareIveImage(IVE_IMAGE_S *pstImage1, IVE_IMAGE_S *pstImage2);
|
||||
CVI_S32 CVI_IVE_CompareIveMem(IVE_MEM_INFO_S *pstMem1, IVE_MEM_INFO_S *pstMem2);
|
||||
CVI_S32 CVI_IVE_CompareIveData(IVE_DATA_S *pstData1, IVE_DATA_S *pstData2);
|
||||
CVI_S32 CVI_IVE_CompareSADImage(IVE_IMAGE_S *pstImage1, IVE_IMAGE_S *pstImage2,
|
||||
IVE_SAD_MODE_E mode, CVI_BOOL isDMAhalf);
|
||||
|
||||
/**
|
||||
* @brief Create ive instance.
|
||||
* @return Ive instance handler.
|
||||
*/
|
||||
IVE_HANDLE CVI_IVE_CreateHandle();
|
||||
|
||||
/**
|
||||
* @brief Destroy ive instance.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_DestroyHandle(IVE_HANDLE pIveHandle);
|
||||
|
||||
/**
|
||||
* @brief IVE_IMAGE_S to VIDEO_FRAME_INFO_S.
|
||||
*
|
||||
* @param pstIISrc Input IVE_IMAGE_S.
|
||||
* @param pstVFIDst Output VIDEO_FRAME_INFO_S.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Image2VideoFrameInfo(IVE_IMAGE_S *pstIISrc, VIDEO_FRAME_INFO_S *pstVFIDst);
|
||||
|
||||
/**
|
||||
* @brief VIDEO_FRAME_INFO_S to IVE_IMAGE_S.
|
||||
*
|
||||
* @param pstVFISrc Input VIDEO_FRAME_INFO_S.
|
||||
* @param pstIIDst Output IVE_IMAGE_S.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_VideoFrameInfo2Image(VIDEO_FRAME_INFO_S *pstVFISrc, IVE_IMAGE_S *pstIIDst);
|
||||
|
||||
/**
|
||||
* @brief Set IVE_IMAGE_S content.
|
||||
*
|
||||
* @param pstImage IVE_IMAGE_S structure.
|
||||
* @param val input value.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_ResetImage(IVE_IMAGE_S *pstImage, CVI_U8 val);
|
||||
|
||||
/**
|
||||
* @brief Create IVE_IMAGE_S structure, read from memory.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstImg IVE_IMAGE_S structure.
|
||||
* @param pBuffer Data array.
|
||||
* @param enType Set image format
|
||||
* @param u16Width Set width.
|
||||
* @param u16Height Set Height.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_ReadImageArray(IVE_HANDLE pIveHandle, IVE_IMAGE_S *pstImg,
|
||||
char *pBuffer, IVE_IMAGE_TYPE_E enType,
|
||||
CVI_U16 u16Width, CVI_U16 u16Height);
|
||||
|
||||
/**
|
||||
* @brief Create IVE_IMAGE_S structure, read from file.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstImg IVE_IMAGE_S structure.
|
||||
* @param filename Read file name.
|
||||
* @param enType Set image format
|
||||
* @param u16Width Set width.
|
||||
* @param u16Height Set Height.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_ReadRawImage(IVE_HANDLE pIveHandle, IVE_IMAGE_S *pstImg,
|
||||
const char *filename, IVE_IMAGE_TYPE_E enType,
|
||||
CVI_U16 u16Width, CVI_U16 u16Height);
|
||||
|
||||
/**
|
||||
* @brief Read an image from file system. Default is in the order of RGB.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param filename Read png file name.
|
||||
* @param enType Type of the destination image.
|
||||
* @return IVE_IMAGE_S Return IVE_IMAGE_S.
|
||||
*/
|
||||
IVE_IMAGE_S CVI_IVE_ReadImage(IVE_HANDLE pIveHandle, const char *filename,
|
||||
IVE_IMAGE_TYPE_E enType);
|
||||
/**
|
||||
* @brief Create IVE_MEM_INFO_S structure, read from memory.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstMem IVE_MEM_INFO_S structure.
|
||||
* @param pBuffer Data array.
|
||||
* @param uSize Set ion alloc size.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_ReadMemArray(IVE_HANDLE pIveHandle, IVE_MEM_INFO_S *pstMem,
|
||||
char *pBuffer, CVI_U32 uSize);
|
||||
|
||||
/**
|
||||
* @brief Create IVE_MEM_INFO_S structure, read from file.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstMem IVE_MEM_INFO_S structure.
|
||||
* @param filename Read file name.
|
||||
* @param uSize Set ion alloc size.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_ReadMem(IVE_HANDLE pIveHandle, IVE_MEM_INFO_S *pstMem,
|
||||
const char *filename, CVI_U32 uSize);
|
||||
|
||||
/**
|
||||
* @brief Create IVE_DATA_S structure, read from memory.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstData IVE_DATA_S structure.
|
||||
* @param pBuffer Data array.
|
||||
* @param u16Width Set width.
|
||||
* @param u16Height Set Height.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_ReadDataArray(IVE_HANDLE pIveHandle, IVE_DATA_S *pstData,
|
||||
char *pBuffer, CVI_U16 u16Width,
|
||||
CVI_U16 u16Height);
|
||||
|
||||
/**
|
||||
* @brief Create IVE_DATA_S structure, read from file.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstData IVE_DATA_S structure.
|
||||
* @param filename Read file name.
|
||||
* @param u16Width Set width.
|
||||
* @param u16Height Set Height.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_ReadData(IVE_HANDLE pIveHandle, IVE_DATA_S *pstData,
|
||||
const char *filename, CVI_U16 u16Width,
|
||||
CVI_U16 u16Height);
|
||||
|
||||
/**
|
||||
* @brief Create IVE_MEM_INFO_S structure, get ion memory.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstDataInfo IVE_MEM_INFO_S structure.
|
||||
* @param u32ByteSize Set ion alloc size.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_CreateMemInfo(IVE_HANDLE pIveHandle, IVE_MEM_INFO_S *pstMemInfo,
|
||||
CVI_U32 u32ByteSize);
|
||||
|
||||
/**
|
||||
* @brief Create IVE_DATA_S structure, get ion memory.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstDataInfo IVE_DATA_S structure.
|
||||
* @param u16Width Set width.
|
||||
* @param u16Height Set Height.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_CreateDataInfo(IVE_HANDLE pIveHandle, IVE_DATA_S *pstDataInfo,
|
||||
CVI_U16 u16Width, CVI_U16 u16Height);
|
||||
|
||||
/**
|
||||
* @brief Create IVE_IMAGE_S structure, get ion memory.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstImg IVE_IMAGE_S structure.
|
||||
* @param enType Set image format.
|
||||
* @param u16Width Set width.
|
||||
* @param u16Height Set Height.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_CreateImage(IVE_HANDLE pIveHandle, IVE_IMAGE_S *pstImg,
|
||||
IVE_IMAGE_TYPE_E enType, uint16_t u16Width,
|
||||
uint16_t u16Height);
|
||||
|
||||
/**
|
||||
* @brief Create IVE_IMAGE_S structure, get ion cache memory.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstImg IVE_IMAGE_S structure.
|
||||
* @param enType Set image format.
|
||||
* @param u16Width Set width.
|
||||
* @param u16Height Set Height.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_CreateImage_Cached(IVE_HANDLE pIveHandle, IVE_IMAGE_S *pstImg,
|
||||
IVE_IMAGE_TYPE_E enType, uint16_t u32Width,
|
||||
uint16_t u32Height);
|
||||
|
||||
/**
|
||||
* @brief Flush IVE_IMAGE_S cache memory.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstImg IVE_IMAGE_S structure.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_BufFlush(IVE_HANDLE pIveHandle, IVE_IMAGE_S *pstImg);
|
||||
|
||||
/**
|
||||
* @brief Invalidate IVE_IMAGE_S cache memory.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstImg IVE_IMAGE_S structure.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_BufRequest(IVE_HANDLE pIveHandle, IVE_IMAGE_S *pstImg);
|
||||
|
||||
/**
|
||||
* @brief Write to file.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param filename Filename to save.
|
||||
* @param pstMem Save IVE_DATA_S content.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_WriteData(IVE_HANDLE pIveHandle, const char *filename,
|
||||
IVE_DATA_S *pstData);
|
||||
|
||||
/**
|
||||
* @brief Write to raw data.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param filename Filename to save.
|
||||
* @param pstMem Save IVE_IMAGE_S content.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_WriteImg(IVE_HANDLE pIveHandle, const char *filename,
|
||||
IVE_IMAGE_S *pstImg);
|
||||
|
||||
/**
|
||||
* @brief Write to png file.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param filename Filename to save.
|
||||
* @param pstMem Save IVE_IMAGE_S content.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_WriteImage(IVE_HANDLE pIveHandle, const char *filename,
|
||||
IVE_IMAGE_S *pstImg);
|
||||
|
||||
/**
|
||||
* @brief Write to file.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param filename Filename to save.
|
||||
* @param pstMem Save IVE_MEM_INFO_S content.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_WriteMem(IVE_HANDLE pIveHandle, const char *filename,
|
||||
IVE_MEM_INFO_S *pstMem);
|
||||
|
||||
/**
|
||||
* @brief Free ION memory.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstImg Free struct in IVE_IMAGE_S.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_FreeI(IVE_HANDLE pIveHandle, IVE_IMAGE_S *pstImg);
|
||||
|
||||
/**
|
||||
* @brief Free ION memory.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstMem Free struct in IVE_MEM_INFO_S.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_FreeM(IVE_HANDLE pIveHandle, IVE_MEM_INFO_S *pstMem);
|
||||
|
||||
/**
|
||||
* @brief Free ION memory.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstData Free struct in IVE_DATA_S.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_FreeD(IVE_HANDLE pIveHandle, IVE_DATA_S *pstData);
|
||||
|
||||
/**
|
||||
* @brief Reset ive register to default.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param select reset ive module noumber.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_RESET(IVE_HANDLE pIveHandle, int select);
|
||||
|
||||
/**
|
||||
* @brief Dump ive register log.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_DUMP(IVE_HANDLE pIveHandle);
|
||||
|
||||
/**
|
||||
* @brief Split the DiffFg of BgModel result to yuv images.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstDiffFg Input image type is IVE_IMAGE_TYPE_S16C1.
|
||||
* @param pstBgDiffFg Output image type is IVE_IMAGE_TYPE_S8C1.
|
||||
* @param pstFrmDiffFg Output image type is IVE_IMAGE_TYPE_S8C1
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_DiffFg_Split(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstDiffFg,
|
||||
IVE_DST_IMAGE_S *pstBgDiffFg,
|
||||
IVE_DST_IMAGE_S *pstFrmDiffFg);
|
||||
|
||||
/**
|
||||
* @brief Split the ChgSta of BgModel result to yuv images.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstChgSta Input image type is IVE_IMAGE_TYPE_U32C1.
|
||||
* @param pstChgStaImg Output image type is IVE_IMAGE_TYPE_U8C1.
|
||||
* @param pstChgStaFg Output image type is IVE_IMAGE_TYPE_U8C1
|
||||
* @param pstChStaLift Output image type is IVE_IMAGE_TYPE_U16C1.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_ChgSta_Split(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstChgSta,
|
||||
IVE_DST_IMAGE_S *pstChgStaImg,
|
||||
IVE_DST_IMAGE_S *pstChgStaFg,
|
||||
IVE_DST_IMAGE_S *pstChStaLift);
|
||||
|
||||
/**
|
||||
* @brief Queries the completion status of an existing task.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pbFinidh Output Pointer to the task completion status. It cannot be null.
|
||||
* @param bBlock Input Flag indicating whether a task is blocked.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_QUERY(IVE_HANDLE pIveHandle, CVI_BOOL *pbFinish,
|
||||
CVI_BOOL bBlock);
|
||||
|
||||
/**
|
||||
* @brief DMA one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input data.
|
||||
* @param pstDst Output dma result.
|
||||
* @param pstCtrl DMA parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_DMA(IVE_HANDLE pIveHandle, IVE_DATA_S *pstSrc,
|
||||
IVE_DST_DATA_S *pstDst, IVE_DMA_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief AND two images and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc1 Input image 1.
|
||||
* @param pstSrc2 Input image 2.
|
||||
* @param pstDst Output result.
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_And(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
|
||||
IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_IMAGE_S *pstDst,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief OR two images and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc1 Input image 1.
|
||||
* @param pstSrc2 Input image 2.
|
||||
* @param pstDst Output result.
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Or(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
|
||||
IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_IMAGE_S *pstDst,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief XOR two images and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc1 Input image 1.
|
||||
* @param pstSrc2 Input image 2.
|
||||
* @param pstDst Output result.
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Xor(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
|
||||
IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_IMAGE_S *pstDst,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief ADD two image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc1 Input image 1.
|
||||
* @param pstSrc2 Input image 2.
|
||||
* @param pstDst Output result.
|
||||
* @param pstCtrl Add control parameter.
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Add(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
|
||||
IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_IMAGE_S *pstDst,
|
||||
IVE_ADD_CTRL_S *pstCtrl, CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Subtract two images and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc1 Input image 1.
|
||||
* @param pstSrc2 Input image 2.
|
||||
* @param pstDst Output result.
|
||||
* @param pstCtrl Subtract control parameter.
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Sub(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
|
||||
IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_IMAGE_S *pstDst,
|
||||
IVE_SUB_CTRL_S *pstCtrl, CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Threshold one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output thresh result.
|
||||
* @param pstCtrl Thresh parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Thresh(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst, IVE_THRESH_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Dilate one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output dilate result.
|
||||
* @param pstCtrl Dilate parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Dilate(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst, IVE_DILATE_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Erode one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output erode result.
|
||||
* @param pstCtrl Erode parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Erode(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst, IVE_ERODE_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief MatchBgModel.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstCurImg Input image.
|
||||
* @param pstBgModel Input BgModel.
|
||||
* @param pstFgFlag Input FgFlag.
|
||||
* @param pstDiffFg Output DiffFg.
|
||||
* //@param pstFrmDiffFg Output FrmDiffFg.
|
||||
* @param pstStatData Output StatData.
|
||||
* @param pstCtrl erode parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_MatchBgModel(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstCurImg,
|
||||
IVE_DATA_S *pstBgModel, IVE_IMAGE_S *pstFgFlag,
|
||||
IVE_DST_IMAGE_S *pstDiffFg,
|
||||
IVE_DST_MEM_INFO_S *pstStatData,
|
||||
IVE_MATCH_BG_MODEL_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief UpdateBgModel.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstBgModel Input BgModel.
|
||||
* @param pstFgFlag Input FgFlag
|
||||
* @param pstBgImg Output BgImg
|
||||
* //@param pstChgStaImg Output ChgStaImg
|
||||
* //@param pstChgStaFg Output ChgStaFg
|
||||
* @param pstChgSta Output chg state.
|
||||
* @param pstStatData Output state data.
|
||||
* @param pstCtrl erode parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_UpdateBgModel(IVE_HANDLE pIveHandle, IVE_DATA_S *pstBgModel,
|
||||
IVE_IMAGE_S *pstFgFlag, IVE_DST_IMAGE_S *pstBgImg,
|
||||
IVE_DST_IMAGE_S *pstChgSta,
|
||||
IVE_DST_MEM_INFO_S *pstStatData,
|
||||
IVE_UPDATE_BG_MODEL_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief GMM.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstFg Output Fg result.
|
||||
* @param pstBg Output Bg result.
|
||||
* @param pstCtrl GMM parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_GMM(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstFg, IVE_DST_IMAGE_S *pstBg,
|
||||
IVE_MEM_INFO_S *pstModel, IVE_GMM_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief GMM2.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstFactor Input image factor.
|
||||
* @param pstFg Output Fg result.
|
||||
* @param pstBg Output Bg result.
|
||||
* @param pstMatchModelInfo Output MatchModelInfo.
|
||||
* @param pstModel Output model
|
||||
* @param pstCtrl GMM2 parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_GMM2(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_SRC_IMAGE_S *pstFactor, IVE_DST_IMAGE_S *pstFg,
|
||||
IVE_DST_IMAGE_S *pstBg, IVE_DST_IMAGE_S *pstMatchModelInfo,
|
||||
IVE_MEM_INFO_S *pstModel, IVE_GMM2_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Bernsen one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output erode result.
|
||||
* @param pstCtrl Bernsen parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Bernsen(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst, IVE_BERNSEN_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Filter one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output filter result.
|
||||
* @param pstCtrl Filter parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Filter(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst, IVE_FILTER_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Sobel one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDstH Output Horizontal result.
|
||||
* @param pstDstV Output Vertical result.
|
||||
* @param pstCtrl Sobel parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Sobel(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDstH, IVE_DST_IMAGE_S *pstDstV,
|
||||
IVE_SOBEL_CTRL_S *pstCtrl, CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief MagAndAng one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDstMag Output Mag result.
|
||||
* @param pstDstAmg Output Ang result.
|
||||
* @param pstCtrl MagAndAng parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_MagAndAng(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDstMag,
|
||||
IVE_DST_IMAGE_S *pstDstAng,
|
||||
IVE_MAG_AND_ANG_CTRL_S *pstCtrl, CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief CSC one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output CSC result.
|
||||
* @param pstCtrl CSC parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_CSC(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst, IVE_CSC_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief FilterAndCSC one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output FilterAndCSC result.
|
||||
* @param pstCtrl FilterAndCSC parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_FilterAndCSC(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst,
|
||||
IVE_FILTER_AND_CSC_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Histogram one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output Histogram result.
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Hist(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_MEM_INFO_S *pstDst, CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief MAP one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output Map result.
|
||||
* @param pstCtrl Map parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Map(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_SRC_MEM_INFO_S *pstMap, IVE_DST_IMAGE_S *pstDst,
|
||||
IVE_MAP_CTRL_S *pstCtrl, CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief NCC two images and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc1 Input image 1.
|
||||
* @param pstSrc2 Input image 2.
|
||||
* @param pstDst Output NCC result.
|
||||
* @param pstCtrl NCC parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_NCC(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
|
||||
IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_MEM_INFO_S *pstDst,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Integrogram one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output Integrogram result.
|
||||
* @param pstCtrl Integ parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Integ(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_MEM_INFO_S *pstDst, IVE_INTEG_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief LBP one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output LBP result.
|
||||
* @param pstCtrl LBP parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_LBP(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst, IVE_LBP_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Thresh_S16 one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output result.
|
||||
* @param pstCtrl Thresh_S16 parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Thresh_S16(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst,
|
||||
IVE_THRESH_S16_CTRL_S *pstCtrl, CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Thresh_U16 one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output result.
|
||||
* @param pstCtrl Thresh_U16 parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Thresh_U16(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst,
|
||||
IVE_THRESH_U16_CTRL_S *pstCtrl, CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief 16BitTo8Bit one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output result.
|
||||
* @param pstCtrl 16BitTo8Bit parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_16BitTo8Bit(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst,
|
||||
IVE_16BIT_TO_8BIT_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief OrdStatFilter one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output result.
|
||||
* @param pstCtrl OrdStatFilter parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_OrdStatFilter(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst,
|
||||
IVE_ORD_STAT_FILTER_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief CannyEdge one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstEdge Output result.
|
||||
* @param pstCtrl CannyHysEdge parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
//CVI_S32 CVI_IVE_CannyEdge(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
// IVE_DST_IMAGE_S *pstEdge,
|
||||
// IVE_CANNY_HYS_EDGE_CTRL_S *pstCtrl, CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief CannyEdge one input image and output the result.
|
||||
*
|
||||
* @param pstEdge Input/Output.
|
||||
* @param pstStack Input/Output.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_CannyEdge(IVE_IMAGE_S *pstEdge, IVE_MEM_INFO_S *pstStack);
|
||||
|
||||
/**
|
||||
* @brief CannyHysEdge one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstEdge Output result.
|
||||
* @param pstStack Output result.
|
||||
* @param pstCtrl CannyHysEdge parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_CannyHysEdge(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstEdge,
|
||||
IVE_DST_MEM_INFO_S *pstStack,
|
||||
IVE_CANNY_HYS_EDGE_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief NormGrad one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDstH Output result.
|
||||
* @param pstDstV Output result.
|
||||
* @param pstDstHV Output result.
|
||||
* @param pstCtrl NormGrad parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_NormGrad(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDstH, IVE_DST_IMAGE_S *pstDstV,
|
||||
IVE_DST_IMAGE_S *pstDstHV,
|
||||
IVE_NORM_GRAD_CTRL_S *pstCtrl, CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief GradFg.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstBgDiffFg Input BgDiffFg image.
|
||||
* @param pstCurGrad Input CurGrad image.
|
||||
* @param pstBgGrad Input BgGrad image.
|
||||
* @param pstGradFg Output result.
|
||||
* @param pstCtrl GradFg parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_GradFg(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstBgDiffFg,
|
||||
IVE_SRC_IMAGE_S *pstCurGrad, IVE_SRC_IMAGE_S *pstBgGrad,
|
||||
IVE_DST_IMAGE_S *pstGradFg, IVE_GRAD_FG_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief SAD two images and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc1 Input image.
|
||||
* @param pstSrc2 Input image.
|
||||
* @param pstSad Output result.
|
||||
* @param pstCtrl SAD parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_SAD(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
|
||||
IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_IMAGE_S *pstSad,
|
||||
IVE_DST_IMAGE_S *pstThr, IVE_SAD_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Resize one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param astSrc Input images.
|
||||
* @param astDst Output images.
|
||||
* @param pstCtrl Resize parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_Resize(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S astSrc[],
|
||||
IVE_DST_IMAGE_S astDst[], IVE_RESIZE_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief imgInToOdma one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output image.
|
||||
* @param pstCtrl imgInToOdma parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_imgInToOdma(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst, IVE_FILTER_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief rgbPToYuvToErodeToDilate one input image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input images.
|
||||
* @param pstDst Output image.
|
||||
* @param pstDst2 Output image.
|
||||
* @param pstCtrl rgbPToYuvToErodeToDilate parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_rgbPToYuvToErodeToDilate(IVE_HANDLE pIveHandle,
|
||||
IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst1,
|
||||
IVE_DST_IMAGE_S *pstDst2,
|
||||
IVE_FILTER_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief STCandiCorner image and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc Input image.
|
||||
* @param pstDst Output image.
|
||||
* @param pstCtrl STCandiCorner parameter
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_STCandiCorner(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
|
||||
IVE_DST_IMAGE_S *pstDst,
|
||||
IVE_ST_CANDI_CORNER_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
|
||||
/**
|
||||
* @brief Frame Diff Motion two images and output the result.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @param pstSrc1 Input image 1.
|
||||
* @param pstSrc2 Input image 2.
|
||||
* @param pstDst Output result.
|
||||
* @param pstCtrl FrameDiffMotion control parameter.
|
||||
* @param bInstant Dummy variable.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_FrameDiffMotion(IVE_HANDLE pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
|
||||
IVE_SRC_IMAGE_S *pstSrc2,
|
||||
IVE_DST_IMAGE_S *pstDst,
|
||||
IVE_FRAME_DIFF_MOTION_CTRL_S *pstCtrl,
|
||||
CVI_BOOL bInstant);
|
||||
/**
|
||||
* @brief CMDQ.
|
||||
*
|
||||
* @param pIveHandle Ive instance handler.
|
||||
* @return CVI_S32 CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_IVE_CMDQ(IVE_HANDLE pIveHandle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif // __CVI_IVE_H__
|
||||
29
middleware/v2/include/cvi_mipi.h
Normal file
29
middleware/v2/include/cvi_mipi.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_mipi.h
|
||||
* Description:
|
||||
* Common mipi definitions.
|
||||
*/
|
||||
|
||||
#ifndef __CVI_MIPI_H__
|
||||
#define __CVI_MIPI_H__
|
||||
|
||||
#include <linux/cvi_common.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
typedef unsigned int combo_dev_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __CVI_MIPI_H__ */
|
||||
|
||||
84
middleware/v2/include/cvi_misc.h
Normal file
84
middleware/v2/include/cvi_misc.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2022. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_misc.h
|
||||
* Description:
|
||||
* MMF Programe Interface for system
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __CVI_MISC_H__
|
||||
#define __CVI_MISC_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#include "cvi_debug.h"
|
||||
|
||||
typedef enum {
|
||||
CVI_EFUSE_AREA_USER,
|
||||
CVI_EFUSE_AREA_DEVICE_ID,
|
||||
CVI_EFUSE_AREA_HASH0_PUBLIC,
|
||||
CVI_EFUSE_AREA_LOADER_EK,
|
||||
CVI_EFUSE_AREA_DEVICE_EK,
|
||||
CVI_EFUSE_AREA_CHIP_SN,
|
||||
CVI_EFUSE_AREA_LAST
|
||||
} CVI_EFUSE_AREA_E;
|
||||
|
||||
typedef enum {
|
||||
CVI_EFUSE_LOCK_HASH0_PUBLIC,
|
||||
CVI_EFUSE_LOCK_LOADER_EK,
|
||||
CVI_EFUSE_LOCK_DEVICE_EK,
|
||||
CVI_EFUSE_LOCK_LAST
|
||||
} CVI_EFUSE_LOCK_E;
|
||||
|
||||
CVI_S32 CVI_MISC_GetChipSNSize(CVI_U32 *pu32SNSize);
|
||||
CVI_S32 CVI_MISC_GetChipSN(CVI_U8 *pu8SN, CVI_U32 u32SNSize);
|
||||
|
||||
CVI_S32 CVI_MISC_StartPMThread(void);
|
||||
CVI_S32 CVI_MISC_StopPMThread(void);
|
||||
/** <!-- [EFUSE] */
|
||||
CVI_S32 CVI_EFUSE_GetSize(CVI_EFUSE_AREA_E area, CVI_U32 *size);
|
||||
CVI_S32 CVI_EFUSE_Read(CVI_EFUSE_AREA_E area, CVI_U8 *buf, CVI_U32 buf_size);
|
||||
CVI_S32 CVI_EFUSE_Write(CVI_EFUSE_AREA_E area, const CVI_U8 *buf, CVI_U32 buf_size);
|
||||
CVI_S32 CVI_EFUSE_EnableSecureBoot(void);
|
||||
CVI_S32 CVI_EFUSE_IsSecureBootEnabled(void);
|
||||
CVI_S32 CVI_EFUSE_EnableFastBoot(void);
|
||||
CVI_S32 CVI_EFUSE_IsFastBootEnabled(void);
|
||||
/**
|
||||
* @brief Lock eFuse area for both READING and WRITING.
|
||||
*
|
||||
* @param[in] lock - The area to be locked.
|
||||
*
|
||||
* @return CVI_SUCCESS (0) on success.
|
||||
* @return Non-zero error code on failure.
|
||||
*/
|
||||
CVI_S32 CVI_EFUSE_Lock(CVI_EFUSE_LOCK_E lock);
|
||||
CVI_S32 CVI_EFUSE_IsLocked(CVI_EFUSE_LOCK_E lock);
|
||||
/**
|
||||
* @brief Lock eFuse area for WRITING only.
|
||||
*
|
||||
* @param[in] lock - The area to be locked.
|
||||
*
|
||||
* @return CVI_SUCCESS (0) on success.
|
||||
* @return Non-zero error code on failure.
|
||||
*/
|
||||
CVI_S32 CVI_EFUSE_LockWrite(CVI_EFUSE_LOCK_E lock);
|
||||
CVI_S32 CVI_EFUSE_IsWriteLocked(CVI_EFUSE_LOCK_E lock);
|
||||
|
||||
CVI_S32 CVI_MISC_SysSuspend(void);
|
||||
CVI_S32 CVI_MISC_SysResume(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /*__CVI_SYS_H__ */
|
||||
|
||||
62
middleware/v2/include/cvi_osdc.h
Normal file
62
middleware/v2/include/cvi_osdc.h
Normal file
@@ -0,0 +1,62 @@
|
||||
#ifndef __CVI_OSDC_H__
|
||||
#define __CVI_OSDC_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <cvi_comm_osdc.h>
|
||||
|
||||
uint32_t CVI_OSDC_EstCmprCanvasSize(OSDC_Canvas_Attr_S * canvas, OSDC_DRAW_OBJ_S * objs, uint32_t obj_num);
|
||||
|
||||
int CVI_OSDC_DrawCmprCanvas(OSDC_Canvas_Attr_S *canvas, OSDC_DRAW_OBJ_S *objs, uint32_t obj_num,
|
||||
uint8_t *obuf, uint32_t buf_size, uint32_t *p_osize);
|
||||
|
||||
void CVI_OSDC_SetRectObjAttr(OSDC_Canvas_Attr_S *canvas, OSDC_DRAW_OBJ_S *obj, uint32_t color_code,
|
||||
int pt_x, int pt_y, int width, int height, bool is_filled, int thickness);
|
||||
|
||||
void CVI_OSDC_SetRectObjAttrEx(OSDC_Canvas_Attr_S *canvas, OSDC_DRAW_OBJ_S *obj, uint32_t color_code,
|
||||
OSDC_RECT_ATTR_S *rects, int num, bool is_filled);
|
||||
|
||||
void CVI_OSDC_SetBitmapObjAttr(OSDC_Canvas_Attr_S *canvas, OSDC_DRAW_OBJ_S *obj_attr, uint8_t *buf,
|
||||
int pt_x, int pt_y, int width, int height, bool is_cmpr);
|
||||
|
||||
void CVI_OSDC_SetLineObjAttr(OSDC_Canvas_Attr_S *canvas, OSDC_DRAW_OBJ_S *obj, uint32_t color_code,
|
||||
int pt_x0, int pt_y0, int pt_x1, int pt_y1, int thickness);
|
||||
|
||||
void CVI_OSDC_SetLineObjAttrEx(OSDC_Canvas_Attr_S *canvas, OSDC_DRAW_OBJ_S *obj, uint32_t color_code,
|
||||
OSDC_POINT_ATTR_S *points, int num, int thickness);
|
||||
|
||||
int CVI_OSDC_CmprBitmap(OSDC_Canvas_Attr_S *canvas, uint8_t *ibuf, uint8_t *obuf, int width, int height,
|
||||
int buf_size, uint32_t *p_osize);
|
||||
|
||||
extern uint32_t CVI_OSDC_est_cmpr_canvas_size(OSDC_Canvas_Attr_S *canvas, OSDC_DRAW_OBJ_S *objs, uint32_t obj_num);
|
||||
|
||||
extern int CVI_OSDC_draw_cmpr_canvas(OSDC_Canvas_Attr_S *canvas, OSDC_DRAW_OBJ_S *objs, uint32_t obj_num,
|
||||
uint8_t *obuf, uint32_t buf_size, uint32_t *p_osize);
|
||||
|
||||
extern void CVI_OSDC_set_rect_obj_attr(OSDC_Canvas_Attr_S *canvas, OSDC_DRAW_OBJ_S *obj, uint32_t color_code,
|
||||
int pt_x, int pt_y, int width, int height, bool is_filled, int thickness);
|
||||
|
||||
extern void CVI_OSDC_set_bitmap_obj_attr(OSDC_Canvas_Attr_S *canvas, OSDC_DRAW_OBJ_S *obj_attr, uint8_t *buf,
|
||||
int pt_x, int pt_y, int width, int height, bool is_cmpr);
|
||||
|
||||
extern void CVI_OSDC_set_line_obj_attr(OSDC_Canvas_Attr_S *canvas, OSDC_DRAW_OBJ_S *obj, uint32_t color_code,
|
||||
int pt_x0, int pt_y0, int pt_x1, int pt_y1, int thickness);
|
||||
|
||||
extern int CVI_OSDC_cmpr_bitmap(OSDC_Canvas_Attr_S *canvas, uint8_t *ibuf, uint8_t *obuf, int width, int height,
|
||||
int buf_size, uint32_t *p_osize);
|
||||
#if (CMPR_CANVAS_DBG)
|
||||
int CVI_OSDC_draw_canvas_raw_buffer(OSDC_Canvas_Attr_S &canvas, vector<DRAW_OBJ> obj_vec, uint8_t *obuf);
|
||||
int CVI_OSDC_draw_canvas_raw_buffer2(OSDC_Canvas_Attr_S &canvas, vector<DRAW_OBJ> obj_vec, uint8_t *obuf);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*__CVI_OSDC_H__ */
|
||||
147
middleware/v2/include/cvi_region.h
Normal file
147
middleware/v2/include/cvi_region.h
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_region.h
|
||||
* Description:
|
||||
* region Interface
|
||||
*/
|
||||
|
||||
#ifndef __CVI_REGION_H__
|
||||
#define __CVI_REGION_H__
|
||||
|
||||
#include <linux/cvi_comm_region.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Create RGN.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @param pstRegion(In), region attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_Create(RGN_HANDLE Handle, const RGN_ATTR_S *pstRegion);
|
||||
|
||||
/**
|
||||
* @brief Destroy RGN.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_Destroy(RGN_HANDLE Handle);
|
||||
|
||||
/**
|
||||
* @brief Get region attribute.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @param pstRegion(Out), region attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_GetAttr(RGN_HANDLE Handle, RGN_ATTR_S *pstRegion);
|
||||
|
||||
/**
|
||||
* @brief Set region attribute.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @param pstRegion(In), region attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_SetAttr(RGN_HANDLE Handle, const RGN_ATTR_S *pstRegion);
|
||||
|
||||
/**
|
||||
* @brief Set bitmap.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @param pstBitmap(In), bitmap of overlay.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_SetBitMap(RGN_HANDLE Handle, const BITMAP_S *pstBitmap);
|
||||
|
||||
/**
|
||||
* @brief region apply to chn.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @param pstChn(In), module chn.
|
||||
* @param pstChnAttr(In), chn attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_AttachToChn(RGN_HANDLE Handle, const MMF_CHN_S *pstChn, const RGN_CHN_ATTR_S *pstChnAttr);
|
||||
|
||||
/**
|
||||
* @brief cancel region on chn.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @param pstChn(In), module chn.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_DetachFromChn(RGN_HANDLE Handle, const MMF_CHN_S *pstChn);
|
||||
|
||||
/**
|
||||
* @brief Set display attribute to chn.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @param pstChn(In), module chn.
|
||||
* @param pstChnAttr(In), chn attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_SetDisplayAttr(RGN_HANDLE Handle, const MMF_CHN_S *pstChn, const RGN_CHN_ATTR_S *pstChnAttr);
|
||||
|
||||
/**
|
||||
* @brief Get display attribute from chn.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @param pstChn(In), module chn.
|
||||
* @param pstChnAttr(Out), chn attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_GetDisplayAttr(RGN_HANDLE Handle, const MMF_CHN_S *pstChn, RGN_CHN_ATTR_S *pstChnAttr);
|
||||
|
||||
/**
|
||||
* @brief Get canvas info.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @param pstCanvasInfo(In), canvas info.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_GetCanvasInfo(RGN_HANDLE Handle, RGN_CANVAS_INFO_S *pstCanvasInfo);
|
||||
|
||||
/**
|
||||
* @brief Update canvas.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_UpdateCanvas(RGN_HANDLE Handle);
|
||||
|
||||
/**
|
||||
* @brief Get display attribute from chn.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @param pstChn(In), module chn.
|
||||
* @param pu32Color(In), color.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_Invert_Color(RGN_HANDLE Handle, MMF_CHN_S *pstChn, CVI_U32 *pu32Color);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Set Palette for LUT.
|
||||
*
|
||||
* @param Handle(In), RGN ID.
|
||||
* @param pstChn(In), module chn.
|
||||
* @param pstPalette(In), Palette info.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_RGN_SetChnPalette(RGN_HANDLE Handle, const MMF_CHN_S *pstChn, RGN_PALETTE_S *pstPalette);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __CVI_REGION_H__ */
|
||||
252
middleware/v2/include/cvi_sns_ctrl.h
Normal file
252
middleware/v2/include/cvi_sns_ctrl.h
Normal file
@@ -0,0 +1,252 @@
|
||||
#ifndef __CVI_SNS_CTRL_H__
|
||||
#define __CVI_SNS_CTRL_H__
|
||||
|
||||
#include <linux/cif_uapi.h>
|
||||
#include <linux/cvi_errno.h>
|
||||
#include <linux/cvi_type.h>
|
||||
#include "cvi_debug.h"
|
||||
#include "cvi_comm_3a.h"
|
||||
#include "cvi_comm_isp.h"
|
||||
#include "cvi_ae_comm.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
typedef struct combo_dev_attr_s SNS_COMBO_DEV_ATTR_S;
|
||||
typedef struct mclk_pll_s SNS_MCLK_ATTR_S;
|
||||
|
||||
typedef struct _SNS_ATTR_S {
|
||||
CVI_U16 u16Min;
|
||||
CVI_U16 u16Max;
|
||||
CVI_U16 u16Def;
|
||||
CVI_U16 u16Step;
|
||||
} SNS_ATTR_S;
|
||||
|
||||
typedef struct _SNS_ATTR_LARGE_S {
|
||||
CVI_U32 u32Min;
|
||||
CVI_U32 u32Max;
|
||||
CVI_U32 u32Def;
|
||||
CVI_U32 u32Step;
|
||||
} SNS_ATTR_LARGE_S;
|
||||
|
||||
typedef struct _ISP_SNS_STATE_S {
|
||||
CVI_BOOL bInit; /* CVI_TRUE: Sensor init */
|
||||
CVI_BOOL bSyncInit; /* CVI_TRUE: Sync Reg init */
|
||||
CVI_U8 u8ImgMode;
|
||||
CVI_U8 u8Hdr; /* CVI_TRUE: HDR enbale */
|
||||
WDR_MODE_E enWDRMode;
|
||||
|
||||
ISP_SNS_SYNC_INFO_S astSyncInfo[2]; /* [0]: Sensor reg info of cur-frame; [1]: Sensor reg info of pre-frame ; */
|
||||
|
||||
CVI_U32 au32FL[2]; /* [0]: FullLines of cur-frame; [1]: Pre FullLines of pre-frame */
|
||||
CVI_U32 u32FLStd; /* FullLines std */
|
||||
CVI_U32 au32WDRIntTime[4];
|
||||
} ISP_SNS_STATE_S;
|
||||
|
||||
typedef enum _ISP_SNS_MIRRORFLIP_TYPE_E {
|
||||
ISP_SNS_NORMAL = 0,
|
||||
ISP_SNS_MIRROR = 1,
|
||||
ISP_SNS_FLIP = 2,
|
||||
ISP_SNS_MIRROR_FLIP = 3,
|
||||
ISP_SNS_BUTT
|
||||
} ISP_SNS_MIRRORFLIP_TYPE_E;
|
||||
|
||||
typedef enum _ISP_SNS_L2S_MODE_E {
|
||||
SNS_L2S_MODE_AUTO = 0, /* sensor l2s distance varies by the inttime of sef. */
|
||||
SNS_L2S_MODE_FIX, /* sensor l2s distance is fixed. */
|
||||
} ISP_SNS_INTTIME_MODE_E;
|
||||
|
||||
typedef struct _MCLK_ATTR_S {
|
||||
CVI_U8 u8Mclk;
|
||||
CVI_BOOL bMclkEn;
|
||||
} MCLK_ATTR_S;
|
||||
|
||||
typedef struct _RX_INIT_ATTR_S {
|
||||
CVI_U32 MipiDev;
|
||||
CVI_S16 as16LaneId[5];
|
||||
CVI_S8 as8PNSwap[5];
|
||||
MCLK_ATTR_S stMclkAttr;
|
||||
} RX_INIT_ATTR_S;
|
||||
|
||||
typedef enum _SNS_BDG_MUX_MODE_E {
|
||||
SNS_BDG_MUX_NONE = 0, /* sensor bridge mux is disabled */
|
||||
SNS_BDG_MUX_2, /* sensor bridge mux 2 input */
|
||||
SNS_BDG_MUX_3, /* sensor bridge mux 3 input */
|
||||
SNS_BDG_MUX_4, /* sensor bridge mux 4 input */
|
||||
} SNS_BDG_MUX_MODE_E;
|
||||
|
||||
typedef struct _ISP_INIT_ATTR_S {
|
||||
CVI_U32 u32ExpTime;
|
||||
CVI_U32 u32AGain;
|
||||
CVI_U32 u32DGain;
|
||||
CVI_U32 u32ISPDGain;
|
||||
CVI_U32 u32Exposure;
|
||||
CVI_U32 u32LinesPer500ms;
|
||||
CVI_U32 u32PirisFNO;
|
||||
CVI_U16 u16WBRgain;
|
||||
CVI_U16 u16WBGgain;
|
||||
CVI_U16 u16WBBgain;
|
||||
CVI_U16 u16SampleRgain;
|
||||
CVI_U16 u16SampleBgain;
|
||||
CVI_U16 u16UseHwSync;
|
||||
ISP_SNS_GAIN_MODE_E enGainMode;
|
||||
ISP_SNS_INTTIME_MODE_E enL2SMode;
|
||||
SNS_BDG_MUX_MODE_E enSnsBdgMuxMode;
|
||||
} ISP_INIT_ATTR_S;
|
||||
|
||||
typedef struct _ISP_SNS_OBJ_S {
|
||||
CVI_S32 (*pfnRegisterCallback)(VI_PIPE ViPipe, ALG_LIB_S *, ALG_LIB_S *);
|
||||
CVI_S32 (*pfnUnRegisterCallback)(VI_PIPE ViPipe, ALG_LIB_S *, ALG_LIB_S *);
|
||||
CVI_S32 (*pfnSetBusInfo)(VI_PIPE ViPipe, ISP_SNS_COMMBUS_U unSNSBusInfo);
|
||||
CVI_VOID (*pfnStandby)(VI_PIPE ViPipe);
|
||||
CVI_VOID (*pfnRestart)(VI_PIPE ViPipe);
|
||||
CVI_VOID (*pfnMirrorFlip)(VI_PIPE ViPipe, ISP_SNS_MIRRORFLIP_TYPE_E eSnsMirrorFlip);
|
||||
CVI_S32 (*pfnWriteReg)(VI_PIPE ViPipe, CVI_S32 s32Addr, CVI_S32 s32Data);
|
||||
CVI_S32 (*pfnReadReg)(VI_PIPE ViPipe, CVI_S32 s32Addr);
|
||||
CVI_S32 (*pfnSetInit)(VI_PIPE ViPipe, ISP_INIT_ATTR_S *);
|
||||
CVI_S32 (*pfnPatchRxAttr)(RX_INIT_ATTR_S *);
|
||||
CVI_VOID (*pfnPatchI2cAddr)(CVI_S32 s32I2cAddr);
|
||||
CVI_S32 (*pfnGetRxAttr)(VI_PIPE ViPipe, SNS_COMBO_DEV_ATTR_S *);
|
||||
CVI_S32 (*pfnExpSensorCb)(ISP_SENSOR_EXP_FUNC_S *);
|
||||
CVI_S32 (*pfnExpAeCb)(AE_SENSOR_EXP_FUNC_S *);
|
||||
CVI_S32 (*pfnSnsProbe)(VI_PIPE ViPipe);
|
||||
} ISP_SNS_OBJ_S;
|
||||
|
||||
extern ISP_SNS_OBJ_S stSnsBG0808_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsBF2253L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsCV4001_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc02m1b_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc0312_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc0329_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc1054_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc1084_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc1084_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc2053_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc2053_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc2053_1l_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc2083_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc2093_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc2093_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc2145_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc4023_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc4653_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsGc4653_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsMIS2008_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsMIS2008_1L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsN5_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsN6_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsOs02d10_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsOs02d10_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsOs02k10_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsOs04a10_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsOs04c10_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsOs04c10_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsOs08a20_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsOs08a20_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsOv4689_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsOv5647_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsOv6211_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsOv7251_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsPICO384_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsPICO640_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsPR2020_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsPR2100_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC035GS_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC035GS_1L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC035HGS_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC035HGS_1L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC1336_1L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC1346_1L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC1346_1L_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC200AI_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC301IOT_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC401AI_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC500AI_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC501AI_2L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC531AI_2L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC850SL_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC3332_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC3335_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC3335_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC3336_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC3336P_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC2331_1L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC2331_1L_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC2331_1L_Slave1_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC2335_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC2336_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC2336_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC2336_Slave1_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC2336_1L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC2336P_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC2336P_1L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC223A_1L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC4210_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC4336_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC4336P_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC5336_2L_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsSC8238_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsF23_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsF35_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsF35_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsF37P_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsH65_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsK06_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsQ03_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsQ03P_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx290_2l_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx307_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx307_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx307_2l_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx307_Sublvds_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx327_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx327_Slave_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx327_2l_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx327_fpga_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx327_Sublvds_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx334_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx335_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx347_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsImx385_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsTP2850_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsTP2825_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsTP2863_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsMCS369_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsMCS369Q_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsMM308M2_Obj;
|
||||
extern ISP_SNS_OBJ_S stSnsLT6911_Obj;
|
||||
|
||||
#define CMOS_CHECK_POINTER(ptr)\
|
||||
do {\
|
||||
if (ptr == CVI_NULL) {\
|
||||
syslog(LOG_ERR, "Null Pointer!\n");\
|
||||
return CVI_ERR_VI_INVALID_NULL_PTR;\
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define CMOS_CHECK_POINTER_VOID(ptr)\
|
||||
do {\
|
||||
if (ptr == CVI_NULL) {\
|
||||
syslog(LOG_ERR, "Null Pointer!\n");\
|
||||
return;\
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define SENSOR_FREE(ptr)\
|
||||
do {\
|
||||
if (ptr != CVI_NULL) {\
|
||||
free(ptr);\
|
||||
ptr = CVI_NULL;\
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* __CVI_SNS_CTRL_H__ */
|
||||
353
middleware/v2/include/cvi_sys.h
Normal file
353
middleware/v2/include/cvi_sys.h
Normal file
@@ -0,0 +1,353 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_sys.h
|
||||
* Description:
|
||||
* MMF Programe Interface for system
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __CVI_SYS_H__
|
||||
#define __CVI_SYS_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "cvi_debug.h"
|
||||
#include <linux/cvi_comm_sys.h>
|
||||
#include <linux/cvi_type.h>
|
||||
#include <linux/cvi_common.h>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief system initialization.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_Init(void);
|
||||
|
||||
/**
|
||||
* @brief system exit.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_Exit(void);
|
||||
|
||||
/**
|
||||
* @brief Open vi device.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_VI_Open(void);
|
||||
|
||||
/**
|
||||
* @brief Close vi device.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_VI_Close(void);
|
||||
|
||||
/**
|
||||
* @brief Bind the two channels.
|
||||
*
|
||||
* @param pstSrcChn(In), source channel.
|
||||
* @param pstDestChn(In), destination channel.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_Bind(const MMF_CHN_S *pstSrcChn, const MMF_CHN_S *pstDestChn);
|
||||
|
||||
/**
|
||||
* @brief UnBind the two channels.
|
||||
*
|
||||
* @param pstSrcChn(In), source channel.
|
||||
* @param pstDestChn(In), destination channel.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_UnBind(const MMF_CHN_S *pstSrcChn, const MMF_CHN_S *pstDestChn);
|
||||
|
||||
/**
|
||||
* @brief Get source channel by destination channel.
|
||||
*
|
||||
* @param pstDestChn(In), destination channel.
|
||||
* @param pstSrcChn(Out), source channel.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_GetBindbyDest(const MMF_CHN_S *pstDestChn, MMF_CHN_S *pstSrcChn);
|
||||
|
||||
/**
|
||||
* @brief Get destination channel by source channel.
|
||||
*
|
||||
* @param pstSrcChn(In), source channel.
|
||||
* @param pstDestChn(Out), all destination channels.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_GetBindbySrc(const MMF_CHN_S *pstSrcChn, MMF_BIND_DEST_S *pstBindDest);
|
||||
|
||||
/**
|
||||
* @brief Get MMF version.
|
||||
*
|
||||
* @param pstVersion(Out), version info.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_GetVersion(MMF_VERSION_S *pstVersion);
|
||||
|
||||
/**
|
||||
* @brief Get chip ID.
|
||||
*
|
||||
* @param pu32ChipId(Out), chip ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_GetChipId(CVI_U32 *pu32ChipId);
|
||||
|
||||
/**
|
||||
* @brief Get chip version.
|
||||
*
|
||||
* @param pu32ChipVersion(Out), chip version.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_GetChipVersion(CVI_U32 *pu32ChipVersion);
|
||||
|
||||
/**
|
||||
* @brief Get the startup reason.
|
||||
*
|
||||
* @param pu32PowerOnReason(Out), reason.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_GetPowerOnReason(CVI_U32 *pu32PowerOnReason);
|
||||
|
||||
/**
|
||||
* @brief Gets the current timestamp.
|
||||
*
|
||||
* @param pu64CurPTS(Out), timestamp, microsecond(us).
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_GetCurPTS(CVI_U64 *pu64CurPTS);
|
||||
|
||||
/**
|
||||
* @brief Alloc ion memory.
|
||||
*
|
||||
* @param pu64PhyAddr(Out), physical address.
|
||||
* @param ppVirAddr(Out), virtual address.
|
||||
* @param strName(In), Named the Ion.
|
||||
* @param u32Len(In), Length.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_IonAlloc(CVI_U64 *pu64PhyAddr, CVI_VOID **ppVirAddr, const CVI_CHAR *strName, CVI_U32 u32Len);
|
||||
|
||||
/**
|
||||
* @brief Alloc cached ion memory.
|
||||
*
|
||||
* @param pu64PhyAddr(Out), physical address.
|
||||
* @param ppVirAddr(Out), virtual address.
|
||||
* @param strName(In), Named the Ion.
|
||||
* @param u32Len(In), Length.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_IonAlloc_Cached(CVI_U64 *pu64PhyAddr, CVI_VOID **ppVirAddr,
|
||||
const CVI_CHAR *strName, CVI_U32 u32Len);
|
||||
|
||||
/**
|
||||
* @brief Free ion memory.
|
||||
*
|
||||
* @param u64PhyAddr(In), physical address.
|
||||
* @param pVirAddr(In), virtual address.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_IonFree(CVI_U64 u64PhyAddr, CVI_VOID *pVirAddr);
|
||||
|
||||
/**
|
||||
* @brief Flush cache data to DRAM.
|
||||
*
|
||||
* @param u64PhyAddr(In), physical address.
|
||||
* @param pVirAddr(In), virtual address.
|
||||
* @param u32Len(In), Length.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_IonFlushCache(CVI_U64 u64PhyAddr, CVI_VOID *pVirAddr, CVI_U32 u32Len);
|
||||
|
||||
/**
|
||||
* @brief Invalid cached data.
|
||||
*
|
||||
* @param u64PhyAddr(In), physical address.
|
||||
* @param pVirAddr(In), virtual address.
|
||||
* @param u32Len(In), Length.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_IonInvalidateCache(CVI_U64 u64PhyAddr, CVI_VOID *pVirAddr, CVI_U32 u32Len);
|
||||
|
||||
/**
|
||||
* @brief Get ion file descriptor.
|
||||
*
|
||||
* @return file descriptor.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_IonGetFd(CVI_VOID);
|
||||
|
||||
/**
|
||||
* @brief memory copy by TPU.
|
||||
*
|
||||
* @param u64PhyDst(In), destination physical address.
|
||||
* @param u64PhySrc(In), source physical address.
|
||||
* @param u32Len(In), Length.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_TDMACopy(CVI_U64 u64PhyDst, CVI_U64 u64PhySrc, CVI_U32 u32Len);
|
||||
|
||||
/**
|
||||
* @brief 2D memory copy by TPU.
|
||||
*
|
||||
* @param pointer(In), 2D memory.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_TDMACopy2D(CVI_TDMA_2D_S *param);
|
||||
|
||||
/**
|
||||
* @brief The physical address maps to a virtual address.
|
||||
*
|
||||
* @param u64PhyAddr(In), physical address.
|
||||
* @param u32Size(In), buf size.
|
||||
* @return virtual address.
|
||||
*/
|
||||
void *CVI_SYS_Mmap(CVI_U64 u64PhyAddr, CVI_U32 u32Size);
|
||||
|
||||
/**
|
||||
* @brief The physical address maps to a virtual address in cache memory.
|
||||
*
|
||||
* @param u64PhyAddr(In), physical address.
|
||||
* @param u32Size(In), buf size.
|
||||
* @return virtual address.
|
||||
*/
|
||||
void *CVI_SYS_MmapCache(CVI_U64 u64PhyAddr, CVI_U32 u32Size);
|
||||
|
||||
/**
|
||||
* @brief Removing an Address Mapping.
|
||||
*
|
||||
* @param pVirAddr(In), virtual address.
|
||||
* @param u32Size(In), buf size.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_Munmap(void *pVirAddr, CVI_U32 u32Size);
|
||||
|
||||
/**
|
||||
* @brief Set vi-vpss online mode or offline mode.
|
||||
*
|
||||
* @param pstVIVPSSMode(In), vi-vpss mode.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_SetVIVPSSMode(const VI_VPSS_MODE_S *pstVIVPSSMode);
|
||||
|
||||
/**
|
||||
* @brief Get vi-vpss mode.
|
||||
*
|
||||
* @param pstVIVPSSMode(Out), vi-vpss mode.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_GetVIVPSSMode(VI_VPSS_MODE_S *pstVIVPSSMode);
|
||||
|
||||
/**
|
||||
* @brief Set vpss single mode or dual mode.
|
||||
*
|
||||
* @param enVPSSMode(In), vpss mode.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_SetVPSSMode(VPSS_MODE_E enVPSSMode);
|
||||
|
||||
/**
|
||||
* @brief Get vpss mode.
|
||||
*
|
||||
* @param enVPSSMode(In), vpss mode.
|
||||
* @return vpss mode.
|
||||
*/
|
||||
VPSS_MODE_E CVI_SYS_GetVPSSMode(void);
|
||||
|
||||
/**
|
||||
* @brief Set vpss extension mode.
|
||||
*
|
||||
* @param pstVPSSMode(In), vpss extension mode.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_SetVPSSModeEx(const VPSS_MODE_S *pstVPSSMode);
|
||||
|
||||
/**
|
||||
* @brief Get vpss extension mode.
|
||||
*
|
||||
* @param pstVPSSMode(Out), vpss extension mode.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_SYS_GetVPSSModeEx(VPSS_MODE_S *pstVPSSMode);
|
||||
|
||||
/**
|
||||
* @brief Get module name.
|
||||
*
|
||||
* @param id(In), module ID.
|
||||
* @return module name.
|
||||
*/
|
||||
const CVI_CHAR *CVI_SYS_GetModName(MOD_ID_E id);
|
||||
|
||||
/**
|
||||
* @brief Set modules log level.
|
||||
*
|
||||
* @param pstConf(In), log level config.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_LOG_SetLevelConf(LOG_LEVEL_CONF_S *pstConf);
|
||||
|
||||
/**
|
||||
* @brief Get modules log level.
|
||||
*
|
||||
* @param pstConf(Out), log level config.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_LOG_GetLevelConf(LOG_LEVEL_CONF_S *pstConf);
|
||||
|
||||
/**
|
||||
* @brief Register thermal callback.
|
||||
*
|
||||
* @param setFPS(In), Thermal Callback.
|
||||
* @return void.
|
||||
*/
|
||||
void CVI_SYS_RegisterThermalCallback(void (*setFPS)(int));
|
||||
|
||||
/**
|
||||
* @brief Begin Trace debug.
|
||||
*
|
||||
* @param name(In), tag name.
|
||||
* @return void.
|
||||
*/
|
||||
void CVI_SYS_TraceBegin(const char *name);
|
||||
|
||||
/**
|
||||
* @brief Trace Counter.
|
||||
*
|
||||
* @param name(In), tag name.
|
||||
* @param value(In), Counter value.
|
||||
* @return void.
|
||||
*/
|
||||
void CVI_SYS_TraceCounter(const char *name, signed int value);
|
||||
|
||||
/**
|
||||
* @brief End Trace debug.
|
||||
*
|
||||
* @return void.
|
||||
*/
|
||||
void CVI_SYS_TraceEnd(void);
|
||||
|
||||
CVI_S32 CVI_SYS_StartThermalThread(void);
|
||||
CVI_S32 CVI_SYS_StopThermalThread(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /*__CVI_SYS_H__ */
|
||||
|
||||
69
middleware/v2/include/cvi_type.h
Normal file
69
middleware/v2/include/cvi_type.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_type.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __CVI_TYPE_H__
|
||||
#define __CVI_TYPE_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*----------------------------------------------
|
||||
* The common data type
|
||||
*----------------------------------------------
|
||||
*/
|
||||
|
||||
typedef unsigned char CVI_UCHAR;
|
||||
typedef unsigned char CVI_U8;
|
||||
typedef unsigned short CVI_U16;
|
||||
typedef unsigned int CVI_U32;
|
||||
typedef unsigned int CVI_HANDLE;
|
||||
|
||||
typedef signed char CVI_S8;
|
||||
typedef char CVI_CHAR;
|
||||
typedef short CVI_S16;
|
||||
typedef int CVI_S32;
|
||||
|
||||
typedef unsigned long CVI_UL;
|
||||
typedef signed long CVI_SL;
|
||||
|
||||
typedef float CVI_FLOAT;
|
||||
typedef double CVI_DOUBLE;
|
||||
|
||||
typedef void CVI_VOID;
|
||||
typedef bool CVI_BOOL;
|
||||
|
||||
typedef uint64_t CVI_U64;
|
||||
typedef int64_t CVI_S64;
|
||||
|
||||
typedef size_t CVI_SIZE_T;
|
||||
|
||||
/*----------------------------------------------
|
||||
* const defination
|
||||
*----------------------------------------------
|
||||
*/
|
||||
|
||||
#define CVI_NULL 0L
|
||||
#define CVI_SUCCESS 0
|
||||
#define CVI_FAILURE (-1)
|
||||
#define CVI_FAILURE_ILLEGAL_PARAM (-2)
|
||||
#define CVI_TRUE 1
|
||||
#define CVI_FALSE 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __CVI_TYPE_H__ */
|
||||
339
middleware/v2/include/cvi_unf_cipher.h
Normal file
339
middleware/v2/include/cvi_unf_cipher.h
Normal file
@@ -0,0 +1,339 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_unf_cipher.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef CVI_UNF_CIPHER_H_FYUVBDPZ
|
||||
#define CVI_UNF_CIPHER_H_FYUVBDPZ
|
||||
|
||||
#include <cvi_type.h>
|
||||
#include <cvi_sys.h>
|
||||
|
||||
#define CVI_ERR_CIPHER_NOT_INIT -0x0001
|
||||
#define CVI_ERR_CIPHER_INVALID_HANDLE -0x0002
|
||||
#define CVI_ERR_CIPHER_INVALID_POINT -0x0003
|
||||
#define CVI_ERR_CIPHER_INVALID_PARA -0x0004
|
||||
#define CVI_ERR_CIPHER_FAILED_INIT -0x0005
|
||||
#define CVI_ERR_CIPHER_FAILED_GETHANDLE -0x0006
|
||||
#define CVI_ERR_CIPHER_FAILED_RELEASEHANDLE -0x0007
|
||||
#define CVI_ERR_CIPHER_BUSY -0x0008
|
||||
#define CVI_ERR_CIPHER_TIMEOUT -0x0009
|
||||
#define CVI_ERR_CIPHER_UNSUPPORTED -0x000A
|
||||
|
||||
#define CVI_CIPHER_HANDLE uintptr_t
|
||||
|
||||
#define CIPHER_IV_CHANGE_ONE_PKG (1)
|
||||
#define CIPHER_IV_CHANGE_ALL_PKG (2)
|
||||
|
||||
typedef enum {
|
||||
CVI_UNF_CIPHER_WORK_MODE_ECB,
|
||||
CVI_UNF_CIPHER_WORK_MODE_CBC,
|
||||
CVI_UNF_CIPHER_WORK_MODE_CFB,
|
||||
CVI_UNF_CIPHER_WORK_MODE_OFB,
|
||||
CVI_UNF_CIPHER_WORK_MODE_CTR,
|
||||
CVI_UNF_CIPHER_WORK_MODE_CCM,
|
||||
CVI_UNF_CIPHER_WORK_MODE_GCM,
|
||||
CVI_UNF_CIPHER_WORK_MODE_CBC_CTS,
|
||||
CVI_UNF_CIPHER_WORK_MODE_BUTT,
|
||||
CVI_UNF_CIPHER_WORK_MODE_INVALID = -1,
|
||||
} CVI_UNF_CIPHER_WORK_MODE_E;
|
||||
|
||||
typedef enum {
|
||||
CVI_UNF_CIPHER_ALG_DES = 0x0,
|
||||
CVI_UNF_CIPHER_ALG_3DES = 0x1,
|
||||
CVI_UNF_CIPHER_ALG_AES = 0x2,
|
||||
CVI_UNF_CIPHER_ALG_SM1 = 0x3,
|
||||
CVI_UNF_CIPHER_ALG_SM4 = 0x4,
|
||||
CVI_UNF_CIPHER_ALG_DMA = 0x5,
|
||||
CVI_UNF_CIPHER_ALG_BUTT = 0x6,
|
||||
CVI_UNF_CIPHER_ALG_INVALID = -1,
|
||||
} CVI_UNF_CIPHER_ALG_E;
|
||||
|
||||
typedef enum {
|
||||
CVI_UNF_CIPHER_KEY_AES_128BIT = 0x0,
|
||||
CVI_UNF_CIPHER_KEY_AES_192BIT = 0x1,
|
||||
CVI_UNF_CIPHER_KEY_AES_256BIT = 0x2,
|
||||
CVI_UNF_CIPHER_KEY_DES_3KEY = 0x2,
|
||||
CVI_UNF_CIPHER_KEY_DES_2KEY = 0x3,
|
||||
CVI_UNF_CIPHER_KEY_DEFAULT = 0x0,
|
||||
CVI_UNF_CIPHER_KEY_INVALID = -1,
|
||||
} CVI_UNF_CIPHER_KEY_LENGTH_E;
|
||||
|
||||
typedef enum {
|
||||
CVI_UNF_CIPHER_BIT_WIDTH_64BIT = 0x0,
|
||||
CVI_UNF_CIPHER_BIT_WIDTH_8BIT = 0x1,
|
||||
CVI_UNF_CIPHER_BIT_WIDTH_1BIT = 0x2,
|
||||
CVI_UNF_CIPHER_BIT_WIDTH_128BIT = 0x3,
|
||||
CVI_UNF_CIPHER_BIT_WIDTH_INVALID = -1,
|
||||
} CVI_UNF_CIPHER_BIT_WIDTH_E;
|
||||
|
||||
typedef struct {
|
||||
CVI_U32 bit1IV : 2;
|
||||
CVI_U32 bitsResv : 30;
|
||||
} CVI_UNF_CIPHER_CTRL_CHANGE_FLAG_S;
|
||||
|
||||
typedef enum {
|
||||
CVI_UNF_CIPHER_TYPE_NORMAL = 0x0,
|
||||
CVI_UNF_CIPHER_TYPE_COPY_AVOID,
|
||||
CVI_UNF_CIPHER_TYPE_BUTT,
|
||||
CVI_UNF_CIPHER_TYPE_INVALID = -1,
|
||||
} CVI_UNF_CIPHER_TYPE_E;
|
||||
|
||||
typedef struct {
|
||||
CVI_UNF_CIPHER_TYPE_E enCipherType;
|
||||
} CVI_UNF_CIPHER_ATTS_S;
|
||||
|
||||
typedef enum {
|
||||
CVI_UNF_CIPHER_SM1_ROUND_08 = 0x00,
|
||||
CVI_UNF_CIPHER_SM1_ROUND_10 = 0x01,
|
||||
CVI_UNF_CIPHER_SM1_ROUND_12 = 0x02,
|
||||
CVI_UNF_CIPHER_SM1_ROUND_14 = 0x03,
|
||||
CVI_UNF_CIPHER_SM1_ROUND_BUTT,
|
||||
CVI_UNF_CIPHER_SM1_ROUND_INVALID = -1,
|
||||
} CVI_UNF_CIPHER_SM1_ROUND_E;
|
||||
|
||||
typedef struct {
|
||||
CVI_U32 u32Key[8];
|
||||
CVI_U32 u32IV[4];
|
||||
CVI_UNF_CIPHER_ALG_E enAlg;
|
||||
CVI_UNF_CIPHER_BIT_WIDTH_E enBitWidth;
|
||||
CVI_UNF_CIPHER_WORK_MODE_E enWorkMode;
|
||||
CVI_UNF_CIPHER_KEY_LENGTH_E enKeyLen;
|
||||
CVI_UNF_CIPHER_CTRL_CHANGE_FLAG_S stChangeFlags;
|
||||
} CVI_UNF_CIPHER_CTRL_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_U32 u32EvenKey[8];
|
||||
CVI_U32 u32OddKey[8];
|
||||
CVI_U32 u32IV[4];
|
||||
CVI_UNF_CIPHER_BIT_WIDTH_E enBitWidth;
|
||||
CVI_UNF_CIPHER_KEY_LENGTH_E enKeyLen;
|
||||
CVI_UNF_CIPHER_CTRL_CHANGE_FLAG_S stChangeFlags;
|
||||
} CVI_UNF_CIPHER_CTRL_AES_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_U32 u32Key[8];
|
||||
CVI_U32 u32IV[4];
|
||||
CVI_UNF_CIPHER_KEY_LENGTH_E enKeyLen;
|
||||
CVI_U32 u32IVLen;
|
||||
CVI_U32 u32TagLen;
|
||||
CVI_U32 u32ALen;
|
||||
CVI_SIZE_T szAdataAddr;
|
||||
} CVI_UNF_CIPHER_CTRL_AES_CCM_GCM_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_U32 u32Key[2];
|
||||
CVI_U32 u32IV[2];
|
||||
CVI_UNF_CIPHER_BIT_WIDTH_E enBitWidth;
|
||||
CVI_UNF_CIPHER_CTRL_CHANGE_FLAG_S stChangeFlags;
|
||||
} CVI_UNF_CIPHER_CTRL_DES_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_U32 u32Key[6];
|
||||
CVI_U32 u32IV[2];
|
||||
CVI_UNF_CIPHER_BIT_WIDTH_E enBitWidth;
|
||||
CVI_UNF_CIPHER_KEY_LENGTH_E enKeyLen;
|
||||
CVI_UNF_CIPHER_CTRL_CHANGE_FLAG_S stChangeFlags;
|
||||
} CVI_UNF_CIPHER_CTRL_3DES_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_U32 u32EK[4];
|
||||
CVI_U32 u32AK[4];
|
||||
CVI_U32 u32SK[4];
|
||||
CVI_U32 u32IV[4];
|
||||
CVI_UNF_CIPHER_BIT_WIDTH_E enBitWidth;
|
||||
CVI_UNF_CIPHER_SM1_ROUND_E enSm1Round;
|
||||
CVI_UNF_CIPHER_CTRL_CHANGE_FLAG_S stChangeFlags;
|
||||
} CVI_UNF_CIPHER_CTRL_SM1_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_U32 u32Key[4];
|
||||
CVI_U32 u32IV[4];
|
||||
CVI_UNF_CIPHER_CTRL_CHANGE_FLAG_S stChangeFlags;
|
||||
} CVI_UNF_CIPHER_CTRL_SM4_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_UNF_CIPHER_ALG_E enAlg;
|
||||
CVI_UNF_CIPHER_WORK_MODE_E enWorkMode;
|
||||
|
||||
CVI_VOID *pParam;
|
||||
} CVI_UNF_CIPHER_CTRL_EX_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_SIZE_T szSrcAddr;
|
||||
CVI_SIZE_T szDestAddr;
|
||||
CVI_U32 u32ByteLength;
|
||||
CVI_BOOL bOddKey;
|
||||
} CVI_UNF_CIPHER_DATA_S;
|
||||
|
||||
typedef enum {
|
||||
CVI_UNF_CIPHER_HASH_TYPE_SHA1,
|
||||
CVI_UNF_CIPHER_HASH_TYPE_SHA224,
|
||||
CVI_UNF_CIPHER_HASH_TYPE_SHA256,
|
||||
CVI_UNF_CIPHER_HASH_TYPE_SHA384,
|
||||
CVI_UNF_CIPHER_HASH_TYPE_SHA512,
|
||||
CVI_UNF_CIPHER_HASH_TYPE_HMAC_SHA1,
|
||||
CVI_UNF_CIPHER_HASH_TYPE_HMAC_SHA224,
|
||||
CVI_UNF_CIPHER_HASH_TYPE_HMAC_SHA256,
|
||||
CVI_UNF_CIPHER_HASH_TYPE_HMAC_SHA384,
|
||||
CVI_UNF_CIPHER_HASH_TYPE_HMAC_SHA512,
|
||||
CVI_UNF_CIPHER_HASH_TYPE_SM3,
|
||||
CVI_UNF_CIPHER_HASH_TYPE_BUTT,
|
||||
CVI_UNF_CIPHER_HASH_TYPE_INVALID = -1,
|
||||
} CVI_UNF_CIPHER_HASH_TYPE_E;
|
||||
|
||||
typedef struct {
|
||||
CVI_U8 *pu8HMACKey;
|
||||
CVI_U32 u32HMACKeyLen;
|
||||
CVI_UNF_CIPHER_HASH_TYPE_E eShaType;
|
||||
} CVI_UNF_CIPHER_HASH_ATTS_S;
|
||||
|
||||
typedef enum {
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_NO_PADDING,
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_0,
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_1,
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_2,
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA1,
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA224,
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA256,
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA384,
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA512,
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_PKCS1_V1_5,
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_BUTT,
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_INVALID = -1,
|
||||
} CVI_UNF_CIPHER_RSA_ENC_SCHEME_E;
|
||||
|
||||
typedef enum {
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA1 = 0x100,
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA224,
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA256,
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA384,
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA512,
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_PSS_SHA1,
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_PSS_SHA224,
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_PSS_SHA256,
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_PSS_SHA384,
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_PSS_SHA512,
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_BUTT,
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_INVALID = -1,
|
||||
} CVI_UNF_CIPHER_RSA_SIGN_SCHEME_E;
|
||||
|
||||
typedef struct {
|
||||
CVI_U8 *pu8N;
|
||||
CVI_U8 *pu8E;
|
||||
CVI_U16 u16NLen;
|
||||
CVI_U16 u16ELen;
|
||||
} CVI_UNF_CIPHER_RSA_PUB_KEY_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_U8 *pu8N;
|
||||
CVI_U8 *pu8E;
|
||||
CVI_U8 *pu8D;
|
||||
CVI_U8 *pu8P;
|
||||
CVI_U8 *pu8Q;
|
||||
CVI_U8 *pu8DP;
|
||||
CVI_U8 *pu8DQ;
|
||||
CVI_U8 *pu8QP;
|
||||
CVI_U16 u16NLen;
|
||||
CVI_U16 u16ELen;
|
||||
CVI_U16 u16DLen;
|
||||
CVI_U16 u16PLen;
|
||||
CVI_U16 u16QLen;
|
||||
CVI_U16 u16DPLen;
|
||||
CVI_U16 u16DQLen;
|
||||
CVI_U16 u16QPLen;
|
||||
} CVI_UNF_CIPHER_RSA_PRI_KEY_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_E enScheme;
|
||||
CVI_UNF_CIPHER_RSA_PUB_KEY_S stPubKey;
|
||||
} CVI_UNF_CIPHER_RSA_PUB_ENC_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_UNF_CIPHER_RSA_ENC_SCHEME_E enScheme;
|
||||
CVI_UNF_CIPHER_RSA_PRI_KEY_S stPriKey;
|
||||
} CVI_UNF_CIPHER_RSA_PRI_ENC_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_E enScheme;
|
||||
CVI_UNF_CIPHER_RSA_PRI_KEY_S stPriKey;
|
||||
} CVI_UNF_CIPHER_RSA_SIGN_S;
|
||||
|
||||
typedef struct {
|
||||
CVI_UNF_CIPHER_RSA_SIGN_SCHEME_E enScheme;
|
||||
CVI_UNF_CIPHER_RSA_PUB_KEY_S stPubKey;
|
||||
} CVI_UNF_CIPHER_RSA_VERIFY_S;
|
||||
|
||||
/** <!-- ==== Structure Definition End ==== */
|
||||
|
||||
#define CVI_UNF_CIPHER_Open CVI_UNF_CIPHER_Init
|
||||
#define CVI_UNF_CIPHER_Close CVI_UNF_CIPHER_DeInit
|
||||
|
||||
/** <!-- [CIPHER] */
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_Init(void);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_DeInit(void);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_CreateHandle(CVI_CIPHER_HANDLE *phCipher, const CVI_UNF_CIPHER_ATTS_S *pstCipherAttr);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_DestroyHandle(CVI_CIPHER_HANDLE hCipher);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_ConfigHandle(CVI_CIPHER_HANDLE hCipher, const CVI_UNF_CIPHER_CTRL_S *pstCtrl);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_ConfigHandleEx(CVI_CIPHER_HANDLE hCipher, const CVI_UNF_CIPHER_CTRL_EX_S *pstExCtrl);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_Encrypt(CVI_CIPHER_HANDLE hCipher, CVI_SIZE_T szSrcAddr, CVI_SIZE_T szDestAddr,
|
||||
CVI_U32 u32ByteLength);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_Decrypt(CVI_CIPHER_HANDLE hCipher, CVI_SIZE_T szSrcAddr, CVI_SIZE_T szDestAddr,
|
||||
CVI_U32 u32ByteLength);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_EncryptVir(CVI_CIPHER_HANDLE hCipher, const CVI_U8 *pu8SrcData, CVI_U8 *pu8DestData,
|
||||
CVI_U32 u32ByteLength);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_DecryptVir(CVI_CIPHER_HANDLE hCipher, const CVI_U8 *pu8SrcData, CVI_U8 *pu8DestData,
|
||||
CVI_U32 u32ByteLength);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_EncryptMulti(CVI_CIPHER_HANDLE hCipher, const CVI_UNF_CIPHER_DATA_S *pstDataPkg,
|
||||
CVI_U32 u32DataPkgNum);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_GetHandleConfig(CVI_CIPHER_HANDLE hCipher, CVI_UNF_CIPHER_CTRL_S *pstCtrl);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_DecryptMulti(CVI_CIPHER_HANDLE hCipher, const CVI_UNF_CIPHER_DATA_S *pstDataPkg,
|
||||
CVI_U32 u32DataPkgNum);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_GetTag(CVI_CIPHER_HANDLE hCipher, CVI_U8 *pu8Tag, CVI_U32 *pu32TagLen);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_GetRandomNumber(CVI_U32 *pu32RandomNumber);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_HashInit(const CVI_UNF_CIPHER_HASH_ATTS_S *pstHashAttr, CVI_CIPHER_HANDLE *pHashHandle);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_HashUpdate(CVI_CIPHER_HANDLE hHashHandle, const CVI_U8 *pu8InputData, CVI_U32 u32InputDataLen);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_HashFinal(CVI_CIPHER_HANDLE hHashHandle, CVI_U8 *pu8OutputHash);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_RsaPublicEncrypt(const CVI_UNF_CIPHER_RSA_PUB_ENC_S *pstRsaEnc, const CVI_U8 *pu8Input,
|
||||
CVI_U32 u32InLen, CVI_U8 *pu8Output, CVI_U32 *pu32OutLen);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_RsaPrivateDecrypt(const CVI_UNF_CIPHER_RSA_PRI_ENC_S *pstRsaDec, const CVI_U8 *pu8Input,
|
||||
CVI_U32 u32InLen, CVI_U8 *pu8Output, CVI_U32 *pu32OutLen);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_RsaPrivateEncrypt(const CVI_UNF_CIPHER_RSA_PRI_ENC_S *pstRsaEnc, const CVI_U8 *pu8Input,
|
||||
CVI_U32 u32InLen, CVI_U8 *pu8Output, CVI_U32 *pu32OutLen);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_RsaPublicDecrypt(const CVI_UNF_CIPHER_RSA_PUB_ENC_S *pstRsaDec, const CVI_U8 *pu8Input,
|
||||
CVI_U32 u32InLen, CVI_U8 *pu8Output, CVI_U32 *pu32OutLen);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_RsaSign(const CVI_UNF_CIPHER_RSA_SIGN_S *pstRsaSign, const CVI_U8 *pu8InData,
|
||||
CVI_U32 u32InDataLen, const CVI_U8 *pu8HashData, CVI_U8 *pu8OutSign,
|
||||
CVI_U32 *pu32OutSignLen);
|
||||
|
||||
CVI_S32 CVI_UNF_CIPHER_RsaVerify(const CVI_UNF_CIPHER_RSA_VERIFY_S *pstRsaVerify, const CVI_U8 *pu8InData,
|
||||
CVI_U32 u32InDataLen, const CVI_U8 *pu8HashData, const CVI_U8 *pu8InSign,
|
||||
CVI_U32 u32InSignLen);
|
||||
|
||||
|
||||
#endif /* end of include guard: CVI_UNF_CIPHER_H_FYUVBDPZ */
|
||||
173
middleware/v2/include/cvi_vb.h
Normal file
173
middleware/v2/include/cvi_vb.h
Normal file
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_vb.h
|
||||
* Description:
|
||||
* MMF Programe Interface for video buffer management moudle
|
||||
*/
|
||||
|
||||
#ifndef __CVI_VB_H__
|
||||
#define __CVI_VB_H__
|
||||
|
||||
#include "cvi_comm_vb.h"
|
||||
#include <linux/cvi_comm_video.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#ifdef NOT_HAVE_GET_BLOCK_WITH_ID
|
||||
#define CVI_VB_GET_BLOCK(id, size, MOD) CVI_VB_GetBlock((id), (size))
|
||||
#else
|
||||
#define CVI_VB_GET_BLOCK(id, size, MOD) CVI_VB_GetBlockwithID((id), (size), (MOD))
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @brief VB initialization.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VB_Init(void);
|
||||
|
||||
/**
|
||||
* @brief VB exit.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VB_Exit(void);
|
||||
|
||||
/**
|
||||
* @brief Creating VB pool dynamically.
|
||||
*
|
||||
* @param pstVbPoolCfg(In), vb pool config.
|
||||
* @return pool ID.
|
||||
*/
|
||||
VB_POOL CVI_VB_CreatePool(VB_POOL_CONFIG_S *pstVbPoolCfg);
|
||||
|
||||
/**
|
||||
* @brief Creating external VB pool dynamically.
|
||||
*
|
||||
* @param pstVbPoolCfg(In), vb pool config.
|
||||
* @return pool ID.
|
||||
*/
|
||||
VB_POOL CVI_VB_CreateExPool(VB_POOL_CONFIG_EX_S *pstVbPoolExCfg);
|
||||
|
||||
/**
|
||||
* @brief Destroy VB pool.
|
||||
*
|
||||
* @param Pool(In), vb pool ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VB_DestroyPool(VB_POOL Pool);
|
||||
|
||||
/**
|
||||
* @brief Set common vb config.
|
||||
*
|
||||
* @param pstVbConfig(In), common vb config.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VB_SetConfig(const VB_CONFIG_S *pstVbConfig);
|
||||
|
||||
/**
|
||||
* @brief Get common vb config.
|
||||
*
|
||||
* @param pstVbConfig(Out), common vb config.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VB_GetConfig(VB_CONFIG_S *pstVbConfig);
|
||||
|
||||
/**
|
||||
* @brief Get vb block.
|
||||
*
|
||||
* @param Pool(In), pool ID, VB_INVALID_POOLID as search from all pools.
|
||||
* @param u32BlkSize(In), block size.
|
||||
* @return vb block.
|
||||
*/
|
||||
VB_BLK CVI_VB_GetBlock(VB_POOL Pool, CVI_U32 u32BlkSize);
|
||||
|
||||
/**
|
||||
* @brief Release vb block.
|
||||
*
|
||||
* @param Block(In), vb block.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VB_ReleaseBlock(VB_BLK Block);
|
||||
|
||||
/**
|
||||
* @brief Find vb block by physical address.
|
||||
*
|
||||
* @param u64PhyAddr(In), vb physical address.
|
||||
* @return vb block.
|
||||
*/
|
||||
VB_BLK CVI_VB_PhysAddr2Handle(CVI_U64 u64PhyAddr);
|
||||
|
||||
/**
|
||||
* @brief Find physical address by vb block.
|
||||
*
|
||||
* @param Block(In), vb block.
|
||||
* @return physical address.
|
||||
*/
|
||||
CVI_U64 CVI_VB_Handle2PhysAddr(VB_BLK Block);
|
||||
|
||||
/**
|
||||
* @brief Find pool ID by vb block.
|
||||
*
|
||||
* @param Block(In), vb block.
|
||||
* @return pool ID.
|
||||
*/
|
||||
VB_POOL CVI_VB_Handle2PoolId(VB_BLK Block);
|
||||
|
||||
/**
|
||||
* @brief inquire VB use count.
|
||||
*
|
||||
* @param Block(In), vb block.
|
||||
* @param pCnt(In), use count.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VB_InquireUserCnt(VB_BLK Block, CVI_U32 *pCnt);
|
||||
|
||||
/**
|
||||
* @brief mmap the whole pool to get virtual-address.
|
||||
*
|
||||
* @param Pool(In), pool ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VB_MmapPool(VB_POOL Pool);
|
||||
|
||||
/**
|
||||
* @brief unmap the whole pool.
|
||||
*
|
||||
* @param Pool(In), pool ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VB_MunmapPool(VB_POOL Pool);
|
||||
|
||||
/**
|
||||
* @brief Get block virtual address.
|
||||
*
|
||||
* @param Pool(In), pool ID.
|
||||
* @param Block(In), vb block.
|
||||
* @param ppVirAddr(In), virtual address.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VB_GetBlockVirAddr(VB_POOL Pool, VB_BLK Block, void **ppVirAddr);
|
||||
|
||||
/**
|
||||
* @brief Print pool usage information.
|
||||
*
|
||||
* @param Pool(In), pool ID.
|
||||
* @return void.
|
||||
*/
|
||||
CVI_VOID CVI_VB_PrintPool(VB_POOL Pool);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /*__CVI_VB_H__ */
|
||||
|
||||
81
middleware/v2/include/cvi_vdec.h
Normal file
81
middleware/v2/include/cvi_vdec.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_vdec.h
|
||||
* Description:
|
||||
* Common video decode definitions.
|
||||
*/
|
||||
|
||||
#ifndef __CVI_VDEC_H__
|
||||
#define __CVI_VDEC_H__
|
||||
|
||||
#include <linux/cvi_common.h>
|
||||
#include <linux/cvi_comm_video.h>
|
||||
#include "cvi_comm_vb.h"
|
||||
#include <linux/cvi_comm_vdec.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
CVI_S32 CVI_VDEC_CreateChn(VDEC_CHN VdChn, const VDEC_CHN_ATTR_S *pstAttr);
|
||||
CVI_S32 CVI_VDEC_DestroyChn(VDEC_CHN VdChn);
|
||||
|
||||
CVI_S32 CVI_VDEC_GetChnAttr(VDEC_CHN VdChn, VDEC_CHN_ATTR_S *pstAttr);
|
||||
CVI_S32 CVI_VDEC_SetChnAttr(VDEC_CHN VdChn, const VDEC_CHN_ATTR_S *pstAttr);
|
||||
|
||||
CVI_S32 CVI_VDEC_StartRecvStream(VDEC_CHN VdChn);
|
||||
CVI_S32 CVI_VDEC_StopRecvStream(VDEC_CHN VdChn);
|
||||
|
||||
CVI_S32 CVI_VDEC_QueryStatus(VDEC_CHN VdChn, VDEC_CHN_STATUS_S *pstStatus);
|
||||
|
||||
CVI_S32 CVI_VDEC_GetFd(VDEC_CHN VdChn);
|
||||
CVI_S32 CVI_VDEC_CloseFd(VDEC_CHN VdChn);
|
||||
|
||||
CVI_S32 CVI_VDEC_ResetChn(VDEC_CHN VdChn);
|
||||
|
||||
CVI_S32 CVI_VDEC_SetChnParam(VDEC_CHN VdChn, const VDEC_CHN_PARAM_S *pstParam);
|
||||
CVI_S32 CVI_VDEC_GetChnParam(VDEC_CHN VdChn, VDEC_CHN_PARAM_S *pstParam);
|
||||
|
||||
CVI_S32 CVI_VDEC_SetProtocolParam(VDEC_CHN VdChn, const VDEC_PRTCL_PARAM_S *pstParam);
|
||||
CVI_S32 CVI_VDEC_GetProtocolParam(VDEC_CHN VdChn, VDEC_PRTCL_PARAM_S *pstParam);
|
||||
|
||||
/* s32MilliSec: -1 is block,0 is no block,other positive number is timeout */
|
||||
CVI_S32 CVI_VDEC_SendStream(VDEC_CHN VdChn, const VDEC_STREAM_S *pstStream, CVI_S32 s32MilliSec);
|
||||
|
||||
CVI_S32 CVI_VDEC_GetFrame(VDEC_CHN VdChn, VIDEO_FRAME_INFO_S *pstFrameInfo, CVI_S32 s32MilliSec);
|
||||
CVI_S32 CVI_VDEC_ReleaseFrame(VDEC_CHN VdChn, const VIDEO_FRAME_INFO_S *pstFrameInfo);
|
||||
|
||||
CVI_S32 CVI_VDEC_GetUserData(VDEC_CHN VdChn, VDEC_USERDATA_S *pstUserData, CVI_S32 s32MilliSec);
|
||||
CVI_S32 CVI_VDEC_ReleaseUserData(VDEC_CHN VdChn, const VDEC_USERDATA_S *pstUserData);
|
||||
|
||||
CVI_S32 CVI_VDEC_SetUserPic(VDEC_CHN VdChn, const VIDEO_FRAME_INFO_S *pstUsrPic);
|
||||
CVI_S32 CVI_VDEC_EnableUserPic(VDEC_CHN VdChn, CVI_BOOL bInstant);
|
||||
CVI_S32 CVI_VDEC_DisableUserPic(VDEC_CHN VdChn);
|
||||
|
||||
CVI_S32 CVI_VDEC_SetDisplayMode(VDEC_CHN VdChn, VIDEO_DISPLAY_MODE_E enDisplayMode);
|
||||
CVI_S32 CVI_VDEC_GetDisplayMode(VDEC_CHN VdChn, VIDEO_DISPLAY_MODE_E *penDisplayMode);
|
||||
|
||||
CVI_S32 CVI_VDEC_SetRotation(VDEC_CHN VdChn, ROTATION_E enRotation);
|
||||
CVI_S32 CVI_VDEC_GetRotation(VDEC_CHN VdChn, ROTATION_E *penRotation);
|
||||
|
||||
CVI_S32 CVI_VDEC_AttachVbPool(VDEC_CHN VdChn, const VDEC_CHN_POOL_S *pstPool);
|
||||
CVI_S32 CVI_VDEC_DetachVbPool(VDEC_CHN VdChn);
|
||||
|
||||
CVI_S32 CVI_VDEC_SetUserDataAttr(VDEC_CHN VdChn, const VDEC_USER_DATA_ATTR_S *pstUserDataAttr);
|
||||
CVI_S32 CVI_VDEC_GetUserDataAttr(VDEC_CHN VdChn, VDEC_USER_DATA_ATTR_S *pstUserDataAttr);
|
||||
|
||||
CVI_S32 CVI_VDEC_SetModParam(const VDEC_MOD_PARAM_S *pstModParam);
|
||||
CVI_S32 CVI_VDEC_GetModParam(VDEC_MOD_PARAM_S *pstModParam);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* End of #ifndef __CVI_VDEC_H__ */
|
||||
|
||||
|
||||
420
middleware/v2/include/cvi_venc.h
Normal file
420
middleware/v2/include/cvi_venc.h
Normal file
@@ -0,0 +1,420 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_venc.h
|
||||
* Description:
|
||||
* Common video encode definitions.
|
||||
*/
|
||||
|
||||
#ifndef __CVI_VENC_H__
|
||||
#define __CVI_VENC_H__
|
||||
|
||||
#include <linux/cvi_comm_video.h>
|
||||
#include "cvi_comm_vb.h"
|
||||
#include <linux/cvi_comm_venc.h>
|
||||
#include <linux/cvi_common.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
CVI_VOID cviGetMask(void);
|
||||
|
||||
CVI_S32 CVI_VENC_CreateChn(VENC_CHN VeChn, const VENC_CHN_ATTR_S *pstAttr);
|
||||
CVI_S32 CVI_VENC_DestroyChn(VENC_CHN VeChn);
|
||||
CVI_S32 CVI_VENC_ResetChn(VENC_CHN VeChn);
|
||||
|
||||
CVI_S32 CVI_VENC_StartRecvFrame(VENC_CHN VeChn, const VENC_RECV_PIC_PARAM_S *pstRecvParam);
|
||||
CVI_S32 CVI_VENC_StopRecvFrame(VENC_CHN VeChn);
|
||||
|
||||
CVI_S32 CVI_VENC_QueryStatus(VENC_CHN VeChn, VENC_CHN_STATUS_S *pstStatus);
|
||||
|
||||
CVI_S32 CVI_VENC_SetChnAttr(VENC_CHN VeChn, const VENC_CHN_ATTR_S *pstChnAttr);
|
||||
CVI_S32 CVI_VENC_GetChnAttr(VENC_CHN VeChn, VENC_CHN_ATTR_S *pstChnAttr);
|
||||
|
||||
CVI_S32 CVI_VENC_GetStream(VENC_CHN VeChn, VENC_STREAM_S *pstStream, CVI_S32 S32MilliSec);
|
||||
CVI_S32 CVI_VENC_ReleaseStream(VENC_CHN VeChn, VENC_STREAM_S *pstStream);
|
||||
|
||||
CVI_S32 CVI_VENC_InsertUserData(VENC_CHN VeChn, CVI_U8 *pu8Data, CVI_U32 u32Len);
|
||||
|
||||
CVI_S32 CVI_VENC_SendFrame(VENC_CHN VeChn, const VIDEO_FRAME_INFO_S *pstFrame, CVI_S32 s32MilliSec);
|
||||
CVI_S32 CVI_VENC_SendFrameEx(VENC_CHN VeChn, const USER_FRAME_INFO_S *pstFrame, CVI_S32 s32MilliSec);
|
||||
|
||||
CVI_S32 CVI_VENC_RequestIDR(VENC_CHN VeChn, CVI_BOOL bInstant);
|
||||
|
||||
CVI_S32 CVI_VENC_GetFd(VENC_CHN VeChn);
|
||||
CVI_S32 CVI_VENC_CloseFd(VENC_CHN VeChn);
|
||||
|
||||
CVI_S32 CVI_VENC_SetRoiAttr(VENC_CHN VeChn, const VENC_ROI_ATTR_S *pstRoiAttr);
|
||||
CVI_S32 CVI_VENC_GetRoiAttr(VENC_CHN VeChn, CVI_U32 u32Index, VENC_ROI_ATTR_S *pstRoiAttr);
|
||||
|
||||
CVI_S32 CVI_VENC_GetRoiAttrEx(VENC_CHN VeChn, CVI_U32 u32Index, VENC_ROI_ATTR_EX_S *pstRoiAttrEx);
|
||||
CVI_S32 CVI_VENC_SetRoiAttrEx(VENC_CHN VeChn, const VENC_ROI_ATTR_EX_S *pstRoiAttrEx);
|
||||
|
||||
CVI_S32 CVI_VENC_SetRoiBgFrameRate(VENC_CHN VeChn, const VENC_ROIBG_FRAME_RATE_S *pstRoiBgFrmRate);
|
||||
CVI_S32 CVI_VENC_GetRoiBgFrameRate(VENC_CHN VeChn, VENC_ROIBG_FRAME_RATE_S *pstRoiBgFrmRate);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH264SliceSplit(VENC_CHN VeChn, const VENC_H264_SLICE_SPLIT_S *pstSliceSplit);
|
||||
CVI_S32 CVI_VENC_GetH264SliceSplit(VENC_CHN VeChn, VENC_H264_SLICE_SPLIT_S *pstSliceSplit);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH264IntraPred(VENC_CHN VeChn, const VENC_H264_INTRA_PRED_S *pstH264IntraPred);
|
||||
CVI_S32 CVI_VENC_GetH264IntraPred(VENC_CHN VeChn, VENC_H264_INTRA_PRED_S *pstH264IntraPred);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH264Trans(VENC_CHN VeChn, const VENC_H264_TRANS_S *pstH264Trans);
|
||||
CVI_S32 CVI_VENC_GetH264Trans(VENC_CHN VeChn, VENC_H264_TRANS_S *pstH264Trans);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH264Entropy(VENC_CHN VeChn, const VENC_H264_ENTROPY_S *pstH264EntropyEnc);
|
||||
CVI_S32 CVI_VENC_GetH264Entropy(VENC_CHN VeChn, VENC_H264_ENTROPY_S *pstH264EntropyEnc);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH264Dblk(VENC_CHN VeChn, const VENC_H264_DBLK_S *pstH264Dblk);
|
||||
CVI_S32 CVI_VENC_GetH264Dblk(VENC_CHN VeChn, VENC_H264_DBLK_S *pstH264Dblk);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH264Vui(VENC_CHN VeChn, const VENC_H264_VUI_S *pstH264Vui);
|
||||
CVI_S32 CVI_VENC_GetH264Vui(VENC_CHN VeChn, VENC_H264_VUI_S *pstH264Vui);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH265Vui(VENC_CHN VeChn, const VENC_H265_VUI_S *pstH265Vui);
|
||||
CVI_S32 CVI_VENC_GetH265Vui(VENC_CHN VeChn, VENC_H265_VUI_S *pstH265Vui);
|
||||
|
||||
CVI_S32 CVI_VENC_SetJpegParam(VENC_CHN VeChn, const VENC_JPEG_PARAM_S *pstJpegParam);
|
||||
CVI_S32 CVI_VENC_GetJpegParam(VENC_CHN VeChn, VENC_JPEG_PARAM_S *pstJpegParam);
|
||||
|
||||
CVI_S32 CVI_VENC_SetMjpegParam(VENC_CHN VeChn, const VENC_MJPEG_PARAM_S *pstMjpegParam);
|
||||
CVI_S32 CVI_VENC_GetMjpegParam(VENC_CHN VeChn, VENC_MJPEG_PARAM_S *pstMjpegParam);
|
||||
|
||||
CVI_S32 CVI_VENC_GetRcParam(VENC_CHN VeChn, VENC_RC_PARAM_S *pstRcParam);
|
||||
CVI_S32 CVI_VENC_SetRcParam(VENC_CHN VeChn, const VENC_RC_PARAM_S *pstRcParam);
|
||||
|
||||
CVI_S32 CVI_VENC_SetRefParam(VENC_CHN VeChn, const VENC_REF_PARAM_S *pstRefParam);
|
||||
CVI_S32 CVI_VENC_GetRefParam(VENC_CHN VeChn, VENC_REF_PARAM_S *pstRefParam);
|
||||
|
||||
CVI_S32 CVI_VENC_SetJpegEncodeMode(VENC_CHN VeChn, const VENC_JPEG_ENCODE_MODE_E enJpegEncodeMode);
|
||||
CVI_S32 CVI_VENC_GetJpegEncodeMode(VENC_CHN VeChn, VENC_JPEG_ENCODE_MODE_E *penJpegEncodeMode);
|
||||
|
||||
CVI_S32 CVI_VENC_EnableIDR(VENC_CHN VeChn, CVI_BOOL bEnableIDR);
|
||||
|
||||
CVI_S32 CVI_VENC_GetStreamBufInfo(VENC_CHN VeChn, VENC_STREAM_BUF_INFO_S *pstStreamBufInfo);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH265SliceSplit(VENC_CHN VeChn, const VENC_H265_SLICE_SPLIT_S *pstSliceSplit);
|
||||
CVI_S32 CVI_VENC_GetH265SliceSplit(VENC_CHN VeChn, VENC_H265_SLICE_SPLIT_S *pstSliceSplit);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH265PredUnit(VENC_CHN VeChn, const VENC_H265_PU_S *pstPredUnit);
|
||||
CVI_S32 CVI_VENC_GetH265PredUnit(VENC_CHN VeChn, VENC_H265_PU_S *pstPredUnit);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH265Trans(VENC_CHN VeChn, const VENC_H265_TRANS_S *pstH265Trans);
|
||||
CVI_S32 CVI_VENC_GetH265Trans(VENC_CHN VeChn, VENC_H265_TRANS_S *pstH265Trans);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH265Entropy(VENC_CHN VeChn, const VENC_H265_ENTROPY_S *pstH265Entropy);
|
||||
CVI_S32 CVI_VENC_GetH265Entropy(VENC_CHN VeChn, VENC_H265_ENTROPY_S *pstH265Entropy);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH265Dblk(VENC_CHN VeChn, const VENC_H265_DBLK_S *pstH265Dblk);
|
||||
CVI_S32 CVI_VENC_GetH265Dblk(VENC_CHN VeChn, VENC_H265_DBLK_S *pstH265Dblk);
|
||||
|
||||
CVI_S32 CVI_VENC_SetH265Sao(VENC_CHN VeChn, const VENC_H265_SAO_S *pstH265Sao);
|
||||
CVI_S32 CVI_VENC_GetH265Sao(VENC_CHN VeChn, VENC_H265_SAO_S *pstH265Sao);
|
||||
|
||||
CVI_S32 CVI_VENC_SetFrameLostStrategy(VENC_CHN VeChn, const VENC_FRAMELOST_S *pstFrmLostParam);
|
||||
CVI_S32 CVI_VENC_GetFrameLostStrategy(VENC_CHN VeChn, VENC_FRAMELOST_S *pstFrmLostParam);
|
||||
|
||||
CVI_S32 CVI_VENC_SetSuperFrameStrategy(VENC_CHN VeChn, const VENC_SUPERFRAME_CFG_S *pstSuperFrmParam);
|
||||
CVI_S32 CVI_VENC_GetSuperFrameStrategy(VENC_CHN VeChn, VENC_SUPERFRAME_CFG_S *pstSuperFrmParam);
|
||||
|
||||
CVI_S32 CVI_VENC_SetIntraRefresh(VENC_CHN VeChn, const VENC_INTRA_REFRESH_S *pstIntraRefresh);
|
||||
CVI_S32 CVI_VENC_GetIntraRefresh(VENC_CHN VeChn, VENC_INTRA_REFRESH_S *pstIntraRefresh);
|
||||
|
||||
CVI_S32 CVI_VENC_GetSSERegion(VENC_CHN VeChn, CVI_U32 u32Index, VENC_SSE_CFG_S *pstSSECfg);
|
||||
CVI_S32 CVI_VENC_SetSSERegion(VENC_CHN VeChn, const VENC_SSE_CFG_S *pstSSECfg);
|
||||
|
||||
CVI_S32 CVI_VENC_SetChnParam(VENC_CHN VeChn, const VENC_CHN_PARAM_S *pstChnParam);
|
||||
CVI_S32 CVI_VENC_GetChnParam(VENC_CHN VeChn, VENC_CHN_PARAM_S *pstChnParam);
|
||||
|
||||
CVI_S32 CVI_VENC_SetModParam(const VENC_PARAM_MOD_S *pstModParam);
|
||||
CVI_S32 CVI_VENC_GetModParam(VENC_PARAM_MOD_S *pstModParam);
|
||||
|
||||
CVI_S32 CVI_VENC_GetForegroundProtect(VENC_CHN VeChn, VENC_FOREGROUND_PROTECT_S *pstForegroundProtect);
|
||||
CVI_S32 CVI_VENC_SetForegroundProtect(VENC_CHN VeChn, const VENC_FOREGROUND_PROTECT_S *pstForegroundProtect);
|
||||
|
||||
CVI_S32 CVI_VENC_SetSceneMode(VENC_CHN VeChn, const VENC_SCENE_MODE_E enSceneMode);
|
||||
CVI_S32 CVI_VENC_GetSceneMode(VENC_CHN VeChn, VENC_SCENE_MODE_E *penSceneMode);
|
||||
|
||||
CVI_S32 CVI_VENC_AttachVbPool(VENC_CHN VeChn, const VENC_CHN_POOL_S *pstPool);
|
||||
CVI_S32 CVI_VENC_DetachVbPool(VENC_CHN VeChn);
|
||||
|
||||
CVI_S32 CVI_VENC_SetCuPrediction(VENC_CHN VeChn,
|
||||
const VENC_CU_PREDICTION_S *pstCuPrediction);
|
||||
CVI_S32 CVI_VENC_GetCuPrediction(VENC_CHN VeChn,
|
||||
VENC_CU_PREDICTION_S *pstCuPrediction);
|
||||
|
||||
CVI_S32 CVI_VENC_GetCuPrediction(VENC_CHN VeChn, VENC_CU_PREDICTION_S *pstCuPrediction);
|
||||
|
||||
CVI_S32 CVI_VENC_SetSkipBias(VENC_CHN VeChn, const VENC_SKIP_BIAS_S *pstSkipBias);
|
||||
CVI_S32 CVI_VENC_GetSkipBias(VENC_CHN VeChn, VENC_SKIP_BIAS_S *pstSkipBias);
|
||||
|
||||
CVI_S32 CVI_VENC_SetDeBreathEffect(VENC_CHN VeChn, const VENC_DEBREATHEFFECT_S *pstDeBreathEffect);
|
||||
CVI_S32 CVI_VENC_GetDeBreathEffect(VENC_CHN VeChn, VENC_DEBREATHEFFECT_S *pstDeBreathEffect);
|
||||
|
||||
CVI_S32 CVI_VENC_SetHierarchicalQp(VENC_CHN VeChn, const VENC_HIERARCHICAL_QP_S *pstHierarchicalQp);
|
||||
CVI_S32 CVI_VENC_GetHierarchicalQp(VENC_CHN VeChn, VENC_HIERARCHICAL_QP_S *pstHierarchicalQp);
|
||||
|
||||
CVI_S32 CVI_VENC_SetRcAdvParam(VENC_CHN VeChn, const VENC_RC_ADVPARAM_S *pstRcAdvParam);
|
||||
CVI_S32 CVI_VENC_GetRcAdvParam(VENC_CHN VeChn, VENC_RC_ADVPARAM_S *pstRcAdvParam);
|
||||
|
||||
CVI_S32 CVI_VENC_CalcFrameParam(VENC_CHN VeChn, VENC_FRAME_PARAM_S *pstFrameParam);
|
||||
CVI_S32 CVI_VENC_SetFrameParam(VENC_CHN VeChn, const VENC_FRAME_PARAM_S *pstFrameParam);
|
||||
CVI_S32 CVI_VENC_GetFrameParam(VENC_CHN VeChn, VENC_FRAME_PARAM_S *pstFrameParam);
|
||||
|
||||
#define CVI_H264_PROFILE_DEFAULT H264E_PROFILE_HIGH
|
||||
#define CVI_H264_PROFILE_MIN 0
|
||||
#define CVI_H264_PROFILE_MAX (H264E_PROFILE_BUTT - 1)
|
||||
|
||||
#define CVI_H264_ENTROPY_DEFAULT 1
|
||||
#define CVI_H264_ENTROPY_MIN 0
|
||||
#define CVI_H264_ENTROPY_MAX 1
|
||||
|
||||
#define CVI_INITIAL_DELAY_DEFAULT 1000
|
||||
#define CVI_INITIAL_DELAY_MIN 10
|
||||
#define CVI_INITIAL_DELAY_MAX 3000
|
||||
|
||||
#define CVI_VARI_FPS_EN_DEFAULT 0
|
||||
#define CVI_VARI_FPS_EN_MIN 0
|
||||
#define CVI_VARI_FPS_EN_MAX 1
|
||||
|
||||
#define CVI_H26X_GOP_DEFAULT 60
|
||||
#define CVI_H26X_GOP_MIN 1
|
||||
#define CVI_H26X_GOP_MAX 3600
|
||||
|
||||
#define CVI_H26X_GOP_MODE_DEFAULT VENC_GOPMODE_NORMALP
|
||||
#define CVI_H26X_GOP_MODE_MIN VENC_GOPMODE_NORMALP
|
||||
#define CVI_H26X_GOP_MODE_MAX (VENC_GOPMODE_BUTT - 1)
|
||||
|
||||
#define CVI_H26X_NORMALP_IP_QP_DELTA_DEFAULT 2
|
||||
#define CVI_H26X_NORMALP_IP_QP_DELTA_MIN -10
|
||||
#define CVI_H26X_NORMALP_IP_QP_DELTA_MAX 30
|
||||
|
||||
#define CVI_H26X_SMARTP_BG_INTERVAL_DEFAULT (CVI_H26X_GOP_DEFAULT * 2)
|
||||
#define CVI_H26X_SMARTP_BG_INTERVAL_MIN CVI_H26X_GOP_MIN
|
||||
#define CVI_H26X_SMARTP_BG_INTERVAL_MAX 65536
|
||||
|
||||
#define CVI_H26X_SMARTP_BG_QP_DELTA_DEFAULT 2
|
||||
#define CVI_H26X_SMARTP_BG_QP_DELTA_MIN -10
|
||||
#define CVI_H26X_SMARTP_BG_QP_DELTA_MAX 30
|
||||
|
||||
#define CVI_H26X_SMARTP_VI_QP_DELTA_DEFAULT 0
|
||||
#define CVI_H26X_SMARTP_VI_QP_DELTA_MIN -10
|
||||
#define CVI_H26X_SMARTP_VI_QP_DELTA_MAX 30
|
||||
|
||||
#define CVI_H26X_MAXIQP_DEFAULT 51
|
||||
#define CVI_H26X_MAXIQP_MIN 1
|
||||
#define CVI_H26X_MAXIQP_MAX 51
|
||||
|
||||
#define CVI_H26X_MINIQP_DEFAULT 1
|
||||
#define CVI_H26X_MINIQP_MIN 1
|
||||
#define CVI_H26X_MINIQP_MAX 51
|
||||
|
||||
#define CVI_H26X_MAXQP_DEFAULT 51
|
||||
#define CVI_H26X_MAXQP_MIN 0
|
||||
#define CVI_H26X_MAXQP_MAX 51
|
||||
|
||||
#define CVI_H26X_MINQP_DEFAULT 1
|
||||
#define CVI_H26X_MINQP_MIN 0
|
||||
#define CVI_H26X_MINQP_MAX 51
|
||||
|
||||
#define CVI_H26X_MAX_I_PROP_DEFAULT 100
|
||||
#define CVI_H26X_MAX_I_PROP_MIN 1
|
||||
#define CVI_H26X_MAX_I_PROP_MAX 100
|
||||
|
||||
#define CVI_H26X_MIN_I_PROP_DEFAULT 1
|
||||
#define CVI_H26X_MIN_I_PROP_MIN 1
|
||||
#define CVI_H26X_MIN_I_PROP_MAX 100
|
||||
|
||||
#define CVI_H26X_MAXBITRATE_DEFAULT 5000
|
||||
#define CVI_H26X_MAXBITRATE_MIN 100
|
||||
#define CVI_H26X_MAXBITRATE_MAX 300000
|
||||
|
||||
#define CVI_H26X_CHANGE_POS_DEFAULT 90
|
||||
#define CVI_H26X_CHANGE_POS_MIN 50
|
||||
#define CVI_H26X_CHANGE_POS_MAX 100
|
||||
|
||||
#define CVI_H26X_MIN_STILL_PERCENT_DEFAULT 10
|
||||
#define CVI_H26X_MIN_STILL_PERCENT_MIN 1
|
||||
#define CVI_H26X_MIN_STILL_PERCENT_MAX 100
|
||||
|
||||
#define CVI_H26X_MAX_STILL_QP_DEFAULT 1
|
||||
#define CVI_H26X_MAX_STILL_QP_MIN 0
|
||||
#define CVI_H26X_MAX_STILL_QP_MAX 51
|
||||
|
||||
#define CVI_H26X_MOTION_SENSITIVITY_DEFAULT 100
|
||||
#define CVI_H26X_MOTION_SENSITIVITY_MIN 1
|
||||
#define CVI_H26X_MOTION_SENSITIVITY_MAX 1024
|
||||
|
||||
#define CVI_H26X_AVBR_FRM_LOST_OPEN_DEFAULT 1
|
||||
#define CVI_H26X_AVBR_FRM_LOST_OPEN_MIN 0
|
||||
#define CVI_H26X_AVBR_FRM_LOST_OPEN_MAX 1
|
||||
|
||||
#define CVI_H26X_AVBR_FRM_GAP_DEFAULT 1
|
||||
#define CVI_H26X_AVBR_FRM_GAP_MIN 0
|
||||
#define CVI_H26X_AVBR_FRM_GAP_MAX 100
|
||||
|
||||
#define CVI_H26X_AVBR_PURE_STILL_THR_DEFAULT 4
|
||||
#define CVI_H26X_AVBR_PURE_STILL_THR_MIN 0
|
||||
#define CVI_H26X_AVBR_PURE_STILL_THR_MAX 500
|
||||
|
||||
#define CVI_H26X_INTRACOST_DEFAULT 0
|
||||
#define CVI_H26X_INTRACOST_MIN 0
|
||||
#define CVI_H26X_INTRACOST_MAX 16383
|
||||
|
||||
#define CVI_H26X_THRDLV_DEFAULT 2
|
||||
#define CVI_H26X_THRDLV_MIN 0
|
||||
#define CVI_H26X_THRDLV_MAX 4
|
||||
|
||||
#define CVI_H26X_BG_ENHANCE_EN_DEFAULT 0
|
||||
#define CVI_H26X_BG_ENHANCE_EN_MIN 0
|
||||
#define CVI_H26X_BG_ENHANCE_EN_MAX 1
|
||||
|
||||
#define CVI_H26X_BG_DELTA_QP_DEFAULT 0
|
||||
#define CVI_H26X_BG_DELTA_QP_MIN -8
|
||||
#define CVI_H26X_BG_DELTA_QP_MAX 8
|
||||
|
||||
#define CVI_H26X_ROW_QP_DELTA_DEFAULT 1
|
||||
#define CVI_H26X_ROW_QP_DELTA_MIN 0
|
||||
#define CVI_H26X_ROW_QP_DELTA_MAX 10
|
||||
|
||||
#define CVI_H26X_SUPER_FRM_MODE_DEFAULT 0
|
||||
#define CVI_H26X_SUPER_FRM_MODE_MIN 0
|
||||
#define CVI_H26X_SUPER_FRM_MODE_MAX 3
|
||||
|
||||
#define CVI_H26X_SUPER_I_BITS_THR_DEFAULT (4 * 8 * 1024 * 1024)
|
||||
#define CVI_H26X_SUPER_I_BITS_THR_MIN 1000
|
||||
#define CVI_H26X_SUPER_I_BITS_THR_MAX (10 * 8 * 1024 * 1024)
|
||||
|
||||
#define CVI_H26X_SUPER_P_BITS_THR_DEFAULT (4 * 8 * 1024 * 1024)
|
||||
#define CVI_H26X_SUPER_P_BITS_THR_MIN 1000
|
||||
#define CVI_H26X_SUPER_P_BITS_THR_MAX (10 * 8 * 1024 * 1024)
|
||||
|
||||
#define CVI_H26X_MAX_RE_ENCODE_DEFAULT 0
|
||||
#define CVI_H26X_MAX_RE_ENCODE_MIN 0
|
||||
#define CVI_H26X_MAX_RE_ENCODE_MAX 4
|
||||
|
||||
#define CVI_H26X_ASPECT_RATIO_INFO_PRESENT_FLAG_DEFAULT 0
|
||||
#define CVI_H26X_ASPECT_RATIO_INFO_PRESENT_FLAG_MIN 0
|
||||
#define CVI_H26X_ASPECT_RATIO_INFO_PRESENT_FLAG_MAX 1
|
||||
|
||||
#define CVI_H26X_ASPECT_RATIO_IDC_DEFAULT 1
|
||||
#define CVI_H26X_ASPECT_RATIO_IDC_MIN 0
|
||||
#define CVI_H26X_ASPECT_RATIO_IDC_MAX 255
|
||||
|
||||
#define CVI_H26X_OVERSCAN_INFO_PRESENT_FLAG_DEFAULT 0
|
||||
#define CVI_H26X_OVERSCAN_INFO_PRESENT_FLAG_MIN 0
|
||||
#define CVI_H26X_OVERSCAN_INFO_PRESENT_FLAG_MAX 1
|
||||
|
||||
#define CVI_H26X_OVERSCAN_APPROPRIATE_FLAG_DEFAULT 0
|
||||
#define CVI_H26X_OVERSCAN_APPROPRIATE_FLAG_MIN 0
|
||||
#define CVI_H26X_OVERSCAN_APPROPRIATE_FLAG_MAX 1
|
||||
|
||||
#define CVI_H26X_SAR_WIDTH_DEFAULT 1
|
||||
#define CVI_H26X_SAR_WIDTH_MIN 1
|
||||
#define CVI_H26X_SAR_WIDTH_MAX 65535
|
||||
|
||||
#define CVI_H26X_SAR_HEIGHT_DEFAULT 1
|
||||
#define CVI_H26X_SAR_HEIGHT_MIN 1
|
||||
#define CVI_H26X_SAR_HEIGHT_MAX 65535
|
||||
|
||||
#define CVI_H26X_TIMING_INFO_PRESENT_FLAG_DEFAULT 0
|
||||
#define CVI_H26X_TIMING_INFO_PRESENT_FLAG_MIN 0
|
||||
#define CVI_H26X_TIMING_INFO_PRESENT_FLAG_MAX 1
|
||||
|
||||
#define CVI_H264_FIXED_FRAME_RATE_FLAG_DEFAULT 0
|
||||
#define CVI_H264_FIXED_FRAME_RATE_FLAG_MIN 0
|
||||
#define CVI_H264_FIXED_FRAME_RATE_FLAG_MAX 1
|
||||
|
||||
#define CVI_H26X_NUM_UNITS_IN_TICK_DEFAULT 1
|
||||
#define CVI_H26X_NUM_UNITS_IN_TICK_MIN 1
|
||||
#define CVI_H26X_NUM_UNITS_IN_TICK_MAX 4294967295
|
||||
|
||||
#define CVI_H26X_TIME_SCALE_DEFAULT 60
|
||||
#define CVI_H26X_TIME_SCALE_MIN 1
|
||||
#define CVI_H26X_TIME_SCALE_MAX 4294967295
|
||||
|
||||
#define CVI_H265_NUM_TICKS_POC_DIFF_ONE_MINUS1_DEFAULT 1
|
||||
#define CVI_H265_NUM_TICKS_POC_DIFF_ONE_MINUS1_MIN 0
|
||||
#define CVI_H265_NUM_TICKS_POC_DIFF_ONE_MINUS1_MAX 4294967294
|
||||
|
||||
#define CVI_H26X_VIDEO_SIGNAL_TYPE_PRESENT_FLAG_DEFAULT 0
|
||||
#define CVI_H26X_VIDEO_SIGNAL_TYPE_PRESENT_FLAG_MIN 0
|
||||
#define CVI_H26X_VIDEO_SIGNAL_TYPE_PRESENT_FLAG_MAX 1
|
||||
|
||||
#define CVI_H26X_VIDEO_FORMAT_DEFAULT 5
|
||||
#define CVI_H26X_VIDEO_FORMAT_MIN 0
|
||||
#define CVI_H264_VIDEO_FORMAT_MAX 7
|
||||
#define CVI_H265_VIDEO_FORMAT_MAX 5
|
||||
|
||||
#define CVI_H26X_VIDEO_FULL_RANGE_FLAG_DEFAULT 0
|
||||
#define CVI_H26X_VIDEO_FULL_RANGE_FLAG_MIN 0
|
||||
#define CVI_H26X_VIDEO_FULL_RANGE_FLAG_MAX 1
|
||||
|
||||
#define CVI_H26X_COLOUR_DESCRIPTION_PRESENT_FLAG_DEFAULT 0
|
||||
#define CVI_H26X_COLOUR_DESCRIPTION_PRESENT_FLAG_MIN 0
|
||||
#define CVI_H26X_COLOUR_DESCRIPTION_PRESENT_FLAG_MAX 1
|
||||
|
||||
#define CVI_H26X_COLOUR_PRIMARIES_DEFAULT 2
|
||||
#define CVI_H26X_COLOUR_PRIMARIES_MIN 0
|
||||
#define CVI_H26X_COLOUR_PRIMARIES_MAX 255
|
||||
|
||||
#define CVI_H26X_TRANSFER_CHARACTERISTICS_DEFAULT 2
|
||||
#define CVI_H26X_TRANSFER_CHARACTERISTICS_MIN 0
|
||||
#define CVI_H26X_TRANSFER_CHARACTERISTICS_MAX 255
|
||||
|
||||
#define CVI_H26X_MATRIX_COEFFICIENTS_DEFAULT 2
|
||||
#define CVI_H26X_MATRIX_COEFFICIENTS_MIN 0
|
||||
#define CVI_H26X_MATRIX_COEFFICIENTS_MAX 255
|
||||
|
||||
#define CVI_H26X_BITSTREAM_RESTRICTION_FLAG_DEFAULT 0
|
||||
#define CVI_H26X_BITSTREAM_RESTRICTION_FLAG_MIN 0
|
||||
#define CVI_H26X_BITSTREAM_RESTRICTION_FLAG_MAX 1
|
||||
|
||||
#define CVI_H26X_TEST_UBR_EN_DEFAULT 0
|
||||
#define CVI_H26X_TEST_UBR_EN_MIN 0
|
||||
#define CVI_H26X_TEST_UBR_EN_MAX 1
|
||||
|
||||
#define CVI_H26X_FRAME_QP_DEFAULT 38
|
||||
#define CVI_H26X_FRAME_QP_MIN 0
|
||||
#define CVI_H26X_FRAME_QP_MAX 51
|
||||
|
||||
#define CVI_H26X_FRAME_BITS_DEFAULT (200 * 1000)
|
||||
#define CVI_H26X_FRAME_BITS_MIN 1000
|
||||
#define CVI_H26X_FRAME_BITS_MAX 10000000
|
||||
|
||||
#define CVI_H26X_ES_BUFFER_QUEUE_DEFAULT 1
|
||||
#define CVI_H26X_ES_BUFFER_QUEUE_MIN 0
|
||||
#define CVI_H26X_ES_BUFFER_QUEUE_MAX 1
|
||||
|
||||
#define CVI_H26X_ISO_SEND_FRAME_DEFAUL 1
|
||||
#define CVI_H26X_ISO_SEND_FRAME_MIN 0
|
||||
#define CVI_H26X_ISO_SEND_FRAME_MAX 1
|
||||
|
||||
#define CVI_H26X_SENSOR_EN_DEFAULT 0
|
||||
#define CVI_H26X_SENSOR_EN_MIN 0
|
||||
#define CVI_H26X_SENSOR_EN_MAX 1
|
||||
|
||||
#define DEF_STAT_TIME -1
|
||||
#define DEF_GOP 30
|
||||
#define DEF_IQP 32
|
||||
#define DEF_PQP 32
|
||||
|
||||
#define DEF_VARI_FPS_EN 0
|
||||
#define DEF_264_GOP 60
|
||||
#define DEF_264_MAXIQP 51
|
||||
#define DEF_264_MINIQP 1
|
||||
#define DEF_264_MAXQP 51
|
||||
#define DEF_264_MINQP 1
|
||||
#define DEF_264_MAXBITRATE 5000
|
||||
#define DEF_26X_CHANGE_POS 90
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __CVI_VENC_H__ */
|
||||
589
middleware/v2/include/cvi_vi.h
Normal file
589
middleware/v2/include/cvi_vi.h
Normal file
@@ -0,0 +1,589 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_vi.h
|
||||
* Description:
|
||||
* MMF Programe Interface for video input management moudle
|
||||
*/
|
||||
|
||||
#ifndef __CVI_VI_H__
|
||||
#define __CVI_VI_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <linux/cvi_comm_vi.h>
|
||||
#include <linux/cvi_comm_gdc.h>
|
||||
#include <cvi_comm_vb.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @brief Suspend vi.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_Suspend(void);
|
||||
|
||||
/**
|
||||
* @brief Resume vi.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_Resume(void);
|
||||
|
||||
/* 1 for vi device */
|
||||
/**
|
||||
* @brief Set vi device num.
|
||||
*
|
||||
* @param devNum(In), Device Num.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SetDevNum(CVI_U32 devNum);
|
||||
|
||||
/**
|
||||
* @brief Get vi device num.
|
||||
*
|
||||
* @param devNum(Out), Device Num.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetDevNum(CVI_U32 *devNum);
|
||||
|
||||
/**
|
||||
* @brief Set vi device attribute.
|
||||
*
|
||||
* @param ViDev(In), Device ID.
|
||||
* @param pstDevAttr(In), Device attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SetDevAttr(VI_DEV ViDev, const VI_DEV_ATTR_S *pstDevAttr);
|
||||
|
||||
/**
|
||||
* @brief Get vi device attribute.
|
||||
*
|
||||
* @param ViDev(In), Device ID.
|
||||
* @param pstDevAttr(Out), Device Attribute
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetDevAttr(VI_DEV ViDev, VI_DEV_ATTR_S *pstDevAttr);
|
||||
|
||||
/**
|
||||
* @brief Enable vi device.
|
||||
*
|
||||
* @param ViDev(In), Device ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_EnableDev(VI_DEV ViDev);
|
||||
|
||||
/**
|
||||
* @brief Disable vi device.
|
||||
*
|
||||
* @param ViDev(In), Device ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_DisableDev(VI_DEV ViDev);
|
||||
|
||||
/**
|
||||
* @brief Set device timing attribute.
|
||||
*
|
||||
* @param ViDev(In), Device ID.
|
||||
* @param pstTimingAttr(In), Timing Attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SetDevTimingAttr(VI_DEV ViDev, const VI_DEV_TIMING_ATTR_S *pstTimingAttr);
|
||||
|
||||
/**
|
||||
* @brief Get device timing attribute.
|
||||
*
|
||||
* @param ViDev(In), Device ID.
|
||||
* @param pstTimingAttr(Out), Timing Attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetDevTimingAttr(VI_DEV ViDev, VI_DEV_TIMING_ATTR_S *pstTimingAttr);
|
||||
|
||||
/**
|
||||
* @brief Create vi pipe.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param pstPipeAttr(In), Pipe Attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_CreatePipe(VI_PIPE ViPipe, const VI_PIPE_ATTR_S *pstPipeAttr);
|
||||
|
||||
/**
|
||||
* @brief Destroy vi pipe.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_DestroyPipe(VI_PIPE ViPipe);
|
||||
|
||||
/**
|
||||
* @brief Set vi pipe attribute.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param pstPipeAttr(In), Pipe Attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SetPipeAttr(VI_PIPE ViPipe, const VI_PIPE_ATTR_S *pstPipeAttr);
|
||||
|
||||
/**
|
||||
* @brief Get vi pipe attribute.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param pstPipeAttr(Out), Pipe Attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetPipeAttr(VI_PIPE ViPipe, VI_PIPE_ATTR_S *pstPipeAttr);
|
||||
|
||||
/**
|
||||
* @brief Start vi pipe.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_StartPipe(VI_PIPE ViPipe);
|
||||
|
||||
/**
|
||||
* @brief Stop vi pipe.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
*
|
||||
* @return VI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_StopPipe(VI_PIPE ViPipe);
|
||||
|
||||
/**
|
||||
* @brief Set pipe crop.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param pstCropInfo(In), Crop Info.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SetPipeCrop(VI_PIPE ViPipe, const CROP_INFO_S *pstCropInfo);
|
||||
|
||||
/**
|
||||
* @brief Get pipe crop info.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param pstCropInfo(Out), Crop Info.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetPipeCrop(VI_PIPE ViPipe, CROP_INFO_S *pstCropInfo);
|
||||
|
||||
/**
|
||||
* @brief Set pipe dump attribute.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param pstDumpAttr(In), Dump Attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SetPipeDumpAttr(VI_PIPE ViPipe, const VI_DUMP_ATTR_S *pstDumpAttr);
|
||||
|
||||
/**
|
||||
* @brief Get pipe dump attribute.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param pstDumpAttr(Out), Dump Attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetPipeDumpAttr(VI_PIPE ViPipe, VI_DUMP_ATTR_S *pstDumpAttr);
|
||||
|
||||
/**
|
||||
* @brief Set Pipe frame source.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param enSource(In), Source from Dev or FE or BE.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SetPipeFrameSource(VI_PIPE ViPipe, const VI_PIPE_FRAME_SOURCE_E enSource);
|
||||
|
||||
/**
|
||||
* @brief Get Pipe frame source.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param penSource(In), Source from Dev or FE or BE.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetPipeFrameSource(VI_PIPE ViPipe, VI_PIPE_FRAME_SOURCE_E *penSource);
|
||||
|
||||
/**
|
||||
* @brief Get vi pipe frame(raw image).
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param pstVideoFrame(Out), Frame Info.
|
||||
* @param s32MilliSec(In), Timeout Unit ms.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetPipeFrame(VI_PIPE ViPipe, VIDEO_FRAME_INFO_S *pstVideoFrame, CVI_S32 s32MilliSec);
|
||||
|
||||
/**
|
||||
* @brief Release vi pipe frame(raw image).
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param pstVideoFrame(In), Frame Info.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_ReleasePipeFrame(VI_PIPE ViPipe, const VIDEO_FRAME_INFO_S *pstVideoFrame);
|
||||
|
||||
/**
|
||||
* @brief Start vi pipe frame(Continuous).
|
||||
*
|
||||
* @param pstDumpInfo(In), Continuous dump raw info.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_StartSmoothRawDump(const VI_SMOOTH_RAW_DUMP_INFO_S *pstDumpInfo);
|
||||
|
||||
/**
|
||||
* @brief Stop vi pipe frame(Continuous).
|
||||
*
|
||||
* @param pstDumpInfo(In), Continuous dump raw info.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_StopSmoothRawDump(const VI_SMOOTH_RAW_DUMP_INFO_S *pstDumpInfo);
|
||||
|
||||
/**
|
||||
* @brief Get vi pipe frame(Continuous).
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param pstVideoFrame(In), Frame Info.
|
||||
* @param s32MilliSec(In), Timeout Unit ms.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetSmoothRawDump(VI_PIPE ViPipe, VIDEO_FRAME_INFO_S *pstVideoFrame, CVI_S32 s32MilliSec);
|
||||
|
||||
/**
|
||||
* @brief Put vi pipe frame(Continuous).
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param pstVideoFrame(In), Frame Info.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_PutSmoothRawDump(VI_PIPE ViPipe, const VIDEO_FRAME_INFO_S *pstVideoFrame);
|
||||
|
||||
/**
|
||||
* @brief Send raw to pipe.
|
||||
*
|
||||
* @param u32PipeNum(In), Pipe Num.
|
||||
* @param PipeId(In), Pipe ID.
|
||||
* @param pstVideoFrame(In), Frame Info.
|
||||
* @param s32MilliSec(In), Timeout Unit ms.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SendPipeRaw(CVI_U32 u32PipeNum, VI_PIPE PipeId[], const VIDEO_FRAME_INFO_S *pstVideoFrame[],
|
||||
CVI_S32 s32MilliSec);
|
||||
|
||||
/**
|
||||
* @brief Query Pipe Status.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param pstStatus(In), Pipe Status.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_QueryPipeStatus(VI_PIPE ViPipe, VI_PIPE_STATUS_S *pstStatus);
|
||||
|
||||
/**
|
||||
* @brief Get pipe file descriptor
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetPipeFd(VI_PIPE ViPipe);
|
||||
|
||||
/**
|
||||
* @brief Dump isp hardware register to file
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param fp(In), File Descriptor.
|
||||
* @param pstRegTbl(In), ISP MlscGainLut.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_DumpHwRegisterToFile(VI_PIPE ViPipe, FILE *fp, VI_DUMP_REGISTER_TABLE_S *pstRegTbl);
|
||||
|
||||
/**
|
||||
* @brief Vi channel get vb from a specified pool.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param VbPool(In), VB pool ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_AttachVbPool(VI_PIPE ViPipe, VI_CHN ViChn, VB_POOL VbPool);
|
||||
|
||||
/**
|
||||
* @brief Cancel channel specified pool.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_DetachVbPool(VI_PIPE ViPipe, VI_CHN ViChn);
|
||||
|
||||
/**
|
||||
* @brief Set vi channel attribute.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param pstChnAttr(In), Channel Attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SetChnAttr(VI_PIPE ViPipe, VI_CHN ViChn, VI_CHN_ATTR_S *pstChnAttr);
|
||||
|
||||
/**
|
||||
* @brief Get vi channel attribute.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param pstChnAttr(Out), Channel Attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetChnAttr(VI_PIPE ViPipe, VI_CHN ViChn, VI_CHN_ATTR_S *pstChnAttr);
|
||||
|
||||
/**
|
||||
* @brief Enable vi channel.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_EnableChn(VI_PIPE ViPipe, VI_CHN ViChn);
|
||||
|
||||
/**
|
||||
* @brief Disable vi channel.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_DisableChn(VI_PIPE ViPipe, VI_CHN ViChn);
|
||||
|
||||
/**
|
||||
* @brief Set vi channel crop.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param pstCropInfo(In), Channel Crop Info.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SetChnCrop(VI_PIPE ViPipe, VI_CHN ViChn, const VI_CROP_INFO_S *pstCropInfo);
|
||||
|
||||
/**
|
||||
* @brief Get vi channel crop.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param pstCropInfo(Out), Channel Crop Info.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetChnCrop(VI_PIPE ViPipe, VI_CHN ViChn, VI_CROP_INFO_S *pstCropInfo);
|
||||
|
||||
/**
|
||||
* @brief Set vi channel rotate.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param enRotation(In), Degree of rotation(0/90/180/270)
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SetChnRotation(VI_PIPE ViPipe, VI_CHN ViChn, const ROTATION_E enRotation);
|
||||
|
||||
/**
|
||||
* @brief Get vi channel rotate.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param enRotation(Out), Degree of rotation
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetChnRotation(VI_PIPE ViPipe, VI_CHN ViChn, ROTATION_E *penRotation);
|
||||
|
||||
/**
|
||||
* @brief Set vi channel LDC attribute.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param pstLDCAttr(In), LDC Attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SetChnLDCAttr(VI_PIPE ViPipe, VI_CHN ViChn, const VI_LDC_ATTR_S *pstLDCAttr);
|
||||
|
||||
/**
|
||||
* @brief Get vi channel LDC attribute.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param pstLDCAttr(Out), LDC Attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetChnLDCAttr(VI_PIPE ViPipe, VI_CHN ViChn, VI_LDC_ATTR_S *pstLDCAttr);
|
||||
|
||||
/**
|
||||
* @brief Get vi frame from a specified channel.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param pstFrameInfo(Out), Frame Info.
|
||||
* @param s32MilliSec(In), Timeout Unit ms.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetChnFrame(VI_PIPE ViPipe, VI_CHN ViChn, VIDEO_FRAME_INFO_S *pstFrameInfo, CVI_S32 s32MilliSec);
|
||||
|
||||
/**
|
||||
* @brief release vi channel frame.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param pstFrameInfo(In), Frame Info.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_ReleaseChnFrame(VI_PIPE ViPipe, VI_CHN ViChn, const VIDEO_FRAME_INFO_S *pstFrameInfo);
|
||||
|
||||
/**
|
||||
* @brief Query vi channel status.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param pstChnStatus(Out), channel status.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_QueryChnStatus(VI_PIPE ViPipe, VI_CHN ViChn, VI_CHN_STATUS_S *pstChnStatus);
|
||||
|
||||
/**
|
||||
* @brief Vi close fd.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_CloseFd(void);
|
||||
|
||||
/**
|
||||
* @brief Register flip mirror callback.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViDev(In), Device ID.
|
||||
* @param pvData(In), Point of Sensor Flip Mirror Function.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_RegChnFlipMirrorCallBack(VI_PIPE ViPipe, VI_DEV ViDev, void *pvData);
|
||||
|
||||
/**
|
||||
* @brief Unregister flip mirror callback.
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViDev(In), Device ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_UnRegChnFlipMirrorCallBack(VI_PIPE ViPipe, VI_DEV ViDev);
|
||||
|
||||
/**
|
||||
* @brief Set vi chn flip and mirror
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(In), Channel ID.
|
||||
* @param bFlip(In), Flip(0/1).
|
||||
* @param bMirror(In), Mirror(0/1).
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_SetChnFlipMirror(VI_PIPE ViPipe, VI_CHN ViChn, CVI_BOOL bFlip, CVI_BOOL bMirror);
|
||||
|
||||
/**
|
||||
* @brief Set vi chn flip and mirror
|
||||
*
|
||||
* @param ViPipe(In), Pipe ID.
|
||||
* @param ViChn(Out), Channel ID.
|
||||
* @param bFlip(Out), Flip(0/1).
|
||||
* @param bMirror(In), Mirror(0/1).
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_GetChnFlipMirror(VI_PIPE ViPipe, VI_CHN ViChn, CVI_BOOL *pbFlip, CVI_BOOL *pbMirror);
|
||||
|
||||
/**
|
||||
* @brief Register Power Management Callback
|
||||
*
|
||||
* @param ViDev(In), Device ID.
|
||||
* @param pstPmOps(In), Power Management operator.
|
||||
* @param pvData(In), Point of VI_PM_DATA_S.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_RegPmCallBack(VI_DEV ViDev, VI_PM_OPS_S *pstPmOps, void *pvData);
|
||||
|
||||
/**
|
||||
* @brief Unregister Power Management Callback.
|
||||
*
|
||||
* @param ViDev(In), Device ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VI_UnRegPmCallBack(VI_DEV ViDev);
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
CVI_S32 CVI_VI_Trig_AHD(VI_PIPE ViPipe, CVI_U8 u8AHDSignal);
|
||||
CVI_S32 CVI_VI_SetDevBindPipe(VI_DEV ViDev, const VI_DEV_BIND_PIPE_S *pstDevBindPipe);
|
||||
CVI_S32 CVI_VI_GetDevBindPipe(VI_DEV ViDev, VI_DEV_BIND_PIPE_S *pstDevBindPipe);
|
||||
CVI_S32 CVI_VI_SetExtChnFisheye(VI_PIPE ViPipe, VI_CHN ViChn, const FISHEYE_ATTR_S *pstFishEyeAttr);
|
||||
CVI_S32 CVI_VI_GetExtChnFisheye(VI_PIPE ViPipe, VI_CHN ViChn, FISHEYE_ATTR_S *pstFishEyeAttr);
|
||||
CVI_S32 CVI_VI_SetExtChnAttr(VI_PIPE ViPipe, VI_CHN ViChn, const VI_EXT_CHN_ATTR_S *pstExtChnAttr);
|
||||
CVI_S32 CVI_VI_GetExtChnAttr(VI_PIPE ViPipe, VI_CHN ViChn, VI_EXT_CHN_ATTR_S *pstExtChnAttr);
|
||||
// for fpga test
|
||||
CVI_S32 _CVI_VI_CFG_CTRL_TEST(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /*__CVI_VI_H__ */
|
||||
376
middleware/v2/include/cvi_vo.h
Normal file
376
middleware/v2/include/cvi_vo.h
Normal file
@@ -0,0 +1,376 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_vo.h
|
||||
* Description:
|
||||
* MMF Programe Interface for video output management moudle
|
||||
*/
|
||||
|
||||
#ifndef __CVI_VO_H__
|
||||
#define __CVI_VO_H__
|
||||
|
||||
#include <linux/cvi_comm_vo.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Device Relative Settings */
|
||||
|
||||
/**
|
||||
* @brief Set vo device attribute.
|
||||
*
|
||||
* @param VoDev(In), Device ID.
|
||||
* @param pstPubAttr(In), Device attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_SetPubAttr(VO_DEV VoDev, const VO_PUB_ATTR_S *pstPubAttr);
|
||||
|
||||
/**
|
||||
* @brief Get vo device attribute.
|
||||
*
|
||||
* @param VoDev(In), Device ID.
|
||||
* @param pstPubAttr(Out), Device Attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_GetPubAttr(VO_DEV VoDev, VO_PUB_ATTR_S *pstPubAttr);
|
||||
|
||||
/**
|
||||
* @brief Init i80 per instructions
|
||||
*
|
||||
* @param VoDev(In), Device ID.
|
||||
* @param pi80Instr(In), I80 init instructions
|
||||
* @param size(In), Number of pi80Instr
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_I80Init(VO_DEV VoDev, const VO_I80_INSTR_S *pi80Instr, CVI_U8 size);
|
||||
|
||||
/**
|
||||
* @brief Get vo device status.
|
||||
*
|
||||
* @param VoDev(In): Device ID.
|
||||
*
|
||||
* @return CVI_BOOL Return status of VoDev.
|
||||
*/
|
||||
CVI_BOOL CVI_VO_IsEnabled(VO_DEV VoDev);
|
||||
|
||||
/**
|
||||
* @brief Enable vo device.
|
||||
*
|
||||
* @param VoDev(In): Device ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_Enable(VO_DEV VoDev);
|
||||
|
||||
/**
|
||||
* @brief Disable vo device.
|
||||
*
|
||||
* @param VoDev(In): Device ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_Disable(VO_DEV VoDev);
|
||||
|
||||
/**
|
||||
* @brief Close vo device file descriptor.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_CloseFd(void);
|
||||
|
||||
/* Video Relative Settings */
|
||||
/**
|
||||
* @brief Set vo videolayer attribute.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param pstLayerAttr(In), Videolayer attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_SetVideoLayerAttr(VO_LAYER VoLayer, const VO_VIDEO_LAYER_ATTR_S *pstLayerAttr);
|
||||
|
||||
/**
|
||||
* @brief Get vo videolayer attribute.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param pstLayerAttr(Out), Videolayer attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_GetVideoLayerAttr(VO_LAYER VoLayer, VO_VIDEO_LAYER_ATTR_S *pstLayerAttr);
|
||||
|
||||
/**
|
||||
* @brief Enable vo videolayer.
|
||||
*
|
||||
* @param VoLayer(In): Videolayer ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_EnableVideoLayer(VO_LAYER VoLayer);
|
||||
|
||||
/**
|
||||
* @brief Disable vo videolayer.
|
||||
*
|
||||
* @param VoLayer(In): Videolayer ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_DisableVideoLayer(VO_LAYER VoLayer);
|
||||
|
||||
/**
|
||||
* @brief Get videolayer image quality control.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param type(In), Brightness/contrast/saturation/hue.
|
||||
* @param ctrl(out), Control info.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_GetLayerProcAmpCtrl(VO_LAYER VoLayer, PROC_AMP_E type, PROC_AMP_CTRL_S *ctrl);
|
||||
|
||||
/**
|
||||
* @brief Get videolayer image brightness/contrast/saturation/hue value.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param type(In), Brightness/contrast/saturation/hue.
|
||||
* @param value(out), Value.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_GetLayerProcAmp(VO_LAYER VoLayer, PROC_AMP_E type, CVI_S32 *value);
|
||||
|
||||
/**
|
||||
* @brief Set videolayer image brightness/contrast/saturation/hue value.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param type(In), Brightness/contrast/saturation/hue.
|
||||
* @param value(In), Value.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_SetLayerProcAmp(VO_LAYER VoLayer, PROC_AMP_E type, CVI_S32 value);
|
||||
|
||||
/* Display relative operations */
|
||||
/**
|
||||
* @brief Set videolayer buffer length.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param u32BufLen(In), Buffer length.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_SetDisplayBufLen(VO_LAYER VoLayer, CVI_U32 u32BufLen);
|
||||
|
||||
/**
|
||||
* @brief Get videolayer buffer length.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param pu32BufLen(Out), Buffer length.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_GetDisplayBufLen(VO_LAYER VoLayer, CVI_U32 *pu32BufLen);
|
||||
|
||||
/* Channel Relative Operations */
|
||||
/**
|
||||
* @brief Set vo channel attribute.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
* @param pstChnAttr(In), Channel attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_SetChnAttr(VO_LAYER VoLayer, VO_CHN VoChn, const VO_CHN_ATTR_S *pstChnAttr);
|
||||
|
||||
/**
|
||||
* @brief Get vo channel attribute.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
* @param pstChnAttr(Out), Channel attribute.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_GetChnAttr(VO_LAYER VoLayer, VO_CHN VoChn, VO_CHN_ATTR_S *pstChnAttr);
|
||||
|
||||
/**
|
||||
* @brief Enable vo channel.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_EnableChn(VO_LAYER VoLayer, VO_CHN VoChn);
|
||||
|
||||
/**
|
||||
* @brief Disable vo channel.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_DisableChn(VO_LAYER VoLayer, VO_CHN VoChn);
|
||||
|
||||
/**
|
||||
* @brief Pause vo channel.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_PauseChn(VO_LAYER VoLayer, VO_CHN VoChn);
|
||||
|
||||
/**
|
||||
* @brief Resume vo channel.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_ResumeChn(VO_LAYER VoLayer, VO_CHN VoChn);
|
||||
|
||||
/**
|
||||
* @brief Show vo channel.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_ShowChn(VO_LAYER VoLayer, VO_CHN VoChn);
|
||||
|
||||
/**
|
||||
* @brief Hide vo channel.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_HideChn(VO_LAYER VoLayer, VO_CHN VoChn);
|
||||
|
||||
/**
|
||||
* @brief Show vo Pattern.
|
||||
*
|
||||
* @param VoDev(In), VoDev ID.
|
||||
* @param PatternId(In), PatternId ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_ShowPattern(VO_DEV VoDev, enum VO_PATTERN_MODE PatternId);
|
||||
|
||||
/**
|
||||
* @brief Send frame to vo channel.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
* @param pstVideoFrame(In), Frame info.
|
||||
* @param s32MilliSec(In), Timeout.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_SendFrame(VO_LAYER VoLayer, VO_CHN VoChn, VIDEO_FRAME_INFO_S *pstVideoFrame, CVI_S32 s32MilliSec);
|
||||
|
||||
/**
|
||||
* @brief Clear vo channel buffer.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
* @param bClrAll(In), Clear all buffer or not.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_ClearChnBuf(VO_LAYER VoLayer, VO_CHN VoChn, CVI_BOOL bClrAll);
|
||||
|
||||
/**
|
||||
* @brief Set vo channel rotation.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
* @param enRotation(In), Rotation.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_SetChnRotation(VO_LAYER VoLayer, VO_CHN VoChn, ROTATION_E enRotation);
|
||||
|
||||
/**
|
||||
* @brief Get vo channel rotation.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
* @param penRotation(Out), Rotation.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_GetChnRotation(VO_LAYER VoLayer, VO_CHN VoChn, ROTATION_E *penRotation);
|
||||
|
||||
|
||||
/* Module Parameter Settings */
|
||||
/**
|
||||
* @brief Get panel status.
|
||||
*
|
||||
* @param VoLayer(In), Videolayer ID.
|
||||
* @param VoChn(In), Channel ID.
|
||||
* @param is_init(Out), Initialised or not.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_Get_Panel_Status(VO_LAYER VoLayer, VO_CHN VoChn, CVI_U32 *is_init);
|
||||
|
||||
/**
|
||||
* @brief Register Power Management Callback.
|
||||
*
|
||||
* @param VoDev(In), Device ID.
|
||||
* @param pstPmOps(In), Power Management operator.
|
||||
* @param pvData(In), Pointer of VO_PM_OPS_S.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_RegPmCallBack(VO_DEV VoDev, VO_PM_OPS_S *pstPmOps, void *pvData);
|
||||
|
||||
/**
|
||||
* @brief Unegister Power Management Callback.
|
||||
*
|
||||
* @param VoDev(In), Device ID.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_UnRegPmCallBack(VO_DEV VoDev);
|
||||
|
||||
/**
|
||||
* @brief Set vo gamma info.
|
||||
*
|
||||
* @param pinfo(In), gamma info.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_SetGammaInfo(VO_GAMMA_INFO_S *pinfo);
|
||||
|
||||
/**
|
||||
* @brief Get vo gamma info.
|
||||
*
|
||||
* @param pinfo(Out), gamma info.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VO_GetGammaInfo(VO_GAMMA_INFO_S *pinfo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif // __CVI_VO_H__
|
||||
474
middleware/v2/include/cvi_vpss.h
Normal file
474
middleware/v2/include/cvi_vpss.h
Normal file
@@ -0,0 +1,474 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_vpss.h
|
||||
* Description:
|
||||
* MMF Programe Interface for video processing moudle
|
||||
*/
|
||||
|
||||
#ifndef __CVI_VPSS_H__
|
||||
#define __CVI_VPSS_H__
|
||||
|
||||
#include <linux/cvi_common.h>
|
||||
#include <linux/cvi_comm_video.h>
|
||||
#include <linux/cvi_comm_vpss.h>
|
||||
#include "cvi_comm_vb.h"
|
||||
#include <linux/cvi_comm_gdc.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****** Group Settings ******/
|
||||
|
||||
/**
|
||||
* @brief Create vpss group.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param pstGrpAttr(In), group attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_CreateGrp(VPSS_GRP VpssGrp, const VPSS_GRP_ATTR_S *pstGrpAttr);
|
||||
|
||||
/**
|
||||
* @brief Destroy vpss group.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_DestroyGrp(VPSS_GRP VpssGrp);
|
||||
|
||||
/**
|
||||
* @brief Get Available group ID.
|
||||
*
|
||||
* @return Return group ID.
|
||||
*/
|
||||
VPSS_GRP CVI_VPSS_GetAvailableGrp(void);
|
||||
|
||||
/**
|
||||
* @brief Start vpss group.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_StartGrp(VPSS_GRP VpssGrp);
|
||||
|
||||
/**
|
||||
* @brief Stop vpss group.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_StopGrp(VPSS_GRP VpssGrp);
|
||||
|
||||
/**
|
||||
* @brief Reset vpss group.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_ResetGrp(VPSS_GRP VpssGrp);
|
||||
|
||||
/**
|
||||
* @brief Get vpss group attribute.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param pstGrpAttr(Out), group attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetGrpAttr(VPSS_GRP VpssGrp, VPSS_GRP_ATTR_S *pstGrpAttr);
|
||||
|
||||
/**
|
||||
* @brief Set vpss group attribute.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param pstGrpAttr(In), group attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SetGrpAttr(VPSS_GRP VpssGrp, const VPSS_GRP_ATTR_S *pstGrpAttr);
|
||||
|
||||
/**
|
||||
* @brief Set crop info of vpss group.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param pstCropInfo(In), crop info.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SetGrpCrop(VPSS_GRP VpssGrp, const VPSS_CROP_INFO_S *pstCropInfo);
|
||||
|
||||
/**
|
||||
* @brief Get crop info of vpss group.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param pstCropInfo(Out), crop info.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetGrpCrop(VPSS_GRP VpssGrp, VPSS_CROP_INFO_S *pstCropInfo);
|
||||
|
||||
/**
|
||||
* @brief Send frame to vpss group.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param pstVideoFrame(In), frame info.
|
||||
* @param s32MilliSec(In), timeouts.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SendFrame(VPSS_GRP VpssGrp, const VIDEO_FRAME_INFO_S *pstVideoFrame, CVI_S32 s32MilliSec);
|
||||
|
||||
/**
|
||||
* @brief Image quality control.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param type(In), brightness/contrast/saturation/hue.
|
||||
* @param ctrl(In), control info.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetGrpProcAmpCtrl(VPSS_GRP VpssGrp, PROC_AMP_E type, PROC_AMP_CTRL_S *ctrl);
|
||||
|
||||
/**
|
||||
* @brief Get the brightness/contrast/saturation/hue value.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param type(In), brightness/contrast/saturation/hue.
|
||||
* @param value(Out), value.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetGrpProcAmp(VPSS_GRP VpssGrp, PROC_AMP_E type, CVI_S32 *value);
|
||||
|
||||
/**
|
||||
* @brief Set the brightness/contrast/saturation/hue value.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param type(In), brightness/contrast/saturation/hue.
|
||||
* @param value(In), value.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SetGrpProcAmp(VPSS_GRP VpssGrp, PROC_AMP_E type, CVI_S32 value);
|
||||
|
||||
/* Apply the settings of scene from bin
|
||||
*
|
||||
* @param VpssGrp: the vpss grp to apply
|
||||
* @param scene: the scene of settings stored in bin to use
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SetGrpParamfromBin(VPSS_GRP VpssGrp, CVI_U8 scene);
|
||||
|
||||
/*for ISP tool get bin scene*/
|
||||
CVI_S32 CVI_VPSS_GetBinScene(VPSS_GRP VpssGrp, CVI_U8 *scene);
|
||||
|
||||
|
||||
/****** Chn Settings ******/
|
||||
|
||||
/**
|
||||
* @brief Set vpss channel attribute.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param pstChnAttr(In), channel attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SetChnAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, const VPSS_CHN_ATTR_S *pstChnAttr);
|
||||
|
||||
/**
|
||||
* @brief Get vpss channel attribute.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param pstChnAttr(Out), channel attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetChnAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_ATTR_S *pstChnAttr);
|
||||
|
||||
/**
|
||||
* @brief Enable vpss channel.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_EnableChn(VPSS_GRP VpssGrp, VPSS_CHN VpssChn);
|
||||
|
||||
/**
|
||||
* @brief Disable vpss channel.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_DisableChn(VPSS_GRP VpssGrp, VPSS_CHN VpssChn);
|
||||
|
||||
/**
|
||||
* @brief Set crop info of vpss channel.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param pstCropInfo(In), crop info.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SetChnCrop(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, const VPSS_CROP_INFO_S *pstCropInfo);
|
||||
|
||||
/**
|
||||
* @brief Get crop info of vpss channel.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param pstCropInfo(Out), crop info.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetChnCrop(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CROP_INFO_S *pstCropInfo);
|
||||
|
||||
/**
|
||||
* @brief Set vpss channel rotation.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param enRotation(In), Rotation 0/90/180/270.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SetChnRotation(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, ROTATION_E enRotation);
|
||||
|
||||
/**
|
||||
* @brief Get vpss channel rotation.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param enRotation(Out), Rotation value.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetChnRotation(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, ROTATION_E *penRotation);
|
||||
|
||||
/**
|
||||
* @brief Set vpss channel LDC attribute.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param pstLDCAttr(In), LDC attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SetChnLDCAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, const VPSS_LDC_ATTR_S *pstLDCAttr);
|
||||
|
||||
/**
|
||||
* @brief Get vpss channel LDC attribute.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param pstLDCAttr(Out), LDC attribute.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetChnLDCAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_LDC_ATTR_S *pstLDCAttr);
|
||||
|
||||
/**
|
||||
* @brief Send frame to vpss channel.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param pstVideoFrame(In), frame info.
|
||||
* @param s32MilliSec(In), timeout.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SendChnFrame(VPSS_GRP VpssGrp, VPSS_CHN VpssChn,
|
||||
const VIDEO_FRAME_INFO_S *pstVideoFrame, CVI_S32 s32MilliSec);
|
||||
|
||||
/**
|
||||
* @brief Get frame in vpss channel.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param pstVideoFrame(Out), frame info.
|
||||
* @param s32MilliSec(In), timeout.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetChnFrame(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VIDEO_FRAME_INFO_S *pstVideoFrame,
|
||||
CVI_S32 s32MilliSec);
|
||||
|
||||
/**
|
||||
* @brief Release vpss channel frame.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param pstVideoFrame(In), frame info.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_ReleaseChnFrame(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, const VIDEO_FRAME_INFO_S *pstVideoFrame);
|
||||
|
||||
/**
|
||||
* @brief Trigger venc encode.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param u32FrameCnt(In), frame count.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_TriggerSnapFrame(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, CVI_U32 u32FrameCnt);
|
||||
|
||||
/**
|
||||
* @brief Set channel to fetch VB from a specified pool.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param hVbPool(In), VB pool ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_AttachVbPool(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VB_POOL hVbPool);
|
||||
|
||||
/**
|
||||
* @brief Cancel specified pool.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_DetachVbPool(VPSS_GRP VpssGrp, VPSS_CHN VpssChn);
|
||||
|
||||
/**
|
||||
* @brief Set frame buffer stride.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param u32Align(In), buffer stride.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SetChnAlign(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, CVI_U32 u32Align);
|
||||
|
||||
/**
|
||||
* @brief Get frame buffer stride.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param u32Align(Out), buffer stride.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetChnAlign(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, CVI_U32 *pu32Align);
|
||||
|
||||
/**
|
||||
* @brief Set Y ratio for YUV format
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param YRatio(In), Y ratio.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SetChnYRatio(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, CVI_FLOAT YRatio);
|
||||
|
||||
/**
|
||||
* @brief Get Y ratio
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param YRatio(Out), Y ratio.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetChnYRatio(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, CVI_FLOAT *pYRatio);
|
||||
|
||||
/**
|
||||
* @brief Set Scale coefficient level for VPSS.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param enCoef(In), coef enum.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SetChnScaleCoefLevel(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_SCALE_COEF_E enCoef);
|
||||
|
||||
/**
|
||||
* @brief Get Scale coefficient level for VPSS.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param enCoef(Out), coef enum.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetChnScaleCoefLevel(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_SCALE_COEF_E *penCoef);
|
||||
|
||||
/**
|
||||
* @brief channel image display.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_ShowChn(VPSS_GRP VpssGrp, VPSS_CHN VpssChn);
|
||||
|
||||
/**
|
||||
* @brief channel image hidden.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_HideChn(VPSS_GRP VpssGrp, VPSS_CHN VpssChn);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get chn file descriptor.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @return file descriptor.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetChnFd(VPSS_GRP VpssGrp, VPSS_CHN VpssChn);
|
||||
|
||||
/**
|
||||
* @brief Close chn file descriptor.
|
||||
*
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_CloseFd(void);
|
||||
|
||||
/**
|
||||
* @brief Get region luma in vpss chn.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param pstRegionInfo(In), region Info.
|
||||
* @param pu64LumaData(Out), Get the Luma value.
|
||||
* @param s32MilliSec(In), timeout.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetRegionLuma(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, const VIDEO_REGION_INFO_S *pstRegionInfo,
|
||||
CVI_U64 *pu64LumaData, CVI_S32 s32MilliSec);
|
||||
|
||||
/**
|
||||
* @brief Set vpss-venc slice buf config.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param pstVpssChnBufWrap(In), slice buf config.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_SetChnBufWrapAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn,
|
||||
const VPSS_CHN_BUF_WRAP_S *pstVpssChnBufWrap);
|
||||
|
||||
/**
|
||||
* @brief Get vpss-venc slice buf config.
|
||||
*
|
||||
* @param VpssGrp(In), group ID.
|
||||
* @param VpssChn(In), channel ID.
|
||||
* @param pstVpssChnBufWrap(Out), slice buf config.
|
||||
* @return CVI_S32 Return CVI_SUCCESS if succeed.
|
||||
*/
|
||||
CVI_S32 CVI_VPSS_GetChnBufWrapAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn,
|
||||
VPSS_CHN_BUF_WRAP_S *pstVpssChnBufWrap);
|
||||
|
||||
/**
|
||||
* @brief Get vpss-venc slice buf size.
|
||||
*
|
||||
* @param u32Width(In), width.
|
||||
* @param u32Height(In), height.
|
||||
* @param enPixelFormat(In), pixel format.
|
||||
* @param u32BufLine(In), slice buf line num, 64 or 128.
|
||||
* @param u32BufDepth(In), slice buf depth.
|
||||
* @return Return slice buf size.
|
||||
*/
|
||||
CVI_U32 CVI_VPSS_GetWrapBufferSize(CVI_U32 u32Width, CVI_U32 u32Height, PIXEL_FORMAT_E enPixelFormat,
|
||||
CVI_U32 u32BufLine, CVI_U32 u32BufDepth);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __CVI_VPSS_H__ */
|
||||
31
middleware/v2/include/dump_uart.h
Normal file
31
middleware/v2/include/dump_uart.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2022. All rights reserved.
|
||||
*
|
||||
* File Name: fast_image.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __DUMP_UART_H__
|
||||
#define __DUMP_UART_H__
|
||||
|
||||
#define DUMP_PRINT_DEFAULT_SIZE 0x1000
|
||||
|
||||
/* this structure should be modified both freertos & osdrv side */
|
||||
struct dump_uart_s {
|
||||
uint64_t dump_uart_ptr;
|
||||
uint32_t dump_uart_max_size;
|
||||
uint32_t dump_uart_pos;
|
||||
uint8_t dump_uart_enable;
|
||||
uint8_t dump_uart_overflow;
|
||||
} __packed;
|
||||
|
||||
#ifndef __linux__
|
||||
/* used for freertos */
|
||||
struct dump_uart_s *dump_uart_init(void);
|
||||
struct dump_uart_s *dump_uart_msg(void);
|
||||
void dump_uart_enable(void);
|
||||
void dump_uart_disable(void);
|
||||
#endif
|
||||
#endif // end of __DUMP_UART_H__
|
||||
|
||||
155
middleware/v2/include/fast_image.h
Normal file
155
middleware/v2/include/fast_image.h
Normal file
@@ -0,0 +1,155 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2022. All rights reserved.
|
||||
*
|
||||
* File Name: fast_image.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __FAST_IMAGE_HEADER__
|
||||
#define __FAST_IMAGE_HEADER__
|
||||
|
||||
#include "rtos_cmdqu.h"
|
||||
#ifndef __linux__
|
||||
#include "types.h"
|
||||
#else
|
||||
#include <linux/kernel.h>
|
||||
|
||||
enum FAST_IMAGE_CMD_TYPE {
|
||||
FAST_SEND_STOP_REC = CMDQU_SYSTEM_LIMIT,
|
||||
FAST_SEND_QUERY_ISP_PADDR,
|
||||
FAST_SEND_QUERY_ISP_VADDR,
|
||||
FAST_SEND_QUERY_ISP_SIZE,
|
||||
FAST_SEND_QUERY_ISP_CTXT,
|
||||
FAST_SEND_QUERY_IMG_PADDR,
|
||||
FAST_SEND_QUERY_IMG_VADDR,
|
||||
FAST_SEND_QUERY_IMG_SIZE,
|
||||
FAST_SEND_QUERY_IMG_CTXT,
|
||||
FAST_SEND_QUERY_ENC_PADDR,
|
||||
FAST_SEND_QUERY_ENC_VADDR,
|
||||
FAST_SEND_QUERY_ENC_SIZE,
|
||||
FAST_SEND_QUERY_ENC_CTXT,
|
||||
FAST_SEND_QUERY_FREE_ISP_ION,
|
||||
FAST_SEND_QUERY_FREE_IMG_ION,
|
||||
FAST_SEND_QUERY_FREE_ENC_ION,
|
||||
FAST_SEND_QUERY_DUMP_MSG,
|
||||
FAST_SEND_QUERY_DUMP_MSG_INFO,
|
||||
FAST_SEND_QUERY_DUMP_EN,
|
||||
FAST_SEND_QUERY_DUMP_DIS,
|
||||
FAST_SEND_QUERY_DUMP_JPG,
|
||||
FAST_SEND_QUERY_DUMP_JPG_INFO,
|
||||
FAST_SEND_QUERY_TRACE_SNAPSHOT_START,
|
||||
FAST_SEND_QUERY_TRACE_SNAPSHOT_STOP,
|
||||
FAST_SEND_QUERY_TRACE_SNAPSHOT_DUMP,
|
||||
FAST_SEND_QUERY_TRACE_STREAM_START,
|
||||
FAST_SEND_QUERY_TRACE_STREAM_STOP,
|
||||
FAST_SEND_QUERY_TRACE_STREAM_DUMP,
|
||||
FAST_SEND_LIMIT,
|
||||
};
|
||||
|
||||
#define FAST_IMAGE_DEV_NAME "cvi-fast-image"
|
||||
#define FAST_IMAGE_SEND_STOP_REC _IOW('r', FAST_SEND_STOP_REC, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_ISP_PADDR _IOW('r', FAST_SEND_QUERY_ISP_PADDR, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_ISP_VADDR _IOW('r', FAST_SEND_QUERY_ISP_VADDR, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_ISP_SIZE _IOW('r', FAST_SEND_QUERY_ISP_SIZE, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_ISP_CTXT _IOW('r', FAST_SEND_QUERY_ISP_CTXT, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_IMG_PADDR _IOW('r', FAST_SEND_QUERY_IMG_PADDR, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_IMG_VADDR _IOW('r', FAST_SEND_QUERY_IMG_VADDR, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_IMG_SIZE _IOW('r', FAST_SEND_QUERY_IMG_SIZE, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_IMG_CTXT _IOW('r', FAST_SEND_QUERY_IMG_CTXT, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_ENC_PADDR _IOW('r', FAST_SEND_QUERY_ENC_PADDR, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_ENC_VADDR _IOW('r', FAST_SEND_QUERY_ENC_VADDR, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_ENC_SIZE _IOW('r', FAST_SEND_QUERY_ENC_SIZE, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_ENC_CTXT _IOW('r', FAST_SEND_QUERY_ENC_CTXT, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_FREE_ISP_ION _IOW('r', FAST_SEND_QUERY_FREE_ISP_ION, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_FREE_IMG_ION _IOW('r', FAST_SEND_QUERY_FREE_IMG_ION, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_FREE_ENC_ION _IOW('r', FAST_SEND_QUERY_FREE_ENC_ION, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_DUMP_MSG _IOW('r', FAST_SEND_QUERY_DUMP_MSG, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_DUMP_MSG_INFO _IOW('r', FAST_SEND_QUERY_DUMP_MSG_INFO, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_DUMP_EN _IOW('r', FAST_SEND_QUERY_DUMP_EN, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_DUMP_DIS _IOW('r', FAST_SEND_QUERY_DUMP_DIS, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_DUMP_JPG _IOW('r', FAST_SEND_QUERY_DUMP_JPG, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_DUMP_JPG_INFO _IOW('r', FAST_SEND_QUERY_DUMP_JPG_INFO, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_TRACE_SNAPSHOT_START _IOW('r', FAST_SEND_QUERY_TRACE_SNAPSHOT_START, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_TRACE_SNAPSHOT_STOP _IOW('r', FAST_SEND_QUERY_TRACE_SNAPSHOT_STOP, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_TRACE_SNAPSHOT_DUMP _IOW('r', FAST_SEND_QUERY_TRACE_SNAPSHOT_DUMP, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_TRACE_STREAM_START _IOW('r', FAST_SEND_QUERY_TRACE_STREAM_START, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_TRACE_STREAM_STOP _IOW('r', FAST_SEND_QUERY_TRACE_STREAM_STOP, unsigned long)
|
||||
#define FAST_IMAGE_QUERY_TRACE_STREAM_DUMP _IOW('r', FAST_SEND_QUERY_TRACE_STREAM_DUMP, unsigned long)
|
||||
|
||||
#endif // end of __linux__
|
||||
|
||||
#define C906_MAGIC_HEADER 0xA55AC906 // master cpu is c906
|
||||
#define CA53_MAGIC_HEADER 0xA55ACA53 // master cpu is ca53
|
||||
|
||||
#ifdef __riscv
|
||||
#define RTOS_MAGIC_HEADER C906_MAGIC_HEADER
|
||||
#else
|
||||
#define RTOS_MAGIC_HEADER CA53_MAGIC_HEADER
|
||||
#endif
|
||||
|
||||
enum E_IMAGE_TYPE {
|
||||
E_FAST_NONE = 0,
|
||||
E_FAST_JEPG = 1,
|
||||
E_FAST_H264,
|
||||
E_FAST_H265,
|
||||
};
|
||||
|
||||
enum _MUC_STATUS_E {
|
||||
MCU_STATUS_NONOS_INIT = 1,
|
||||
MCU_STATUS_NONOS_RUNNING,
|
||||
MCU_STATUS_NONOS_DONE,
|
||||
MCU_STATUS_RTOS_T1_INIT, // before linux running
|
||||
MCU_STATUS_RTOS_T1_RUNNING,
|
||||
MCU_STATUS_RTOS_T2_INIT, // after linux running
|
||||
MCU_STATUS_RTOS_T2_RUNNING,
|
||||
MCU_STATUS_LINUX_INIT,
|
||||
MCU_STATUS_LINUX_RUNNING,
|
||||
};
|
||||
|
||||
enum DUMP_PRINT_SIZE_E {
|
||||
DUMP_PRINT_SZ_IDX_0K = 0,
|
||||
DUMP_PRINT_SZ_IDX_4K = 12, // 4096 = 1<<12
|
||||
DUMP_PRINT_SZ_IDX_8K,
|
||||
DUMP_PRINT_SZ_IDX_16K,
|
||||
DUMP_PRINT_SZ_IDX_32K,
|
||||
DUMP_PRINT_SZ_IDX_64K,
|
||||
DUMP_PRINT_SZ_IDX_128K,
|
||||
DUMP_PRINT_SZ_IDX_LIMIT,
|
||||
};
|
||||
|
||||
#define ATTR __attribute__
|
||||
|
||||
#ifndef __packed
|
||||
#define __packed ATTR((packed))
|
||||
#endif
|
||||
|
||||
#ifndef __aligned
|
||||
#define __aligned(x) ATTR((aligned(x)))
|
||||
#endif
|
||||
|
||||
/* this structure should be modified both fsbl & MCU & osdrv side */
|
||||
struct transfer_config_t {
|
||||
uint32_t conf_magic;
|
||||
uint32_t conf_size; //conf_size exclude mcu_status & linux_status
|
||||
uint32_t isp_buffer_addr;
|
||||
uint32_t isp_buffer_size;
|
||||
uint32_t encode_img_addr;
|
||||
uint32_t encode_img_size;
|
||||
uint32_t encode_buf_addr;
|
||||
uint32_t encode_buf_size;
|
||||
uint8_t dump_print_enable;
|
||||
uint8_t dump_print_size_idx;
|
||||
uint16_t image_type;
|
||||
uint16_t checksum; // checksum exclude mcu_status & linux_status
|
||||
uint8_t mcu_status;
|
||||
uint8_t linux_status;
|
||||
} __packed __aligned(0x40);
|
||||
|
||||
struct trace_snapshot_t {
|
||||
uint32_t ptr;
|
||||
uint16_t size;
|
||||
uint16_t type;
|
||||
} __packed;
|
||||
|
||||
#endif // end of __FAST_IMAGE_HEADER__
|
||||
148
middleware/v2/include/ini.h
Normal file
148
middleware/v2/include/ini.h
Normal file
@@ -0,0 +1,148 @@
|
||||
/* inih -- simple .INI file parser
|
||||
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
Copyright (C) 2009-2020, Ben Hoyt
|
||||
|
||||
inih is released under the New BSD license (see LICENSE.txt). Go to the project
|
||||
home page for more info:
|
||||
|
||||
https://github.com/benhoyt/inih
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __INI_H__
|
||||
#define __INI_H__
|
||||
|
||||
/* Make this header file easier to include in C++ code */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Nonzero if ini_handler callback should accept lineno parameter. */
|
||||
#ifndef INI_HANDLER_LINENO
|
||||
#define INI_HANDLER_LINENO 0
|
||||
#endif
|
||||
|
||||
/* Typedef for prototype of handler function. */
|
||||
#if INI_HANDLER_LINENO
|
||||
typedef int (*ini_handler)(void* user, const char* section,
|
||||
const char* name, const char* value,
|
||||
int lineno);
|
||||
#else
|
||||
typedef int (*ini_handler)(void* user, const char* section,
|
||||
const char* name, const char* value);
|
||||
#endif
|
||||
|
||||
/* Typedef for prototype of fgets-style reader function. */
|
||||
typedef char* (*ini_reader)(char* str, int num, void* stream);
|
||||
|
||||
/* Parse given INI-style file. May have [section]s, name=value pairs
|
||||
(whitespace stripped), and comments starting with ';' (semicolon). Section
|
||||
is "" if name=value pair parsed before any section heading. name:value
|
||||
pairs are also supported as a concession to Python's configparser.
|
||||
|
||||
For each name=value pair parsed, call handler function with given user
|
||||
pointer as well as section, name, and value (data only valid for duration
|
||||
of handler call). Handler should return nonzero on success, zero on error.
|
||||
|
||||
Returns 0 on success, line number of first error on parse error (doesn't
|
||||
stop on first error), -1 on file open error, or -2 on memory allocation
|
||||
error (only when INI_USE_STACK is zero).
|
||||
*/
|
||||
int ini_parse(const char* filename, ini_handler handler, void* user);
|
||||
|
||||
/* Same as ini_parse(), but takes a FILE* instead of filename. This doesn't
|
||||
close the file when it's finished -- the caller must do that. */
|
||||
int ini_parse_file(FILE* file, ini_handler handler, void* user);
|
||||
|
||||
/* Same as ini_parse(), but takes an ini_reader function pointer instead of
|
||||
filename. Used for implementing custom or string-based I/O (see also
|
||||
ini_parse_string). */
|
||||
int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler,
|
||||
void* user);
|
||||
|
||||
/* Same as ini_parse(), but takes a zero-terminated string with the INI data
|
||||
instead of a file. Useful for parsing INI data from a network socket or
|
||||
already in memory. */
|
||||
int ini_parse_string(const char* string, ini_handler handler, void* user);
|
||||
|
||||
/* Nonzero to allow multi-line value parsing, in the style of Python's
|
||||
configparser. If allowed, ini_parse() will call the handler with the same
|
||||
name for each subsequent line parsed. */
|
||||
#ifndef INI_ALLOW_MULTILINE
|
||||
#define INI_ALLOW_MULTILINE 1
|
||||
#endif
|
||||
|
||||
/* Nonzero to allow a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of
|
||||
the file. See https://github.com/benhoyt/inih/issues/21 */
|
||||
#ifndef INI_ALLOW_BOM
|
||||
#define INI_ALLOW_BOM 1
|
||||
#endif
|
||||
|
||||
/* Chars that begin a start-of-line comment. Per Python configparser, allow
|
||||
both ; and # comments at the start of a line by default. */
|
||||
#ifndef INI_START_COMMENT_PREFIXES
|
||||
#define INI_START_COMMENT_PREFIXES ";#"
|
||||
#endif
|
||||
|
||||
/* Nonzero to allow inline comments (with valid inline comment characters
|
||||
specified by INI_INLINE_COMMENT_PREFIXES). Set to 0 to turn off and match
|
||||
Python 3.2+ configparser behaviour. */
|
||||
#ifndef INI_ALLOW_INLINE_COMMENTS
|
||||
#define INI_ALLOW_INLINE_COMMENTS 1
|
||||
#endif
|
||||
#ifndef INI_INLINE_COMMENT_PREFIXES
|
||||
#define INI_INLINE_COMMENT_PREFIXES ";"
|
||||
#endif
|
||||
|
||||
/* Nonzero to use stack for line buffer, zero to use heap (malloc/free). */
|
||||
#ifndef INI_USE_STACK
|
||||
#define INI_USE_STACK 1
|
||||
#endif
|
||||
|
||||
/* Maximum line length for any line in INI file (stack or heap). Note that
|
||||
this must be 3 more than the longest line (due to '\r', '\n', and '\0'). */
|
||||
#ifndef INI_MAX_LINE
|
||||
#define INI_MAX_LINE 200
|
||||
#endif
|
||||
|
||||
/* Nonzero to allow heap line buffer to grow via realloc(), zero for a
|
||||
fixed-size buffer of INI_MAX_LINE bytes. Only applies if INI_USE_STACK is
|
||||
zero. */
|
||||
#ifndef INI_ALLOW_REALLOC
|
||||
#define INI_ALLOW_REALLOC 0
|
||||
#endif
|
||||
|
||||
/* Initial size in bytes for heap line buffer. Only applies if INI_USE_STACK
|
||||
is zero. */
|
||||
#ifndef INI_INITIAL_ALLOC
|
||||
#define INI_INITIAL_ALLOC 200
|
||||
#endif
|
||||
|
||||
/* Stop parsing on first error (default is to keep parsing). */
|
||||
#ifndef INI_STOP_ON_FIRST_ERROR
|
||||
#define INI_STOP_ON_FIRST_ERROR 0
|
||||
#endif
|
||||
|
||||
/* Nonzero to call the handler at the start of each new section (with
|
||||
name and value NULL). Default is to only call the handler on
|
||||
each name=value pair. */
|
||||
#ifndef INI_CALL_HANDLER_ON_NEW_SECTION
|
||||
#define INI_CALL_HANDLER_ON_NEW_SECTION 0
|
||||
#endif
|
||||
|
||||
/* Nonzero to allow a name without a value (no '=' or ':' on the line) and
|
||||
call the handler with value NULL in this case. Default is to treat
|
||||
no-value lines as an error. */
|
||||
#ifndef INI_ALLOW_NO_VALUE
|
||||
#define INI_ALLOW_NO_VALUE 0
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INI_H__ */
|
||||
1
middleware/v2/include/isp/cv180x
Symbolic link
1
middleware/v2/include/isp/cv180x
Symbolic link
@@ -0,0 +1 @@
|
||||
cv181x
|
||||
1
middleware/v2/include/isp/cv181x
Symbolic link
1
middleware/v2/include/isp/cv181x
Symbolic link
@@ -0,0 +1 @@
|
||||
sg200x
|
||||
100
middleware/v2/include/isp/sg200x/cvi_ae.h
Normal file
100
middleware/v2/include/isp/sg200x/cvi_ae.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2021. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_ae.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __CVI_AE_H__
|
||||
#define __CVI_AE_H__
|
||||
|
||||
#include "cvi_comm_isp.h"
|
||||
#include "cvi_comm_3a.h"
|
||||
#include "cvi_ae_comm.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
typedef enum _AE_EXPOSURE_PROGRAM {
|
||||
MANUAL_PROGRAM = 1,
|
||||
NORMAL_PROGRAM,
|
||||
APERATURE_PRIORITY_PROGRAM,
|
||||
SHUTTER_PRIORITY_PROGRAM,
|
||||
SLOW_SHUTTER_PROGRAM,
|
||||
FAST_SHUTTER_PROGRAM,
|
||||
PORTRAIT_PROGRAM,
|
||||
LANDSCAPE_PROGRAM,
|
||||
} AE_EXPOSURE_PROGRAM;
|
||||
|
||||
typedef enum _AE_EXPOSURE_MODE {
|
||||
AUTO_MODE,
|
||||
MANUAL_MODE,
|
||||
} AE_EXPOSURE_MODE;
|
||||
|
||||
/* The interface of ae lib register to isp. */
|
||||
CVI_S32 CVI_AE_Register(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib);
|
||||
CVI_S32 CVI_AE_UnRegister(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib);
|
||||
|
||||
/* The callback function of sensor register to ae lib. */
|
||||
CVI_S32 CVI_AE_SensorRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib, ISP_SNS_ATTR_INFO_S *pstSnsAttrInfo,
|
||||
AE_SENSOR_REGISTER_S *pstRegister);
|
||||
CVI_S32 CVI_AE_SensorUnRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib, SENSOR_ID SensorId);
|
||||
|
||||
CVI_S32 CVI_ISP_SetExposureAttr(VI_PIPE ViPipe, const ISP_EXPOSURE_ATTR_S *pstExpAttr);
|
||||
CVI_S32 CVI_ISP_GetExposureAttr(VI_PIPE ViPipe, ISP_EXPOSURE_ATTR_S *pstExpAttr);
|
||||
|
||||
CVI_S32 CVI_ISP_QueryExposureInfo(VI_PIPE ViPipe, ISP_EXP_INFO_S *pstExpInfo);
|
||||
|
||||
CVI_S32 CVI_ISP_SetWDRExposureAttr(VI_PIPE ViPipe, const ISP_WDR_EXPOSURE_ATTR_S *pstWDRExpAttr);
|
||||
CVI_S32 CVI_ISP_GetWDRExposureAttr(VI_PIPE ViPipe, ISP_WDR_EXPOSURE_ATTR_S *pstWDRExpAttr);
|
||||
|
||||
CVI_S32 CVI_ISP_SetAERouteAttr(VI_PIPE ViPipe, const ISP_AE_ROUTE_S *pstAERouteAttr);
|
||||
CVI_S32 CVI_ISP_GetAERouteAttr(VI_PIPE ViPipe, ISP_AE_ROUTE_S *pstAERouteAttr);
|
||||
|
||||
CVI_S32 CVI_ISP_SetAERouteAttrEx(VI_PIPE ViPipe, const ISP_AE_ROUTE_EX_S *pstAERouteAttrEx);
|
||||
CVI_S32 CVI_ISP_GetAERouteAttrEx(VI_PIPE ViPipe, ISP_AE_ROUTE_EX_S *pstAERouteAttrEx);
|
||||
|
||||
CVI_S32 CVI_ISP_SetSmartExposureAttr(VI_PIPE ViPipe, const ISP_SMART_EXPOSURE_ATTR_S *pstSmartExpAttr);
|
||||
CVI_S32 CVI_ISP_GetSmartExposureAttr(VI_PIPE ViPipe, ISP_SMART_EXPOSURE_ATTR_S *pstSmartExpAttr);
|
||||
|
||||
CVI_S32 CVI_ISP_SetAEStatisticsConfig(VI_PIPE ViPipe, const ISP_AE_STATISTICS_CFG_S *pstAeStatCfg);
|
||||
CVI_S32 CVI_ISP_GetAEStatisticsConfig(VI_PIPE ViPipe, ISP_AE_STATISTICS_CFG_S *pstAeStatCfg);
|
||||
|
||||
CVI_S32 CVI_ISP_SetAERouteSFAttr(VI_PIPE ViPipe, const ISP_AE_ROUTE_S *pstAERouteSFAttr);
|
||||
CVI_S32 CVI_ISP_GetAERouteSFAttr(VI_PIPE ViPipe, ISP_AE_ROUTE_S *pstAERouteSFAttr);
|
||||
|
||||
CVI_S32 CVI_ISP_SetAERouteSFAttrEx(VI_PIPE ViPipe, const ISP_AE_ROUTE_EX_S *pstAERouteSFAttrEx);
|
||||
CVI_S32 CVI_ISP_GetAERouteSFAttrEx(VI_PIPE ViPipe, ISP_AE_ROUTE_EX_S *pstAERouteSFAttrEx);
|
||||
|
||||
CVI_S32 CVI_ISP_SetAntiFlicker(VI_PIPE ViPipe, CVI_BOOL enable, CVI_U8 frequency);
|
||||
CVI_S32 CVI_ISP_GetAntiFlicker(VI_PIPE ViPipe, CVI_BOOL *pEnable, CVI_U8 *pFrequency);
|
||||
|
||||
CVI_S32 CVI_ISP_SetWDRLEOnly(VI_PIPE ViPipe, CVI_BOOL wdrLEOnly);
|
||||
CVI_S32 CVI_ISP_GetFrameID(VI_PIPE ViPipe, CVI_U32 *frameID);
|
||||
CVI_S32 CVI_ISP_QueryFps(VI_PIPE ViPipe, CVI_FLOAT *pFps);
|
||||
|
||||
|
||||
CVI_S32 CVI_ISP_GetCurrentLvX100(VI_PIPE ViPipe, CVI_S16 *ps16Lv);
|
||||
|
||||
CVI_S32 CVI_ISP_SetFastBootExposure(VI_PIPE ViPipe, CVI_U32 expLine, CVI_U32 again, CVI_U32 dgain, CVI_U32 ispdgain);
|
||||
|
||||
CVI_S32 CVI_ISP_SetIrisAttr(VI_PIPE ViPipe, const ISP_IRIS_ATTR_S *pstIrisAttr);
|
||||
CVI_S32 CVI_ISP_GetIrisAttr(VI_PIPE ViPipe, ISP_IRIS_ATTR_S *pstIrisAttr);
|
||||
CVI_S32 CVI_ISP_SetDcirisAttr(VI_PIPE ViPipe, const ISP_DCIRIS_ATTR_S *pstDcirisAttr);
|
||||
CVI_S32 CVI_ISP_GetDcirisAttr(VI_PIPE ViPipe, ISP_DCIRIS_ATTR_S *pstDcirisAttr);
|
||||
|
||||
CVI_S32 CVI_ISP_SetAELogPath(const char *szPath);
|
||||
CVI_S32 CVI_ISP_GetAELogPath(char *szPath, CVI_U32 pathSize);
|
||||
CVI_S32 CVI_ISP_SetAELogName(const char *szName);
|
||||
CVI_S32 CVI_ISP_GetAELogName(char *szName, CVI_U32 nameSize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* __CVI_AE_H__ */
|
||||
152
middleware/v2/include/isp/sg200x/cvi_ae_comm.h
Normal file
152
middleware/v2/include/isp/sg200x/cvi_ae_comm.h
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2021. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_ae_comm.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __CVI_AE_COMM_H__
|
||||
#define __CVI_AE_COMM_H__
|
||||
|
||||
#include "cvi_comm_inc.h"
|
||||
#include "cvi_comm_3a.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#define CVI_AE_LIB_NAME "cvi_ae_lib"
|
||||
|
||||
typedef enum _AE_ACCURACY_E {
|
||||
AE_ACCURACY_DB = 0,
|
||||
AE_ACCURACY_LINEAR,
|
||||
AE_ACCURACY_TABLE,
|
||||
|
||||
AE_ACCURACY_BUTT,
|
||||
} AE_ACCURACY_E;
|
||||
|
||||
typedef enum _AE_BLC_TYPE_E {
|
||||
AE_BLC_TYPE_LINEAR = 0,
|
||||
AE_BLC_TYPE_LADDER,
|
||||
|
||||
AE_BLC_TYPE_BUTT,
|
||||
} AE_BLC_TYPE_E;
|
||||
|
||||
typedef enum _ISP_SNS_GAIN_MODE_E {
|
||||
SNS_GAIN_MODE_SHARE = 0, /* gain setting for all wdr frames*/
|
||||
SNS_GAIN_MODE_WDR_2F, /* separate gain for 2-frame wdr mode*/
|
||||
SNS_GAIN_MODE_WDR_3F, /* separate gain for 3-frame wdr mode*/
|
||||
SNS_GAIN_MODE_ONLY_LEF /* gain setting only apply to lef and sef is fixed to 1x */
|
||||
} ISP_SNS_GAIN_MODE_E;
|
||||
|
||||
|
||||
typedef struct _AE_ACCURACY_S {
|
||||
AE_ACCURACY_E enAccuType;
|
||||
float f32Accuracy;
|
||||
float f32Offset;
|
||||
} AE_ACCURACY_S;
|
||||
|
||||
typedef struct _AE_SENSOR_DEFAULT_S {
|
||||
CVI_U8 au8HistThresh[HIST_THRESH_NUM];
|
||||
CVI_U8 u8AeCompensation;
|
||||
|
||||
CVI_U32 u32LinesPer500ms;
|
||||
CVI_U32 u32FlickerFreq;
|
||||
CVI_U32 u32HmaxTimes; /* unit is ns */
|
||||
CVI_U32 u32InitExposure;
|
||||
CVI_U32 u32InitAESpeed;
|
||||
CVI_U32 u32InitAETolerance;
|
||||
|
||||
CVI_U32 u32FullLinesStd;
|
||||
CVI_U32 u32FullLinesMax;
|
||||
CVI_U32 u32FullLines;
|
||||
CVI_U32 u32MaxIntTime; /* RW;unit is line */
|
||||
CVI_U32 u32MinIntTime;
|
||||
CVI_U32 u32MaxIntTimeTarget;
|
||||
CVI_U32 u32MinIntTimeTarget;
|
||||
AE_ACCURACY_S stIntTimeAccu;
|
||||
|
||||
CVI_U32 u32MaxAgain;
|
||||
CVI_U32 u32MinAgain;
|
||||
CVI_U32 u32MaxAgainTarget;
|
||||
CVI_U32 u32MinAgainTarget;
|
||||
AE_ACCURACY_S stAgainAccu;
|
||||
|
||||
CVI_U32 u32MaxDgain;
|
||||
CVI_U32 u32MinDgain;
|
||||
CVI_U32 u32MaxDgainTarget;
|
||||
CVI_U32 u32MinDgainTarget;
|
||||
AE_ACCURACY_S stDgainAccu;
|
||||
|
||||
CVI_U32 u32MaxISPDgainTarget;
|
||||
CVI_U32 u32MinISPDgainTarget;
|
||||
CVI_U32 u32ISPDgainShift;
|
||||
|
||||
CVI_U32 u32MaxIntTimeStep;
|
||||
CVI_U32 u32LFMaxShortTime;
|
||||
CVI_U32 u32LFMinExposure;
|
||||
#if 0
|
||||
ISP_AE_ROUTE_S stAERouteAttr;
|
||||
CVI_BOOL bAERouteExValid;
|
||||
ISP_AE_ROUTE_EX_S stAERouteAttrEx;
|
||||
|
||||
CVI_U16 u16ManRatioEnable;
|
||||
CVI_U32 au32Ratio[EXP_RATIO_NUM];
|
||||
|
||||
ISP_IRIS_TYPE_E enIrisType;
|
||||
ISP_PIRIS_ATTR_S stPirisAttr;
|
||||
ISP_IRIS_F_NO_E enMaxIrisFNO;
|
||||
ISP_IRIS_F_NO_E enMinIrisFNO;
|
||||
#endif
|
||||
ISP_AE_STRATEGY_E enAeExpMode;
|
||||
|
||||
CVI_U16 u16ISOCalCoef;
|
||||
CVI_U8 u8AERunInterval;
|
||||
CVI_FLOAT f32Fps;
|
||||
CVI_FLOAT f32MinFps;
|
||||
CVI_U32 denom;
|
||||
CVI_U32 u32AEResponseFrame;
|
||||
CVI_U32 u32SnsStableFrame; /* delay for stable statistic after sensor init. (unit: frame) */
|
||||
AE_BLC_TYPE_E enBlcType;
|
||||
ISP_SNS_GAIN_MODE_E enWDRGainMode;
|
||||
} AE_SENSOR_DEFAULT_S;
|
||||
|
||||
typedef struct _AE_FSWDR_ATTR_S {
|
||||
ISP_FSWDR_MODE_E enFSWDRMode;
|
||||
} AE_FSWDR_ATTR_S;
|
||||
|
||||
typedef struct _AE_SENSOR_EXP_FUNC_S {
|
||||
CVI_S32 (*pfn_cmos_get_ae_default)(VI_PIPE ViPipe, AE_SENSOR_DEFAULT_S *pstAeSnsDft);
|
||||
|
||||
/* the function of sensor set fps */
|
||||
CVI_S32 (*pfn_cmos_fps_set)(VI_PIPE ViPipe, CVI_FLOAT f32Fps, AE_SENSOR_DEFAULT_S *pstAeSnsDft);
|
||||
CVI_S32 (*pfn_cmos_slow_framerate_set)(VI_PIPE ViPipe, CVI_U32 u32FullLines, AE_SENSOR_DEFAULT_S *pstAeSnsDft);
|
||||
|
||||
/* while isp notify ae to update sensor regs, ae call these funcs. */
|
||||
CVI_S32 (*pfn_cmos_inttime_update)(VI_PIPE ViPipe, CVI_U32 *u32IntTime);
|
||||
CVI_S32 (*pfn_cmos_gains_update)(VI_PIPE ViPipe, CVI_U32 *u32Again, CVI_U32 *u32Dgain);
|
||||
|
||||
CVI_S32 (*pfn_cmos_again_calc_table)(VI_PIPE ViPipe, CVI_U32 *pu32AgainLin, CVI_U32 *pu32AgainDb);
|
||||
CVI_S32 (*pfn_cmos_dgain_calc_table)(VI_PIPE ViPipe, CVI_U32 *pu32DgainLin, CVI_U32 *pu32DgainDb);
|
||||
|
||||
CVI_S32 (*pfn_cmos_get_inttime_max)
|
||||
(VI_PIPE ViPipe, CVI_U16 u16ManRatioEnable, CVI_U32 *au32Ratio, CVI_U32 *au32IntTimeMax,
|
||||
CVI_U32 *au32IntTimeMin, CVI_U32 *pu32LFMaxIntTime);
|
||||
|
||||
/* long frame mode set */
|
||||
CVI_S32 (*pfn_cmos_ae_fswdr_attr_set)(VI_PIPE ViPipe, AE_FSWDR_ATTR_S *pstAeFSWDRAttr);
|
||||
} AE_SENSOR_EXP_FUNC_S;
|
||||
|
||||
typedef struct _AE_SENSOR_REGISTER_S {
|
||||
AE_SENSOR_EXP_FUNC_S stAeExp;
|
||||
} AE_SENSOR_REGISTER_S;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* __CVI_AE_COMM_H__ */
|
||||
31
middleware/v2/include/isp/sg200x/cvi_af.h
Normal file
31
middleware/v2/include/isp/sg200x/cvi_af.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2021. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_af.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __CVI_AF_H__
|
||||
#define __CVI_AF_H__
|
||||
|
||||
#include "cvi_comm_isp.h"
|
||||
#include "cvi_comm_3a.h"
|
||||
#include "cvi_af_comm.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
CVI_S32 CVI_AF_Register(VI_PIPE ViPipe, ALG_LIB_S *pstAfLib);
|
||||
CVI_S32 CVI_AF_UnRegister(VI_PIPE ViPipe, ALG_LIB_S *pstAfLib);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* __CVI_AF_H__ */
|
||||
29
middleware/v2/include/isp/sg200x/cvi_af_comm.h
Normal file
29
middleware/v2/include/isp/sg200x/cvi_af_comm.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2021. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_af_comm.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __CVI_AF_COMM_H__
|
||||
#define __CVI_AF_COMM_H__
|
||||
|
||||
#include "cvi_comm_inc.h"
|
||||
#include "cvi_comm_3a.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#define CVI_AF_LIB_NAME "cvi_af_lib"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* __CVI_AF_COMM_H__ */
|
||||
54
middleware/v2/include/isp/sg200x/cvi_awb.h
Normal file
54
middleware/v2/include/isp/sg200x/cvi_awb.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2021. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_awb.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __CVI_AWB_H__
|
||||
#define __CVI_AWB_H__
|
||||
|
||||
#include "cvi_comm_isp.h"
|
||||
#include "cvi_comm_3a.h"
|
||||
#include "cvi_awb_comm.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#define AWB_LOG_BUFF_SIZE (48*1024)
|
||||
#define AWB_SNAP_LOG_BUFF_SIZE (AWB_LOG_BUFF_SIZE)
|
||||
|
||||
/* The interface of awb lib register to isp. */
|
||||
CVI_S32 CVI_AWB_Register(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib);
|
||||
CVI_S32 CVI_AWB_UnRegister(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib);
|
||||
|
||||
/* The callback function of sensor register to awb lib. */
|
||||
CVI_S32 CVI_AWB_SensorRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib, ISP_SNS_ATTR_INFO_S *pstSnsAttrInfo,
|
||||
AWB_SENSOR_REGISTER_S *pstRegister);
|
||||
CVI_S32 CVI_AWB_SensorUnRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib, SENSOR_ID SensorId);
|
||||
|
||||
CVI_S32 CVI_AWB_QueryInfo(VI_PIPE ViPipe, ISP_WB_Q_INFO_S *pstWB_Q_Info);
|
||||
|
||||
CVI_S32 CVI_ISP_SetWBAttr(VI_PIPE ViPipe, const ISP_WB_ATTR_S *pstWBAttr);
|
||||
CVI_S32 CVI_ISP_GetWBAttr(VI_PIPE ViPipe, ISP_WB_ATTR_S *pstWBAttr);
|
||||
CVI_S32 CVI_ISP_SetAWBAttrEx(VI_PIPE ViPipe, const ISP_AWB_ATTR_EX_S *pstAWBAttrEx);
|
||||
CVI_S32 CVI_ISP_GetAWBAttrEx(VI_PIPE ViPipe, ISP_AWB_ATTR_EX_S *pstAWBAttrEx);
|
||||
|
||||
CVI_S32 CVI_ISP_QueryWBInfo(VI_PIPE ViPipe, ISP_WB_INFO_S *pstWBInfo);
|
||||
|
||||
CVI_S32 CVI_ISP_GetGrayWorldAwbInfo(VI_PIPE ViPipe, CVI_U16 *pRgain, CVI_U16 *pBgain);
|
||||
|
||||
CVI_S32 CVI_ISP_SetAWBLogPath(const char *szPath);
|
||||
CVI_S32 CVI_ISP_SetAWBLogName(const char *szName);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* __CVI_AWB_H__ */
|
||||
82
middleware/v2/include/isp/sg200x/cvi_awb_comm.h
Normal file
82
middleware/v2/include/isp/sg200x/cvi_awb_comm.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2021. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_awb_comm.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __CVI_AWB_COMM_H__
|
||||
#define __CVI_AWB_COMM_H__
|
||||
|
||||
#include "cvi_comm_inc.h"
|
||||
#include "cvi_comm_3a.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#define CVI_AWB_LIB_NAME "cvi_awb_lib"
|
||||
|
||||
typedef struct cviAWB_SENSOR_DEFAULT_S {
|
||||
CVI_U16 u16WbRefTemp;
|
||||
CVI_U16 au16GainOffset[ISP_BAYER_CHN_NUM];
|
||||
// CVI_S32 as32WbPara[AWB_CURVE_PARA_NUM];
|
||||
|
||||
CVI_U16 u16GoldenRgain;
|
||||
CVI_U16 u16GoldenBgain;
|
||||
CVI_U16 u16SampleRgain;
|
||||
CVI_U16 u16SampleBgain;
|
||||
// AWB_AGC_TABLE_S stAgcTbl;
|
||||
// AWB_CCM_S stCcm;
|
||||
CVI_U16 u16InitRgain;
|
||||
CVI_U16 u16InitGgain;
|
||||
CVI_U16 u16InitBgain;
|
||||
CVI_U8 u8AWBRunInterval;
|
||||
} AWB_SENSOR_DEFAULT_S;
|
||||
|
||||
typedef struct cviAWB_SENSOR_EXP_FUNC_S {
|
||||
CVI_S32 (*pfn_cmos_get_awb_default)(VI_PIPE ViPipe, AWB_SENSOR_DEFAULT_S *pstAwbSnsDft);
|
||||
// CVI_S32(*pfn_cmos_get_awb_spec_default)(VI_PIPE ViPipe, AWB_SPEC_SENSOR_DEFAULT_S *pstAwbSpecSnsDft);
|
||||
} AWB_SENSOR_EXP_FUNC_S;
|
||||
|
||||
typedef struct cviAWB_SENSOR_REGISTER_S {
|
||||
AWB_SENSOR_EXP_FUNC_S stAwbExp;
|
||||
} AWB_SENSOR_REGISTER_S;
|
||||
|
||||
typedef struct _ISP_WB_CURVE_S {
|
||||
CVI_U16 u16CurveSize;
|
||||
CVI_U16 *u16RGain;
|
||||
CVI_U16 *u16BGain;
|
||||
CVI_U16 *u16BGainTop;
|
||||
CVI_U16 *u16BGainBottom;
|
||||
} ISP_WB_CURVE_S;
|
||||
|
||||
typedef struct _ISP_WB_Q_INFO_S {
|
||||
CVI_U16 u16Rgain;
|
||||
CVI_U16 u16Grgain;
|
||||
CVI_U16 u16Gbgain;
|
||||
CVI_U16 u16Bgain;
|
||||
CVI_U16 u16Saturation;
|
||||
CVI_U16 u16ColorTemp;
|
||||
CVI_U16 u16LS0CT;
|
||||
CVI_U16 u16LS1CT;
|
||||
CVI_U16 u16LS0Area;
|
||||
CVI_U16 u16LS1Area;
|
||||
CVI_U8 u8MultiDegree;
|
||||
CVI_U16 u16ActiveShift;
|
||||
CVI_U32 u32FirstStableTime;
|
||||
ISP_AWB_INDOOR_OUTDOOR_STATUS_E enInOutStatus;
|
||||
CVI_S16 s16Bv;
|
||||
CVI_U16 u16GrayWorldRgain;
|
||||
CVI_U16 u16GrayWorldBgain;
|
||||
} ISP_WB_Q_INFO_S;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* __CVI_AWB_COMM_H__ */
|
||||
483
middleware/v2/include/isp/sg200x/cvi_comm_3a.h
Normal file
483
middleware/v2/include/isp/sg200x/cvi_comm_3a.h
Normal file
@@ -0,0 +1,483 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2021. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_common_3a.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __CVI_COMM_3A_H__
|
||||
#define __CVI_COMM_3A_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "cvi_comm_isp.h"
|
||||
#include "cvi_comm_sns.h"
|
||||
|
||||
#define ALG_LIB_NAME_SIZE_MAX (20)
|
||||
#define MAX_REGISTER_ALG_LIB_NUM 4
|
||||
|
||||
#define HIST_THRESH_NUM (4)
|
||||
|
||||
#define MAX_AE_W (32)
|
||||
#define MAX_AE_H (24)
|
||||
#define MAX_AE_SIZE (MAX_AE_W * MAX_AE_H)
|
||||
#define MAX_AE_WIN (2)
|
||||
|
||||
#define ENABLE_AF_LIB (0)
|
||||
|
||||
typedef enum _ISP_FSWDR_MODE_E {
|
||||
ISP_FSWDR_NORMAL_MODE = 0x0,
|
||||
ISP_FSWDR_LONG_FRAME_MODE = 0x1,
|
||||
ISP_FSWDR_AUTO_LONG_FRAME_MODE = 0x2,
|
||||
ISP_FSWDR_MODE_BUTT
|
||||
} ISP_FSWDR_MODE_E;
|
||||
|
||||
typedef struct _ISP_AE_RANGE_S {
|
||||
CVI_U32 u32Max; /*RW; Range:[0x0, 0x7FFFFFFF]*/
|
||||
CVI_U32 u32Min; /*RW; Range:[0x0, 0x7FFFFFFF]*/
|
||||
} ISP_AE_RANGE_S;
|
||||
|
||||
typedef enum _ISP_AE_STRATEGY_E {
|
||||
AE_EXP_HIGHLIGHT_PRIOR = 0,
|
||||
AE_EXP_LOWLIGHT_PRIOR = 1,
|
||||
AE_STRATEGY_MODE_BUTT
|
||||
} ISP_AE_STRATEGY_E;
|
||||
|
||||
typedef enum _ISP_AE_MODE_E {
|
||||
AE_MODE_SLOW_SHUTTER = 0,
|
||||
AE_MODE_FIX_FRAME_RATE = 1,
|
||||
AE_MODE_BUTT
|
||||
} ISP_AE_MODE_E;
|
||||
|
||||
typedef enum _ISP_ANTIFLICKER_MODE_E {
|
||||
ISP_ANTIFLICKER_NORMAL_MODE = 0,
|
||||
ISP_ANTIFLICKER_AUTO_MODE = 1,
|
||||
ISP_ANTIFLICKER_MODE_BUTT
|
||||
} ISP_ANTIFLICKER_MODE_E;
|
||||
|
||||
|
||||
typedef struct _ISP_ANTIFLICKER_S {
|
||||
CVI_BOOL bEnable;
|
||||
ISP_AE_ANTIFLICKER_FREQUENCE_E enFrequency;
|
||||
ISP_ANTIFLICKER_MODE_E enMode;
|
||||
} ISP_ANTIFLICKER_S;
|
||||
|
||||
typedef struct _ISP_SUBFLICKER_S {
|
||||
CVI_BOOL bEnable;
|
||||
CVI_U8 u8LumaDiff; /*RW; Range:[0x0, 0x64]*/
|
||||
} ISP_SUBFLICKER_S;
|
||||
|
||||
typedef struct _ISP_AE_DELAY_S {
|
||||
CVI_U16 u16BlackDelayFrame;
|
||||
CVI_U16 u16WhiteDelayFrame;
|
||||
} ISP_AE_DELAY_S;
|
||||
|
||||
typedef struct _ISP_ME_ATTR_S {
|
||||
ISP_OP_TYPE_E enExpTimeOpType;
|
||||
ISP_OP_TYPE_E enAGainOpType;
|
||||
ISP_OP_TYPE_E enDGainOpType;
|
||||
ISP_OP_TYPE_E enISPDGainOpType;
|
||||
CVI_U32 u32ExpTime; /*RW; Range:[0x0, 0x7FFFFFFF]*/
|
||||
CVI_U32 u32AGain; /*RW; Range:[0x400, 0x7FFFFFFF]*/
|
||||
CVI_U32 u32DGain; /*RW; Range:[0x400, 0x7FFFFFFF]*/
|
||||
CVI_U32 u32ISPDGain; /*RW; Range:[0x400, 0x40000]*/
|
||||
ISP_OP_TYPE_E enISONumOpType;
|
||||
ISP_AE_GAIN_TYPE_E enGainType;
|
||||
CVI_U32 u32ISONum; /*RW; Range:[0x64, 0x7FFFFFFF]*/
|
||||
} ISP_ME_ATTR_S;
|
||||
|
||||
#define RESERVE_SIZE 10
|
||||
typedef struct _ISP_AE_ATTR_S {
|
||||
ISP_AE_RANGE_S stExpTimeRange;
|
||||
ISP_AE_RANGE_S stAGainRange; /*RW; Range:[0x400, 0x7FFFFFFF]*/
|
||||
ISP_AE_RANGE_S stDGainRange; /*RW; Range:[0x400, 0x7FFFFFFF]*/
|
||||
ISP_AE_RANGE_S stISPDGainRange; /*RW; Range:[0x400, 0x40000]*/
|
||||
ISP_AE_RANGE_S stSysGainRange; /*RW; Range:[0x400, 0x7FFFFFFF]*/
|
||||
CVI_U32 u32GainThreshold; /*RW; Range:[0x400, 0x7FFFFFFF]*/
|
||||
CVI_U8 u8Speed; // 1 means 0.1 ev
|
||||
CVI_U16 u16BlackSpeedBias;
|
||||
CVI_U8 u8Tolerance;
|
||||
CVI_U8 u8Compensation;
|
||||
CVI_U16 u16EVBias;
|
||||
ISP_AE_STRATEGY_E enAEStrategyMode;
|
||||
CVI_U16 u16HistRatioSlope;
|
||||
CVI_U8 u8MaxHistOffset;
|
||||
ISP_AE_MODE_E enAEMode;
|
||||
ISP_ANTIFLICKER_S stAntiflicker;
|
||||
ISP_SUBFLICKER_S stSubflicker;
|
||||
ISP_AE_DELAY_S stAEDelayAttr;
|
||||
CVI_BOOL bManualExpValue;
|
||||
CVI_U32 u32ExpValue; /*RW; Range:[0x0, 0x7FFFFFFF]*/
|
||||
ISP_FSWDR_MODE_E enFSWDRMode;
|
||||
CVI_BOOL bWDRQuick;
|
||||
CVI_U16 u16ISOCalCoef;
|
||||
ISP_AE_GAIN_TYPE_E enGainType;
|
||||
ISP_AE_RANGE_S stISONumRange; /*RW; Range:[0x64, 0x7FFFFFFF]*/
|
||||
CVI_S16 s16IRCutOnLv;
|
||||
CVI_S16 s16IRCutOffLv;
|
||||
ISP_AE_IR_CUT_FORCE_STATUS enIRCutStatus;
|
||||
CVI_U8 au8AdjustTargetMin[LV_TOTAL_NUM];
|
||||
CVI_U8 au8AdjustTargetMax[LV_TOTAL_NUM];
|
||||
CVI_U16 u16LowBinThr; /*RW; Range:[0x0, 0x100]*/
|
||||
CVI_U16 u16HighBinThr; /*RW; Range:[0x0, 0x100]*/
|
||||
CVI_BOOL bEnableFaceAE;
|
||||
CVI_U8 u8FaceTargetLuma; /*RW; Range:[0x1, 0xFF]*/
|
||||
CVI_U8 u8FaceWeight; /*RW; Range:[0x0, 0x64]*/
|
||||
CVI_U8 u8GridBvWeight; /*RW; Range:[0x0, 0x64]*/
|
||||
CVI_U32 au32Reserve[RESERVE_SIZE]; /*RW; Range:[0x0, 0x7FFFFFFF]*/
|
||||
CVI_U8 u8HighLightLumaThr;
|
||||
CVI_U8 u8HighLightBufLumaThr;
|
||||
CVI_U8 u8LowLightLumaThr;
|
||||
CVI_U8 u8LowLightBufLumaThr;
|
||||
CVI_BOOL bHistogramAssist;
|
||||
} ISP_AE_ATTR_S;
|
||||
|
||||
|
||||
typedef struct _ISP_EXPOSURE_ATTR_S {
|
||||
CVI_BOOL bByPass;
|
||||
ISP_OP_TYPE_E enOpType;
|
||||
CVI_U8 u8AERunInterval; /*RW; Range:[0x1, 0xFF]*/
|
||||
CVI_BOOL bHistStatAdjust;
|
||||
CVI_BOOL bAERouteExValid;
|
||||
ISP_ME_ATTR_S stManual;
|
||||
ISP_AE_ATTR_S stAuto;
|
||||
CVI_U8 u8DebugMode;
|
||||
ISP_AE_METER_MODE_E enMeterMode;
|
||||
CVI_BOOL bAEGainSepCfg;
|
||||
} ISP_EXPOSURE_ATTR_S;
|
||||
|
||||
typedef struct ISP_STITCH_ATTR_T {
|
||||
CVI_BOOL enable;
|
||||
} ISP_STITCH_ATTR_S;
|
||||
|
||||
typedef struct _ALG_LIB_S {
|
||||
CVI_S32 s32Id;
|
||||
CVI_CHAR acLibName[ALG_LIB_NAME_SIZE_MAX];
|
||||
} ALG_LIB_S;
|
||||
|
||||
/* the init param of awb alg */
|
||||
typedef struct _ISP_AE_PARAM_S {
|
||||
SENSOR_ID SensorId;
|
||||
CVI_U8 u8WDRMode;
|
||||
CVI_U8 u8HDRMode;
|
||||
CVI_U16 u16BlackLevel;
|
||||
CVI_FLOAT f32Fps;
|
||||
ISP_BAYER_FORMAT_E enBayer;
|
||||
ISP_STITCH_ATTR_S stStitchAttr;
|
||||
CVI_S32 s32Rsv;
|
||||
ISP_3AWIN_CONFIG_S aeLEWinConfig[AE_MAX_NUM];
|
||||
ISP_3AWIN_CONFIG_S aeSEWinConfig;
|
||||
} ISP_AE_PARAM_S;
|
||||
|
||||
typedef struct _ISP_FE_AE_STAT_1_S {
|
||||
CVI_U32 u32PixelCount[ISP_CHANNEL_MAX_NUM];
|
||||
CVI_U32 u32PixelWeight[ISP_CHANNEL_MAX_NUM];
|
||||
CVI_U32 au32HistogramMemArray[ISP_CHANNEL_MAX_NUM][MAX_HIST_BINS];
|
||||
} ISP_FE_AE_STAT_1_S;
|
||||
|
||||
typedef struct _ISP_FE_AE_STAT_2_S {
|
||||
CVI_U16 u16GlobalAvgR[ISP_CHANNEL_MAX_NUM];
|
||||
CVI_U16 u16GlobalAvgGr[ISP_CHANNEL_MAX_NUM];
|
||||
CVI_U16 u16GlobalAvgGb[ISP_CHANNEL_MAX_NUM];
|
||||
CVI_U16 u16GlobalAvgB[ISP_CHANNEL_MAX_NUM];
|
||||
} ISP_FE_AE_STAT_2_S;
|
||||
|
||||
typedef struct _ISP_FE_AE_STAT_3_S {
|
||||
CVI_U16 au16ZoneAvg[ISP_CHANNEL_MAX_NUM][AE_ZONE_ROW][AE_ZONE_COLUMN][4];
|
||||
} ISP_FE_AE_STAT_3_S;
|
||||
|
||||
typedef struct _ISP_FE_AE_STITCH_STAT_3_S {
|
||||
CVI_U16 au16ZoneAvg[ISP_CHANNEL_MAX_NUM][ISP_CHANNEL_MAX_NUM][AE_ZONE_ROW][AE_ZONE_COLUMN][4];
|
||||
} ISP_FE_AE_STITCH_STAT_3_S;
|
||||
|
||||
typedef struct _ISP_AE_STAT_ATTR_S {
|
||||
CVI_BOOL bChange;
|
||||
|
||||
CVI_BOOL bHistAdjust;
|
||||
CVI_U8 u8AEBESel;
|
||||
CVI_U8 u8FourPlaneMode;
|
||||
CVI_U8 u8HistOffsetX;
|
||||
CVI_U8 u8HistOffsetY;
|
||||
CVI_U8 u8HistSkipX;
|
||||
CVI_U8 u8HistSkipY;
|
||||
|
||||
CVI_BOOL bModeUpdate;
|
||||
CVI_U8 u8HistMode;
|
||||
CVI_U8 u8AverMode;
|
||||
CVI_U8 u8MaxGainMode;
|
||||
|
||||
CVI_BOOL bWightTableUpdate;
|
||||
CVI_U8 au8WeightTable[VI_MAX_PIPE_NUM][AE_WEIGHT_ZONE_ROW][AE_WEIGHT_ZONE_COLUMN];
|
||||
} ISP_AE_STAT_ATTR_S;
|
||||
|
||||
typedef struct _ISP_AE_STAT_RESULT_S {
|
||||
CVI_U32 u32IntTime[VI_MAX_PIPE_NUM];
|
||||
CVI_U32 u32IspDgain;
|
||||
CVI_U32 u32Again;
|
||||
CVI_U32 u32Dgain;
|
||||
CVI_U32 u32Iso;
|
||||
CVI_U8 u8AERunInterval;
|
||||
|
||||
CVI_BOOL bPirisValid;
|
||||
CVI_S32 s32PirisPos;
|
||||
CVI_U32 u32PirisGain;
|
||||
|
||||
ISP_FSWDR_MODE_E enFSWDRMode;
|
||||
CVI_U32 au32WDRGain[4];
|
||||
CVI_U32 u32HmaxTimes; /* unit is ns */
|
||||
|
||||
ISP_AE_STAT_ATTR_S stStatAttr;
|
||||
ISP_DCF_UPDATE_INFO_S stUpdateInfo;
|
||||
CVI_U32 u32ExpRatio;
|
||||
CVI_S16 s16CurrentLV;
|
||||
CVI_U32 u32AvgLuma;
|
||||
CVI_U8 u8MeterFramePeriod;
|
||||
CVI_BOOL bStable;
|
||||
CVI_FLOAT fBvStep;
|
||||
CVI_U32 u32BlcIso;
|
||||
|
||||
CVI_U32 u32IspDgainSF;
|
||||
CVI_U32 u32AgainSF;
|
||||
CVI_U32 u32DgainSF;
|
||||
CVI_U32 u32IsoSF;
|
||||
CVI_U32 u32BlcIsoSF;
|
||||
CVI_FLOAT fEvRatio[2];
|
||||
} ISP_AE_RESULT_S;
|
||||
|
||||
typedef struct _ISP_BE_AE_STAT_1_S {
|
||||
CVI_BOOL bStable;
|
||||
} ISP_BE_AE_STAT_1_S;
|
||||
|
||||
typedef struct _ISP_BE_AE_STAT_2_S {
|
||||
CVI_BOOL bStable;
|
||||
} ISP_BE_AE_STAT_2_S;
|
||||
|
||||
typedef struct _ISP_BE_AE_STAT_3_S {
|
||||
CVI_BOOL bStable;
|
||||
} ISP_BE_AE_STAT_3_S;
|
||||
|
||||
typedef struct _ISP_BE_AE_STITCH_STAT_3_S {
|
||||
CVI_BOOL bStable;
|
||||
} ISP_BE_AE_STITCH_STAT_3_S;
|
||||
|
||||
typedef struct _ISP_AE_INFO_S {
|
||||
CVI_U32 u32FrameCnt; /* the counting of frame */
|
||||
ISP_SMART_ROI_S stSmartInfo;
|
||||
ISP_FE_AE_STAT_1_S * pstFEAeStat1[AE_MAX_NUM];
|
||||
ISP_FE_AE_STAT_2_S * pstFEAeStat2[AE_MAX_NUM];
|
||||
ISP_FE_AE_STAT_3_S * pstFEAeStat3[AE_MAX_NUM];
|
||||
ISP_FE_AE_STITCH_STAT_3_S *pstFEAeStiStat;
|
||||
ISP_BE_AE_STAT_1_S *pstBEAeStat1;
|
||||
ISP_BE_AE_STAT_2_S *pstBEAeStat2;
|
||||
ISP_BE_AE_STAT_3_S *pstBEAeStat3;
|
||||
ISP_BE_AE_STITCH_STAT_3_S *pstBEAeStiStat;
|
||||
ISP_3AWIN_CONFIG_S aeLEWinConfig[AE_MAX_NUM];
|
||||
ISP_3AWIN_CONFIG_S aeSEWinConfig;
|
||||
} ISP_AE_INFO_S;
|
||||
|
||||
typedef struct bmISP_DCI_INFO_S {
|
||||
CVI_U32 u32FrameCnt; /* the counting of frame */
|
||||
|
||||
CVI_U16 pStat[DCI_BINS_NUM];
|
||||
} ISP_DCI_INFO_S;
|
||||
|
||||
|
||||
/* the init param of awb alg */
|
||||
typedef struct _ISP_AWB_PARAM_S {
|
||||
SENSOR_ID SensorId;
|
||||
CVI_U8 u8WDRMode;
|
||||
CVI_U8 u8AWBZoneRow;
|
||||
CVI_U8 u8AWBZoneCol;
|
||||
CVI_U8 u8AWBZoneBin;
|
||||
ISP_STITCH_ATTR_S stStitchAttr;
|
||||
CVI_U16 u16AWBWidth;
|
||||
CVI_U16 u16AWBHeight;
|
||||
CVI_S8 s8Rsv;
|
||||
} ISP_AWB_PARAM_S;
|
||||
|
||||
typedef struct _ISP_AWB_RAW_STAT_ATTR_S {
|
||||
bool bStatCfgUpdate;
|
||||
|
||||
CVI_U16 u16MeteringWhiteLevelAwb;
|
||||
CVI_U16 u16MeteringBlackLevelAwb;
|
||||
CVI_U16 u16MeteringCrRefMaxAwb;
|
||||
CVI_U16 u16MeteringCbRefMaxAwb;
|
||||
CVI_U16 u16MeteringCrRefMinAwb;
|
||||
CVI_U16 u16MeteringCbRefMinAwb;
|
||||
} ISP_AWB_RAW_STAT_ATTR_S;
|
||||
|
||||
typedef struct _ISP_AWB_RESULT_S {
|
||||
CVI_U32 au32WhiteBalanceGain[ISP_BAYER_CHN_NUM];
|
||||
CVI_U16 au16ColorMatrix[CCM_MATRIX_SIZE];
|
||||
CVI_U32 u32ColorTemp;
|
||||
CVI_U8 u8Saturation[4];
|
||||
ISP_AWB_RAW_STAT_ATTR_S stRawStatAttr;
|
||||
CVI_BOOL bStable;
|
||||
CVI_U8 u8AdjCASaturation;
|
||||
CVI_U8 u8AdjCASatLuma;
|
||||
} ISP_AWB_RESULT_S;
|
||||
|
||||
typedef struct _ISP_AWB_STAT_1_S {
|
||||
CVI_U16 u16MeteringAwbAvgR;
|
||||
CVI_U16 u16MeteringAwbAvgG;
|
||||
CVI_U16 u16MeteringAwbAvgB;
|
||||
CVI_U16 u16MeteringAwbCountAll;
|
||||
} ISP_AWB_STAT_1_S;
|
||||
|
||||
typedef struct _ISP_AWB_STAT_RESULT_S {
|
||||
CVI_U16 *pau16ZoneAvgR;
|
||||
CVI_U16 *pau16ZoneAvgG;
|
||||
CVI_U16 *pau16ZoneAvgB;
|
||||
CVI_U16 *pau16ZoneCount;
|
||||
} ISP_AWB_STAT_RESULT_S;
|
||||
|
||||
typedef struct _ISP_AWB_INFO_S {
|
||||
CVI_U32 u32FrameCnt;
|
||||
ISP_SMART_ROI_S stSmartInfo;
|
||||
ISP_AWB_STAT_1_S * pstAwbStat1[ISP_CHANNEL_MAX_NUM];
|
||||
ISP_AWB_STAT_RESULT_S stAwbStat2[ISP_CHANNEL_MAX_NUM];
|
||||
CVI_U8 u8AwbGainSwitch;
|
||||
CVI_U32 au32WDRWBGain[ISP_BAYER_CHN_NUM];
|
||||
CVI_U32 u32IsoNum;
|
||||
CVI_S16 s16LVx100;
|
||||
CVI_FLOAT fBVstep;
|
||||
} ISP_AWB_INFO_S;
|
||||
|
||||
// AF related structure
|
||||
typedef struct _ISP_AF_PARAM_S {
|
||||
SENSOR_ID SensorId;
|
||||
CVI_U8 u8WDRMode;
|
||||
CVI_S32 s32Rsv;
|
||||
} ISP_AF_PARAM_S;
|
||||
|
||||
typedef struct _ISP_AF_INFO_S {
|
||||
CVI_U32 u32FrameCnt;
|
||||
ISP_AF_STATISTICS_S *pstAfStat;
|
||||
} ISP_AF_INFO_S;
|
||||
|
||||
typedef struct _ISP_AF_RESULT_S {
|
||||
CVI_S32 s32Rsv;
|
||||
} ISP_AF_RESULT_S;
|
||||
|
||||
typedef struct _ISP_AE_STITCH_STATISTICS_S {
|
||||
CVI_U32 enable;
|
||||
} ISP_AE_STITCH_STATISTICS_S;
|
||||
|
||||
typedef struct _ISP_BIND_ATTR_S {
|
||||
SENSOR_ID sensorId;
|
||||
ALG_LIB_S stAeLib;
|
||||
ALG_LIB_S stAfLib;
|
||||
ALG_LIB_S stAwbLib;
|
||||
} ISP_BIND_ATTR_S;
|
||||
|
||||
typedef struct _ISP_AE_EXP_FUNC_S {
|
||||
CVI_S32 (*pfn_ae_init)(VI_PIPE ViPipe, const ISP_AE_PARAM_S *pstAeParam);
|
||||
CVI_S32 (*pfn_ae_run)(VI_PIPE ViPipe, const ISP_AE_INFO_S *pstAeInfo,
|
||||
ISP_AE_RESULT_S *pstAeResult, CVI_S32 s32Rsv);
|
||||
CVI_S32 (*pfn_ae_ctrl)(VI_PIPE ViPipe, CVI_U32 u32Cmd, void *pValue);
|
||||
CVI_S32 (*pfn_ae_exit)(VI_PIPE ViPipe);
|
||||
} ISP_AE_EXP_FUNC_S;
|
||||
|
||||
typedef struct _ISP_AWB_EXP_FUNC_S {
|
||||
CVI_S32 (*pfn_awb_init)(VI_PIPE ViPipe, const ISP_AWB_PARAM_S *pstAwbParam);
|
||||
CVI_S32 (*pfn_awb_run)(VI_PIPE ViPipe, const ISP_AWB_INFO_S *pstAwbInfo, ISP_AWB_RESULT_S *pstAwbResult,
|
||||
CVI_S32 s32Rsv);
|
||||
CVI_S32 (*pfn_awb_ctrl)(VI_PIPE ViPipe, CVI_U32 u32Cmd, CVI_VOID *pValue);
|
||||
CVI_S32 (*pfn_awb_exit)(VI_PIPE ViPipe);
|
||||
} ISP_AWB_EXP_FUNC_S;
|
||||
|
||||
typedef struct _ISP_AF_EXP_FUNC_S {
|
||||
CVI_S32 (*pfn_af_init)(VI_PIPE ViPipe, const ISP_AF_PARAM_S *pstAfParam);
|
||||
CVI_S32 (*pfn_af_run)(VI_PIPE ViPipe, const ISP_AF_INFO_S *pstAfInfo, ISP_AF_RESULT_S *pstAfResult,
|
||||
CVI_S32 s32Rsv);
|
||||
CVI_S32 (*pfn_af_ctrl)(VI_PIPE ViPipe, CVI_U32 u32Cmd, CVI_VOID *pValue);
|
||||
CVI_S32 (*pfn_af_exit)(VI_PIPE ViPipe);
|
||||
} ISP_AF_EXP_FUNC_S;
|
||||
|
||||
typedef struct _ISP_AE_REGISTER_S {
|
||||
ISP_AE_EXP_FUNC_S stAeExpFunc;
|
||||
} ISP_AE_REGISTER_S;
|
||||
|
||||
typedef struct _ISP_AWB_REGISTER_S {
|
||||
ISP_AWB_EXP_FUNC_S stAwbExpFunc;
|
||||
} ISP_AWB_REGISTER_S;
|
||||
|
||||
typedef struct _ISP_AF_REGISTER_S {
|
||||
ISP_AF_EXP_FUNC_S stAfExpFunc;
|
||||
} ISP_AF_REGISTER_S;
|
||||
|
||||
typedef enum _ISP_CTRL_CMD_E {
|
||||
ISP_WDR_MODE_SET = 0,
|
||||
|
||||
ISP_CTRL_CMD_BUTT_MAX,
|
||||
} ISP_CTRL_CMD_E;
|
||||
|
||||
|
||||
#define AWB_DBG_VER (11)
|
||||
#define AWB_SENSOR_NUM (2)
|
||||
#define AWB_DBG_W (64)
|
||||
#define AWB_DBG_H (32)
|
||||
#define AWB_SHIFT_REGION_NUM (4)
|
||||
typedef struct _AWB_DBG_S {
|
||||
//Don't modify ==>
|
||||
CVI_U32 u32Date;
|
||||
CVI_U16 u16AlgoVer;
|
||||
CVI_U16 u16DbgVer;
|
||||
CVI_U16 u16MaxFrameNum;
|
||||
CVI_U16 u16SensorId;
|
||||
CVI_U32 u32BinSize;
|
||||
CVI_U16 u16WinWnum;
|
||||
CVI_U16 u16WinHnum;
|
||||
CVI_U16 u16WinOffX;
|
||||
CVI_U16 u16WinOffY;
|
||||
CVI_U16 u16WinWsize;
|
||||
CVI_U16 u16WinHsize;
|
||||
CVI_U16 u16P_R[2][AWB_DBG_W*AWB_DBG_H];//keep Max Size
|
||||
CVI_U16 u16P_G[2][AWB_DBG_W*AWB_DBG_H];//keep Max Size
|
||||
CVI_U16 u16P_B[2][AWB_DBG_W*AWB_DBG_H];//keep Max Size
|
||||
CVI_U16 u16P_type[2][AWB_DBG_W*AWB_DBG_H];//keep Max Size
|
||||
CVI_U16 u16GrayCnt;
|
||||
CVI_U16 u16BalanceR;
|
||||
CVI_U16 u16BalanceB;
|
||||
CVI_U16 u16FinalR;
|
||||
CVI_U16 u16FinalB;
|
||||
CVI_U16 u16CurrentR;
|
||||
CVI_U16 u16CurrentB;
|
||||
CVI_U16 u16IdealR;
|
||||
CVI_U16 u16IdealB;
|
||||
CVI_U16 CalibRgain[AWB_CALIB_PTS_NUM];
|
||||
CVI_U16 CalibBgain[AWB_CALIB_PTS_NUM];
|
||||
CVI_U16 CalibTemp[AWB_CALIB_PTS_NUM];
|
||||
CVI_U16 u16CurveR[256];//4096/16
|
||||
CVI_U16 u16CurveB[256];
|
||||
CVI_U16 u16CurveB_Top[256];
|
||||
CVI_U16 u16CurveB_Bot[256];
|
||||
CVI_S16 s16LvX100;
|
||||
CVI_U32 u32ISONum;
|
||||
ISP_WB_ATTR_S dbgMPIAttr[AWB_SENSOR_NUM];
|
||||
ISP_WB_ATTR_S dbgInfoAttr[AWB_SENSOR_NUM];
|
||||
ISP_AWB_ATTR_EX_S dbgMPIAttrEx[AWB_SENSOR_NUM];
|
||||
ISP_AWB_ATTR_EX_S dbgInfoAttrEx[AWB_SENSOR_NUM];
|
||||
//Don't modify <==
|
||||
CVI_U8 calib_sts;
|
||||
ISP_AWB_Calibration_Gain_S_EX calib_ex;
|
||||
ISP_SMART_ROI_S stFace;
|
||||
|
||||
// fix size to 128 byte from here
|
||||
CVI_U16 u16Region_R[AWB_SHIFT_REGION_NUM];
|
||||
CVI_U8 u8Reserve[120];
|
||||
} s_AWB_DBG_S;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* __CVI_COMM_3A_H__ */
|
||||
47
middleware/v2/include/isp/sg200x/cvi_comm_inc.h
Normal file
47
middleware/v2/include/isp/sg200x/cvi_comm_inc.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2021. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_common_inc.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __CVI_COMM_INC_H__
|
||||
#define __CVI_COMM_INC_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#include "stddef.h"
|
||||
#include "stdint.h"
|
||||
#include <sys/time.h>
|
||||
|
||||
#if defined(ARCH_CV183X) || defined(ARCH_CV182X)
|
||||
#include <cvi_common.h>
|
||||
#include <cvi_comm_vi.h>
|
||||
#include <cvi_comm_video.h>
|
||||
#include <cvi_defines.h>
|
||||
#elif defined(ARCH_RTOS_CV181X)
|
||||
#include <cvi_common.h>
|
||||
#include <cvi_comm_vi.h>
|
||||
#include <cvi_comm_video.h>
|
||||
#include <cvi_defines.h>
|
||||
#elif defined(ARCH_CV181X) || defined(ARCH_CV180X) || defined(__SOC_MARS__) || defined(__SOC_PHOBOS__)
|
||||
#include <linux/cvi_common.h>
|
||||
#include <linux/cvi_comm_vi.h>
|
||||
#include <linux/cvi_comm_video.h>
|
||||
#include <linux/cvi_defines.h>
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* __CVI_COMM_INC_H__ */
|
||||
2667
middleware/v2/include/isp/sg200x/cvi_comm_isp.h
Normal file
2667
middleware/v2/include/isp/sg200x/cvi_comm_isp.h
Normal file
File diff suppressed because it is too large
Load Diff
324
middleware/v2/include/isp/sg200x/cvi_isp.h
Normal file
324
middleware/v2/include/isp/sg200x/cvi_isp.h
Normal file
@@ -0,0 +1,324 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2022. All rights reserved.
|
||||
*
|
||||
* File Name: include/cvi_isp.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __CVI_ISP_H__
|
||||
#define __CVI_ISP_H__
|
||||
|
||||
#include "stdio.h"
|
||||
|
||||
#include "cvi_comm_isp.h"
|
||||
#include "cvi_comm_3a.h"
|
||||
#include "cvi_comm_sns.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
/* Firmware Main Operation */
|
||||
CVI_S32 CVI_ISP_Init(VI_PIPE ViPipe);
|
||||
CVI_S32 CVI_ISP_MemInit(VI_PIPE ViPipe);
|
||||
CVI_S32 CVI_ISP_Run(VI_PIPE ViPipe);
|
||||
CVI_S32 CVI_ISP_RunOnce(VI_PIPE ViPipe);
|
||||
CVI_S32 CVI_ISP_Exit(VI_PIPE ViPipe);
|
||||
|
||||
/* Each Param set / get Operation */
|
||||
CVI_S32 CVI_ISP_SetPubAttr(VI_PIPE ViPipe, const ISP_PUB_ATTR_S *pstPubAttr);
|
||||
CVI_S32 CVI_ISP_GetPubAttr(VI_PIPE ViPipe, ISP_PUB_ATTR_S *pstPubAttr);
|
||||
CVI_S32 CVI_ISP_SetModParam(const ISP_MOD_PARAM_S *pstModParam);
|
||||
CVI_S32 CVI_ISP_GetModParam(ISP_MOD_PARAM_S *pstModParam);
|
||||
CVI_S32 CVI_ISP_SetCtrlParam(VI_PIPE ViPipe,
|
||||
const ISP_CTRL_PARAM_S *pstIspCtrlParam);
|
||||
CVI_S32 CVI_ISP_GetCtrlParam(VI_PIPE ViPipe, ISP_CTRL_PARAM_S *pstIspCtrlParam);
|
||||
CVI_S32 CVI_ISP_SetFMWState(VI_PIPE ViPipe, const ISP_FMW_STATE_E enState);
|
||||
CVI_S32 CVI_ISP_GetFMWState(VI_PIPE ViPipe, ISP_FMW_STATE_E *penState);
|
||||
/* sensor related register */
|
||||
CVI_S32 CVI_ISP_SensorRegCallBack(VI_PIPE ViPipe,
|
||||
ISP_SNS_ATTR_INFO_S *pstSnsAttrInfo, ISP_SENSOR_REGISTER_S *pstRegister);
|
||||
CVI_S32 CVI_ISP_SensorUnRegCallBack(VI_PIPE ViPipe, SENSOR_ID SensorId);
|
||||
|
||||
/* 3a algo &static related function. */
|
||||
CVI_S32 CVI_AWB_Register(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib);
|
||||
CVI_S32 CVI_AWB_UnRegister(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib);
|
||||
|
||||
CVI_S32 CVI_ISP_AELibRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib,
|
||||
ISP_AE_REGISTER_S *pstRegister);
|
||||
CVI_S32 CVI_ISP_AELibUnRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib);
|
||||
|
||||
CVI_S32 CVI_ISP_AWBLibRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib,
|
||||
ISP_AWB_REGISTER_S *pstRegister);
|
||||
CVI_S32 CVI_ISP_AWBLibUnRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib);
|
||||
|
||||
CVI_S32 CVI_ISP_AFLibRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAfLib,
|
||||
ISP_AF_REGISTER_S *pstRegister);
|
||||
CVI_S32 CVI_ISP_AFLibUnRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib);
|
||||
|
||||
CVI_S32 CVI_ISP_SetBindAttr(VI_PIPE ViPipe, const ISP_BIND_ATTR_S *pstBindAttr);
|
||||
CVI_S32 CVI_ISP_GetBindAttr(VI_PIPE ViPipe, ISP_BIND_ATTR_S *pstBindAttr);
|
||||
|
||||
CVI_S32 CVI_ISP_SetModuleControl(VI_PIPE ViPipe, const ISP_MODULE_CTRL_U *punModCtrl);
|
||||
CVI_S32 CVI_ISP_GetModuleControl(VI_PIPE ViPipe, ISP_MODULE_CTRL_U *punModCtrl);
|
||||
CVI_S32 CVI_ISP_SetRegister(VI_PIPE ViPipe, CVI_U32 u32Addr, CVI_U32 u32Value);
|
||||
CVI_S32 CVI_ISP_GetRegister(VI_PIPE ViPipe, CVI_U32 u32Addr, CVI_U32 *pu32Value);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Black Level Correction(BLC)
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetBlackLevelAttr(VI_PIPE ViPipe, const ISP_BLACK_LEVEL_ATTR_S *pstBlackLevelAttr);
|
||||
CVI_S32 CVI_ISP_GetBlackLevelAttr(VI_PIPE ViPipe, ISP_BLACK_LEVEL_ATTR_S *pstBlackLevelAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Dead pixel correction(DPC)
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetDPDynamicAttr(VI_PIPE ViPipe, const ISP_DP_DYNAMIC_ATTR_S *pstDPCDynamicAttr);
|
||||
CVI_S32 CVI_ISP_GetDPDynamicAttr(VI_PIPE ViPipe, ISP_DP_DYNAMIC_ATTR_S *pstDPCDynamicAttr);
|
||||
CVI_S32 CVI_ISP_SetDPStaticAttr(VI_PIPE ViPipe, const ISP_DP_STATIC_ATTR_S *pstDPStaticAttr);
|
||||
CVI_S32 CVI_ISP_GetDPStaticAttr(VI_PIPE ViPipe, ISP_DP_STATIC_ATTR_S *pstDPStaticAttr);
|
||||
CVI_S32 CVI_ISP_SetDPCalibrate(VI_PIPE ViPipe, const ISP_DP_CALIB_ATTR_S *pstDPCalibAttr);
|
||||
CVI_S32 CVI_ISP_GetDPCalibrate(VI_PIPE ViPipe, ISP_DP_CALIB_ATTR_S *pstDPCalibAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Crosstalk
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetCrosstalkAttr(VI_PIPE ViPipe, const ISP_CROSSTALK_ATTR_S *pstCrosstalkAttr);
|
||||
CVI_S32 CVI_ISP_GetCrosstalkAttr(VI_PIPE ViPipe, ISP_CROSSTALK_ATTR_S *pstCrosstalkAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Bayer domain noise reduction (BNR)
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetNRAttr(VI_PIPE ViPipe, const ISP_NR_ATTR_S *pstNRAttr);
|
||||
CVI_S32 CVI_ISP_GetNRAttr(VI_PIPE ViPipe, ISP_NR_ATTR_S *pstNRAttr);
|
||||
CVI_S32 CVI_ISP_SetNRFilterAttr(VI_PIPE ViPipe, const ISP_NR_FILTER_ATTR_S *pstNRFilterAttr);
|
||||
CVI_S32 CVI_ISP_GetNRFilterAttr(VI_PIPE ViPipe, ISP_NR_FILTER_ATTR_S *pstNRFilterAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Demosaic
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetDemosaicAttr(VI_PIPE ViPipe, const ISP_DEMOSAIC_ATTR_S *pstDemosaicAttr);
|
||||
CVI_S32 CVI_ISP_GetDemosaicAttr(VI_PIPE ViPipe, ISP_DEMOSAIC_ATTR_S *pstDemosaicAttr);
|
||||
CVI_S32 CVI_ISP_SetDemosaicDemoireAttr(VI_PIPE ViPipe, const ISP_DEMOSAIC_DEMOIRE_ATTR_S *pstDemosaicDemoireAttr);
|
||||
CVI_S32 CVI_ISP_GetDemosaicDemoireAttr(VI_PIPE ViPipe, ISP_DEMOSAIC_DEMOIRE_ATTR_S *pstDemosaicDemoireAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// RGBCAC
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetRGBCACAttr(VI_PIPE ViPipe, const ISP_RGBCAC_ATTR_S *pstRGBCACAttr);
|
||||
CVI_S32 CVI_ISP_GetRGBCACAttr(VI_PIPE ViPipe, ISP_RGBCAC_ATTR_S *pstRGBCACAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LCAC
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetLCACAttr(VI_PIPE ViPipe, const ISP_LCAC_ATTR_S *pstLCACAttr);
|
||||
CVI_S32 CVI_ISP_GetLCACAttr(VI_PIPE ViPipe, ISP_LCAC_ATTR_S *pstLCACAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Mesh lens shading correction (MLSC)
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetMeshShadingAttr(VI_PIPE ViPipe, const ISP_MESH_SHADING_ATTR_S *pstMeshShadingAttr);
|
||||
CVI_S32 CVI_ISP_GetMeshShadingAttr(VI_PIPE ViPipe, ISP_MESH_SHADING_ATTR_S *pstMeshShadingAttr);
|
||||
CVI_S32 CVI_ISP_SetMeshShadingGainLutAttr(VI_PIPE ViPipe,
|
||||
const ISP_MESH_SHADING_GAIN_LUT_ATTR_S *pstMeshShadingGainLutAttr);
|
||||
CVI_S32 CVI_ISP_GetMeshShadingGainLutAttr(VI_PIPE ViPipe,
|
||||
ISP_MESH_SHADING_GAIN_LUT_ATTR_S *pstMeshShadingGainLutAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CCM
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetSaturationAttr(VI_PIPE ViPipe, const ISP_SATURATION_ATTR_S *pstSaturationAttr);
|
||||
CVI_S32 CVI_ISP_GetSaturationAttr(VI_PIPE ViPipe, ISP_SATURATION_ATTR_S *pstSaturationAttr);
|
||||
CVI_S32 CVI_ISP_SetCCMSaturationAttr(VI_PIPE ViPipe, const ISP_CCM_SATURATION_ATTR_S *pstCCMSaturationAttr);
|
||||
CVI_S32 CVI_ISP_GetCCMSaturationAttr(VI_PIPE ViPipe, ISP_CCM_SATURATION_ATTR_S *pstCCMSaturationAttr);
|
||||
CVI_S32 CVI_ISP_SetCCMAttr(VI_PIPE ViPipe, const ISP_CCM_ATTR_S *pstCCMAttr);
|
||||
CVI_S32 CVI_ISP_GetCCMAttr(VI_PIPE ViPipe, ISP_CCM_ATTR_S *pstCCMAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CSC
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetCSCAttr(VI_PIPE ViPipe, const ISP_CSC_ATTR_S *pstCSCAttr);
|
||||
CVI_S32 CVI_ISP_GetCSCAttr(VI_PIPE ViPipe, ISP_CSC_ATTR_S *pstCSCAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Color tone
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetColorToneAttr(VI_PIPE ViPipe,
|
||||
const ISP_COLOR_TONE_ATTR_S *pstColorToneAttr);
|
||||
CVI_S32 CVI_ISP_GetColorToneAttr(VI_PIPE ViPipe, ISP_COLOR_TONE_ATTR_S *pstColorToneAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// FSWDR
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetFSWDRAttr(VI_PIPE ViPipe, const ISP_FSWDR_ATTR_S *pstFSWDRAttr);
|
||||
CVI_S32 CVI_ISP_GetFSWDRAttr(VI_PIPE ViPipe, ISP_FSWDR_ATTR_S *pstFSWDRAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// DRC
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetDRCAttr(VI_PIPE ViPipe, const ISP_DRC_ATTR_S *pstDRCAttr);
|
||||
CVI_S32 CVI_ISP_GetDRCAttr(VI_PIPE ViPipe, ISP_DRC_ATTR_S *pstDRCAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Gamma
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetGammaAttr(VI_PIPE ViPipe, const ISP_GAMMA_ATTR_S *pstGammaAttr);
|
||||
CVI_S32 CVI_ISP_GetGammaAttr(VI_PIPE ViPipe, ISP_GAMMA_ATTR_S *pstGammaAttr);
|
||||
CVI_S32 CVI_ISP_GetGammaCurveByType(VI_PIPE ViPipe, ISP_GAMMA_ATTR_S *pstGammaAttr,
|
||||
const ISP_GAMMA_CURVE_TYPE_E curveType);
|
||||
CVI_S32 CVI_ISP_SetAutoGammaAttr(VI_PIPE ViPipe, const ISP_AUTO_GAMMA_ATTR_S *pstGammaAttr);
|
||||
CVI_S32 CVI_ISP_GetAutoGammaAttr(VI_PIPE ViPipe, ISP_AUTO_GAMMA_ATTR_S *pstGammaAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Dehaze
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetDehazeAttr(VI_PIPE ViPipe,
|
||||
const ISP_DEHAZE_ATTR_S *pstDehazeAttr);
|
||||
CVI_S32 CVI_ISP_GetDehazeAttr(VI_PIPE ViPipe, ISP_DEHAZE_ATTR_S *pstDehazeAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CLUT
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetClutAttr(VI_PIPE ViPipe, const ISP_CLUT_ATTR_S *pstClutAttr);
|
||||
CVI_S32 CVI_ISP_GetClutAttr(VI_PIPE ViPipe, ISP_CLUT_ATTR_S *pstClutAttr);
|
||||
CVI_S32 CVI_ISP_SetClutSaturationAttr(VI_PIPE ViPipe, const ISP_CLUT_SATURATION_ATTR_S *pstClutSaturationAttr);
|
||||
CVI_S32 CVI_ISP_GetClutSaturationAttr(VI_PIPE ViPipe, ISP_CLUT_SATURATION_ATTR_S *pstClutSaturationAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// DCI
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetDCIAttr(VI_PIPE ViPipe, const ISP_DCI_ATTR_S *pstDCIAttr);
|
||||
CVI_S32 CVI_ISP_GetDCIAttr(VI_PIPE ViPipe, ISP_DCI_ATTR_S *pstDCIAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LDCI
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetLDCIAttr(VI_PIPE ViPipe, const ISP_LDCI_ATTR_S *pstLDCIAttr);
|
||||
CVI_S32 CVI_ISP_GetLDCIAttr(VI_PIPE ViPipe, ISP_LDCI_ATTR_S *pstLDCIAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CA (CA/CP)
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetCAAttr(VI_PIPE ViPipe, const ISP_CA_ATTR_S *pstCAAttr);
|
||||
CVI_S32 CVI_ISP_GetCAAttr(VI_PIPE ViPipe, ISP_CA_ATTR_S *pstCAAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CA2
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetCA2Attr(VI_PIPE ViPipe, const ISP_CA2_ATTR_S *pstCA2Attr);
|
||||
CVI_S32 CVI_ISP_GetCA2Attr(VI_PIPE ViPipe, ISP_CA2_ATTR_S *pstCA2Attr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// PreSharpen
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetPreSharpenAttr(VI_PIPE ViPipe, const ISP_PRESHARPEN_ATTR_S *pstPreSharpenAttr);
|
||||
CVI_S32 CVI_ISP_GetPreSharpenAttr(VI_PIPE ViPipe, ISP_PRESHARPEN_ATTR_S *pstPreSharpenAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Time-domain noise reduction (TNR)
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetTNRAttr(VI_PIPE ViPipe, const ISP_TNR_ATTR_S *pstTNRAttr);
|
||||
CVI_S32 CVI_ISP_GetTNRAttr(VI_PIPE ViPipe, ISP_TNR_ATTR_S *pstTNRAttr);
|
||||
CVI_S32 CVI_ISP_SetTNRNoiseModelAttr(VI_PIPE ViPipe, const ISP_TNR_NOISE_MODEL_ATTR_S *pstTNRNoiseModelAttr);
|
||||
CVI_S32 CVI_ISP_GetTNRNoiseModelAttr(VI_PIPE ViPipe, ISP_TNR_NOISE_MODEL_ATTR_S *pstTNRNoiseModelAttr);
|
||||
CVI_S32 CVI_ISP_SetTNRLumaMotionAttr(VI_PIPE ViPipe, const ISP_TNR_LUMA_MOTION_ATTR_S *pstTNRLumaMotionAttr);
|
||||
CVI_S32 CVI_ISP_GetTNRLumaMotionAttr(VI_PIPE ViPipe, ISP_TNR_LUMA_MOTION_ATTR_S *pstTNRLumaMotionAttr);
|
||||
CVI_S32 CVI_ISP_SetTNRGhostAttr(VI_PIPE ViPipe, const ISP_TNR_GHOST_ATTR_S *pstTNRGhostAttr);
|
||||
CVI_S32 CVI_ISP_GetTNRGhostAttr(VI_PIPE ViPipe, ISP_TNR_GHOST_ATTR_S *pstTNRGhostAttr);
|
||||
CVI_S32 CVI_ISP_SetTNRMtPrtAttr(VI_PIPE ViPipe, const ISP_TNR_MT_PRT_ATTR_S *pstTNRMtPrtAttr);
|
||||
CVI_S32 CVI_ISP_GetTNRMtPrtAttr(VI_PIPE ViPipe, ISP_TNR_MT_PRT_ATTR_S *pstTNRMtPrtAttr);
|
||||
CVI_S32 CVI_ISP_SetTNRMotionAdaptAttr(VI_PIPE ViPipe, const ISP_TNR_MOTION_ADAPT_ATTR_S *pstTNRMotionAdaptAttr);
|
||||
CVI_S32 CVI_ISP_GetTNRMotionAdaptAttr(VI_PIPE ViPipe, ISP_TNR_MOTION_ADAPT_ATTR_S *pstTNRMotionAdaptAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Y domain noise reduction (YNR)
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetYNRAttr(VI_PIPE ViPipe, const ISP_YNR_ATTR_S *pstYNRAttr);
|
||||
CVI_S32 CVI_ISP_GetYNRAttr(VI_PIPE ViPipe, ISP_YNR_ATTR_S *pstYNRAttr);
|
||||
CVI_S32 CVI_ISP_SetYNRMotionNRAttr(VI_PIPE ViPipe, const ISP_YNR_MOTION_NR_ATTR_S *pstYNRMotionNRAttr);
|
||||
CVI_S32 CVI_ISP_GetYNRMotionNRAttr(VI_PIPE ViPipe, ISP_YNR_MOTION_NR_ATTR_S *pstYNRMotionNRAttr);
|
||||
CVI_S32 CVI_ISP_SetYNRFilterAttr(VI_PIPE ViPipe, const ISP_YNR_FILTER_ATTR_S *pstYNRFilterAttr);
|
||||
CVI_S32 CVI_ISP_GetYNRFilterAttr(VI_PIPE ViPipe, ISP_YNR_FILTER_ATTR_S *pstYNRFilterAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// UV domain noise reduction (CNR)
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetCNRAttr(VI_PIPE ViPipe, const ISP_CNR_ATTR_S *pstCNRAttr);
|
||||
CVI_S32 CVI_ISP_GetCNRAttr(VI_PIPE ViPipe, ISP_CNR_ATTR_S *pstCNRAttr);
|
||||
CVI_S32 CVI_ISP_SetCNRMotionNRAttr(VI_PIPE ViPipe, const ISP_CNR_MOTION_NR_ATTR_S *pstCNRMotionNRAttr);
|
||||
CVI_S32 CVI_ISP_GetCNRMotionNRAttr(VI_PIPE ViPipe, ISP_CNR_MOTION_NR_ATTR_S *pstCNRMotionNRAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CAC
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetCACAttr(VI_PIPE ViPipe, const ISP_CAC_ATTR_S *pstCACAttr);
|
||||
CVI_S32 CVI_ISP_GetCACAttr(VI_PIPE ViPipe, ISP_CAC_ATTR_S *pstCACAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Sharpen
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetSharpenAttr(VI_PIPE ViPipe, const ISP_SHARPEN_ATTR_S *pstSharpenAttr);
|
||||
CVI_S32 CVI_ISP_GetSharpenAttr(VI_PIPE ViPipe, ISP_SHARPEN_ATTR_S *pstSharpenAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Y Contrast
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetYContrastAttr(VI_PIPE ViPipe, const ISP_YCONTRAST_ATTR_S *pstYContrastAttr);
|
||||
CVI_S32 CVI_ISP_GetYContrastAttr(VI_PIPE ViPipe, ISP_YCONTRAST_ATTR_S *pstYContrastAttr);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Mono
|
||||
//-----------------------------------------------------------------------------
|
||||
CVI_S32 CVI_ISP_SetMonoAttr(VI_PIPE ViPipe, const ISP_MONO_ATTR_S *pstMonoAttr);
|
||||
CVI_S32 CVI_ISP_GetMonoAttr(VI_PIPE ViPipe, ISP_MONO_ATTR_S *pstMonoAttr);
|
||||
|
||||
|
||||
CVI_S32 CVI_ISP_SetStatisticsConfig(VI_PIPE ViPipe, const ISP_STATISTICS_CFG_S *pstStatCfg);
|
||||
CVI_S32 CVI_ISP_GetStatisticsConfig(VI_PIPE ViPipe, ISP_STATISTICS_CFG_S *pstStatCfg);
|
||||
CVI_S32 CVI_ISP_GetAEStatistics(VI_PIPE ViPipe, ISP_AE_STATISTICS_S *pstAeStat);
|
||||
CVI_S32 CVI_ISP_GetWBStatistics(VI_PIPE ViPipe, ISP_WB_STATISTICS_S *pstWBStat);
|
||||
CVI_S32 CVI_ISP_GetFocusStatistics(VI_PIPE ViPipe, ISP_AF_STATISTICS_S *pstAfStat);
|
||||
CVI_S32 CVI_ISP_GetLightboxGain(VI_PIPE ViPipe, ISP_AWB_LightBox_Gain_S *pstAWBLightBoxGain);
|
||||
|
||||
CVI_S32 CVI_ISP_SetNoiseProfileAttr(VI_PIPE ViPipe, const ISP_CMOS_NOISE_CALIBRATION_S *pstNoiseProfileAttr);
|
||||
CVI_S32 CVI_ISP_GetNoiseProfileAttr(VI_PIPE ViPipe, ISP_CMOS_NOISE_CALIBRATION_S *pstNoiseProfileAttr);
|
||||
|
||||
/* MIPI related function. */
|
||||
CVI_S32 CVI_MIPI_SetMipiReset(CVI_S32 devno, CVI_U32 reset);
|
||||
CVI_S32 CVI_MIPI_SetSensorClock(CVI_S32 devno, CVI_U32 enable);
|
||||
CVI_S32 CVI_MIPI_SetSensorReset(CVI_S32 devno, CVI_U32 reset);
|
||||
CVI_S32 CVI_MIPI_SetMipiAttr(CVI_S32 ViPipe, const CVI_VOID *devAttr);
|
||||
CVI_S32 CVI_MIPI_SetClkEdge(CVI_S32 devno, CVI_U32 is_up);
|
||||
CVI_S32 CVI_MIPI_SetSnsMclk(SNS_MCLK_S *mclk);
|
||||
|
||||
CVI_S32 CVI_ISP_QueryInnerStateInfo(VI_PIPE ViPipe, ISP_INNER_STATE_INFO_S *pstInnerStateInfo);
|
||||
CVI_S32 CVI_ISP_GetVDTimeOut(VI_PIPE ViPipe, ISP_VD_TYPE_E enIspVDType, CVI_U32 u32MilliSec);
|
||||
//CVI_S32 CVI_ISP_GetAEStitchStatistics(VI_PIPE ViPipe, ISP_AE_STITCH_STATISTICS_S *pstStitchStat);
|
||||
//CVI_S32 CVI_ISP_GetMGStatistics(VI_PIPE ViPipe, ISP_MG_STATISTICS_S *pstMgStat);
|
||||
//CVI_S32 CVI_ISP_GetWBStitchStatistics(VI_PIPE ViPipe, ISP_WB_STITCH_STATISTICS_S *pstStitchWBStat);
|
||||
|
||||
CVI_S32 CVI_ISP_SetDisAttr(VI_PIPE ViPipe, const ISP_DIS_ATTR_S *pstDisAttr);
|
||||
CVI_S32 CVI_ISP_GetDisAttr(VI_PIPE ViPipe, ISP_DIS_ATTR_S *pstDisAttr);
|
||||
CVI_S32 CVI_ISP_SetDisConfig(VI_PIPE ViPipe, const ISP_DIS_CONFIG_S *pstDisConfig);
|
||||
CVI_S32 CVI_ISP_GetDisConfig(VI_PIPE ViPipe, ISP_DIS_CONFIG_S *pstDisConfig);
|
||||
|
||||
CVI_S32 CVI_ISP_SetVCAttr(VI_PIPE ViPipe, const ISP_VC_ATTR_S *pstVCAttr);
|
||||
CVI_S32 CVI_ISP_GetVCAttr(VI_PIPE ViPipe, ISP_VC_ATTR_S *pstVCAttr);
|
||||
|
||||
CVI_S32 CVI_ISP_DumpHwRegisterToFile(VI_PIPE ViPipe, FILE *fp);
|
||||
CVI_S32 CVI_ISP_DumpFrameRawInfoToFile(VI_PIPE ViPipe, FILE *fp);
|
||||
|
||||
CVI_S32 CVI_ISP_IrAutoRunOnce(ISP_DEV IspDev, ISP_IR_AUTO_ATTR_S *pstIrAttr);
|
||||
|
||||
CVI_S32 CVI_ISP_SetSmartInfo(VI_PIPE ViPipe, const ISP_SMART_INFO_S *pstSmartInfo, CVI_U8 TimeOut);
|
||||
CVI_S32 CVI_ISP_GetSmartInfo(VI_PIPE ViPipe, ISP_SMART_INFO_S *pstSmartInfo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /*__CVI_ISP_H__ */
|
||||
28
middleware/v2/include/isp/sg200x/cvi_ispd2.h
Normal file
28
middleware/v2/include/isp/sg200x/cvi_ispd2.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2022. All rights reserved.
|
||||
*
|
||||
* File Name: cvi_ispd2.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef _CVI_ISPD2_H_
|
||||
#define _CVI_ISPD2_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
void isp_daemon2_init(unsigned int port);
|
||||
void isp_daemon2_uninit(void);
|
||||
|
||||
void isp_daemon2_enable_device_bind_control(int enable);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif // _CVI_ISPD2_H_
|
||||
249
middleware/v2/include/isp/sg200x/cvi_json_struct_comm.h
Normal file
249
middleware/v2/include/isp/sg200x/cvi_json_struct_comm.h
Normal file
@@ -0,0 +1,249 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2021. All rights reserved.
|
||||
*
|
||||
* File Name: cvi_json_struct_common.h
|
||||
* Description:
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _CVI_JSON_STRUCT_COMM_H
|
||||
#define _CVI_JSON_STRUCT_COMM_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <float.h>
|
||||
#include <linux/cvi_common.h>
|
||||
|
||||
#include "cvi_json.h"
|
||||
#include "cvi_bin.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
// json utils
|
||||
typedef struct cvi_json_object JSON;
|
||||
extern char param_point[150];
|
||||
#define CVI_U8_MAX 0xff
|
||||
#define CVI_S8_MIN -128
|
||||
#define CVI_S8_MAX 127
|
||||
#define CVI_U16_MAX 0xffff
|
||||
#define CVI_S16_MIN -32768
|
||||
#define CVI_S16_MAX 0x7fff
|
||||
#define CVI_U32_MAX 0xffffffff
|
||||
#define CVI_S32_MIN -2147483648
|
||||
#define CVI_S32_MAX 0x7fffffff
|
||||
#define CVI_U64_MAX 0xffffffffffffffff
|
||||
#define CVI_FLOAT_MIN -FLT_MAX
|
||||
#define CVI_FLOAT_MAX FLT_MAX
|
||||
#define R_FLAG 1
|
||||
#define W_FLAG 0
|
||||
|
||||
cvi_json_bool cvi_json_object_object_get_ex2(struct cvi_json_object *obj, const char *key,
|
||||
struct cvi_json_object **value);
|
||||
#define CVI_TRACE_JSON(level, ...) \
|
||||
do { \
|
||||
printf(__VA_ARGS__); \
|
||||
printf("\n"); \
|
||||
} while (0)
|
||||
#define JSON_(r_w_flag, base, type, key, value) type##_JSON(r_w_flag, base, key, (value))
|
||||
#define JSON(r_w_flag, type, value) JSON_(r_w_flag, obj, type, #value, &data->value)
|
||||
#define JSON_A_(r_w_flag, base, type, key, value, length) \
|
||||
do { \
|
||||
JSON *array; \
|
||||
if (r_w_flag == R_FLAG) { \
|
||||
if (cvi_json_object_object_get_ex(base, key, &array)) { \
|
||||
cvi_json_type cvi_type = cvi_json_object_get_type(array); \
|
||||
if (cvi_type != cvi_json_type_array) { \
|
||||
JSON_PRINT_ERR_DATA_TYPE(key); \
|
||||
break; \
|
||||
} \
|
||||
int size = cvi_json_object_array_length(array); \
|
||||
size = size > length ? length : size; \
|
||||
for (int i = 0; i < size; i++) { \
|
||||
char buffer_temp[50] = { 0 }; \
|
||||
snprintf(buffer_temp, sizeof(buffer_temp) - 1, "%s[%d]", key, i); \
|
||||
type##_JSON(r_w_flag, array, buffer_temp, (type *)(value) + i); \
|
||||
} \
|
||||
} else { \
|
||||
JSON_PRINT_ERR_NOT_EXIST(key); \
|
||||
} \
|
||||
} else { \
|
||||
array = cvi_json_object_new_array(); \
|
||||
for (int i = 0; i < length; i++) { \
|
||||
type##_JSON(r_w_flag, array, #value, ((type *)(value) + i)); \
|
||||
} \
|
||||
cvi_json_object_object_add(base, key, array); \
|
||||
} \
|
||||
} while (0)
|
||||
#define JSON_A(r_w_flag, type, value, length) JSON_A_(r_w_flag, obj, type, #value, data->value, (length))
|
||||
#define JSON_SB(r_w_flag, type, value) \
|
||||
{ \
|
||||
JSON *obj_temp = 0; \
|
||||
if (r_w_flag == R_FLAG) { \
|
||||
if (cvi_json_object_object_get_ex2(obj, #value, &obj_temp)) { \
|
||||
if (strcmp(#type, "CVI_U64") == 0) { \
|
||||
unsigned long long temp; \
|
||||
temp = cvi_json_object_get_uint64(obj_temp); \
|
||||
data->value = temp; \
|
||||
} \
|
||||
} else { \
|
||||
JSON_PRINT_ERR_NOT_EXIST(#value); \
|
||||
} \
|
||||
} else { \
|
||||
if (strcmp(#type, "CVI_U64") == 0) { \
|
||||
obj_temp = cvi_json_object_new_uint64(data->value); \
|
||||
} \
|
||||
if (cvi_json_object_is_type(obj, cvi_json_type_array)) { \
|
||||
cvi_json_object_array_add(obj, obj_temp); \
|
||||
} else { \
|
||||
cvi_json_object_object_add(obj, #value, obj_temp); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
#define JSON_START(r_w_flag) \
|
||||
JSON *obj = NULL; \
|
||||
{ \
|
||||
if (r_w_flag == R_FLAG) { \
|
||||
if (cvi_json_object_object_get_ex2(j, key, &obj) == 0) { \
|
||||
goto NotExit; \
|
||||
} \
|
||||
if (strlen(param_point) + strlen(key) + 1 <= sizeof(param_point) - 1) { \
|
||||
strcat(param_point, key); \
|
||||
strcat(param_point, "."); \
|
||||
} else { \
|
||||
printf("param_point overflow key =%s \n",key); \
|
||||
} \
|
||||
} else { \
|
||||
obj = cvi_json_object_new_object(); \
|
||||
} \
|
||||
}
|
||||
#define JSON_END(r_w_flag) \
|
||||
{ \
|
||||
if (r_w_flag == R_FLAG) { \
|
||||
param_point[strlen(param_point) - 1] = 0; \
|
||||
char *str = strrchr(param_point, '.'); \
|
||||
if (str == NULL) { \
|
||||
str = param_point; \
|
||||
} else { \
|
||||
str++; \
|
||||
} \
|
||||
if (strstr(key, "ISP_MESH_SHADING_GAIN_LUT_ATTR_S") || strstr(key, "ISP_CLUT_ATTR_S")) {\
|
||||
memset(param_point, 0, sizeof(param_point)); \
|
||||
} else { \
|
||||
memset(str, 0, sizeof(param_point) - (str - param_point)); \
|
||||
} \
|
||||
return; \
|
||||
NotExit: \
|
||||
JSON_PRINT_ERR_NOT_EXIST(key); \
|
||||
} else { \
|
||||
if (cvi_json_object_is_type(j, cvi_json_type_array)) { \
|
||||
cvi_json_object_array_add(j, obj); \
|
||||
} else { \
|
||||
cvi_json_object_object_add(j, key, obj); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define JSON_START_ENTRANCE(r_w_flag) \
|
||||
{ \
|
||||
if (r_w_flag == R_FLAG) { \
|
||||
if (cvi_json_object_object_get_ex2(j, key, &obj) == 0) { \
|
||||
idx = 0; \
|
||||
JSON_PRINT_ERR_NOT_EXIST(key); \
|
||||
} \
|
||||
} else { \
|
||||
obj = cvi_json_object_new_object(); \
|
||||
} \
|
||||
}
|
||||
#define JSON_END_ENTRANCE(r_w_flag) \
|
||||
{ \
|
||||
if (r_w_flag != R_FLAG) { \
|
||||
if (cvi_json_object_is_type(j, cvi_json_type_array)) { \
|
||||
cvi_json_object_array_add(j, obj); \
|
||||
} else { \
|
||||
cvi_json_object_object_add(j, key, obj); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define GET_ARRAY_STRING_SIZE(key, size, max_byte) (strlen(key) + size*(max_byte + 2) + 10)
|
||||
#define GET_OBJECT_STRING_SIZE(key, max_byte) (strlen(key) + max_byte + 10)
|
||||
|
||||
#define JSON_EX_START(str) strcat(str, "{ ")
|
||||
#define JSON_EX_END(str) strcat(str, " }")
|
||||
|
||||
#define PARSE_INT_ARRAY_TO_JSON_STR(key, data, size, str) { \
|
||||
char tmpstr[64] = {0}; \
|
||||
snprintf(tmpstr, sizeof(tmpstr),"\"%s\": [ %d", key, data[0]); \
|
||||
strcat(str, tmpstr); \
|
||||
int curPos = strlen(str); \
|
||||
for(int i = 1; i < size; i++){ \
|
||||
snprintf(tmpstr, sizeof(tmpstr), ", %d", data[i]); \
|
||||
strcat(str + curPos, tmpstr); \
|
||||
curPos += strlen(tmpstr); \
|
||||
} \
|
||||
strcat(str, " ]"); \
|
||||
}
|
||||
|
||||
#define PARSE_JSON_STR_TO_INT_VALUE(key, json_str, data) do{ \
|
||||
unsigned int tmpVal; \
|
||||
char *tmp_str = strstr(json_str, #key); \
|
||||
tmp_str = strstr(tmp_str, ":"); \
|
||||
sscanf(tmp_str + 1, "%u", &tmpVal); \
|
||||
data->key = tmpVal; \
|
||||
} while(0);
|
||||
|
||||
#define PARSE_JSON_STR_TO_INT_ARRAY(key, json_str, data, size) do { \
|
||||
unsigned int tmpVal; \
|
||||
char *tmp_str = json_str; \
|
||||
char *keyPos = strstr(tmp_str, #key); \
|
||||
char *endPos = strstr(keyPos, "]"); \
|
||||
if(keyPos && keyPos < endPos) { \
|
||||
tmp_str = strstr(keyPos, "["); \
|
||||
valPos = tmp_str + 1; \
|
||||
for (int i = 0; i < size; i++) { \
|
||||
sscanf(valPos, "%u", &tmpVal); \
|
||||
data->key[i] = tmpVal; \
|
||||
if(strstr(valPos, ",") && strstr(valPos, ",") < endPos) { \
|
||||
valPos = strstr(valPos, ",") + 1; \
|
||||
} else { \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} else { \
|
||||
printf("not found keyword %s \n", #key); \
|
||||
} \
|
||||
} while(0);
|
||||
|
||||
|
||||
void JSON_CHECK_RANGE(char *name, int *value, int min, int max);
|
||||
void JSON_CHECK_RANGE_OF_32(char *name, long long *value, long long min, long long max);
|
||||
void JSON_CHECK_RANGE_OF_U64(char *name, unsigned long long *value, unsigned long long min, unsigned long long max);
|
||||
void JSON_CHECK_RANGE_OF_DOUBLE(char *name, double *value, double min, double max);
|
||||
void JSON_PRINT_ERR_NOT_EXIST(char *name);
|
||||
void JSON_PRINT_ERR_DATA_TYPE(char *name);
|
||||
void CVI_BOOL_JSON(int r_w_flag, JSON *j, char *key, CVI_BOOL *value);
|
||||
void CVI_U8_JSON(int r_w_flag, JSON *j, char *key, CVI_U8 *value);
|
||||
void CVI_S8_JSON(int r_w_flag, JSON *j, char *key, CVI_S8 *value);
|
||||
void CVI_U16_JSON(int r_w_flag, JSON *j, char *key, CVI_U16 *value);
|
||||
void CVI_S16_JSON(int r_w_flag, JSON *j, char *key, CVI_S16 *value);
|
||||
void CVI_U32_JSON(int r_w_flag, JSON *j, char *key, CVI_U32 *value);
|
||||
void CVI_S32_JSON(int r_w_flag, JSON *j, char *key, CVI_S32 *value);
|
||||
void CVI_U64_JSON(int r_w_flag, JSON *j, char *key, CVI_U64 *value);
|
||||
void CVI_FLOAT_JSON(int r_w_flag, JSON *j, char *key, CVI_FLOAT *value);
|
||||
|
||||
JSON *JSON_GetNewObject(void);
|
||||
JSON *JSON_TokenerParse(const char *buffer);
|
||||
CVI_S32 JSON_GetJsonStrLen(JSON *json_object);
|
||||
CVI_S32 JSON_ObjectPut(JSON *json_object);
|
||||
const char *JSON_GetJsonStrContent(JSON *json_object);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif // _CVI_JSON_STRUCT_COMM_H
|
||||
52
middleware/v2/include/isp/sg200x/isp_bin.h
Normal file
52
middleware/v2/include/isp/sg200x/isp_bin.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2021. All rights reserved.
|
||||
*
|
||||
* File Name: isp_bin.h
|
||||
* Description:
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ISP_BIN_H
|
||||
#define _ISP_BIN_H
|
||||
|
||||
#include <linux/cvi_common.h>
|
||||
#include "cvi_bin.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
CVI_S32 isp_json_getParamFromJsonbuffer(const char *buffer, enum CVI_BIN_SECTION_ID id);
|
||||
CVI_S32 isp_json_setParamToJsonbuffer(CVI_S8 **buffer, enum CVI_BIN_SECTION_ID id, CVI_S32 *len);
|
||||
CVI_S32 header_bin_getBinSize(CVI_U32 *binSize);
|
||||
CVI_S32 header_bin_getBinParam(CVI_U8 *addr, CVI_U32 binSize);
|
||||
CVI_S32 header_bin_GetHeaderDescInfo(CVI_CHAR *pOutDesc, enum CVI_BIN_CREATMODE inCreatMode);
|
||||
|
||||
CVI_S32 isp_bin_getBinSize_p0(CVI_U32 *binSize);
|
||||
CVI_S32 isp_bin_getBinSize_p1(CVI_U32 *binSize);
|
||||
CVI_S32 isp_bin_getBinSize_p2(CVI_U32 *binSize);
|
||||
CVI_S32 isp_bin_getBinSize_p3(CVI_U32 *binSize);
|
||||
CVI_S32 isp_bin_getBinParam_p0(CVI_U8 *addr, CVI_U32 binSize);
|
||||
CVI_S32 isp_bin_getBinParam_p1(CVI_U8 *addr, CVI_U32 binSize);
|
||||
CVI_S32 isp_bin_getBinParam_p2(CVI_U8 *addr, CVI_U32 binSize);
|
||||
CVI_S32 isp_bin_getBinParam_p3(CVI_U8 *addr, CVI_U32 binSize);
|
||||
CVI_S32 header_bin_setBinParam(FILE *fp);
|
||||
CVI_S32 isp_bin_setBinParam_p0(FILE *fp);
|
||||
CVI_S32 isp_bin_setBinParam_p1(FILE *fp);
|
||||
CVI_S32 isp_bin_setBinParam_p2(FILE *fp);
|
||||
CVI_S32 isp_bin_setBinParam_p3(FILE *fp);
|
||||
CVI_S32 header_bin_setBinParambuf(CVI_U8 *buffer);
|
||||
CVI_S32 isp_bin_setBinParambuf_p0(CVI_U8 *buffer);
|
||||
CVI_S32 isp_bin_setBinParambuf_p1(CVI_U8 *buffer);
|
||||
CVI_S32 isp_bin_setBinParambuf_p2(CVI_U8 *buffer);
|
||||
CVI_S32 isp_bin_setBinParambuf_p3(CVI_U8 *buffer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif // _ISP_BIN_H
|
||||
22
middleware/v2/include/mipi_tx.h
Normal file
22
middleware/v2/include/mipi_tx.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: mipi_tx.h
|
||||
* Description:
|
||||
*/
|
||||
|
||||
#ifndef __MIPI_TX_H__
|
||||
#define __MIPI_TX_H__
|
||||
|
||||
#include <linux/vo_mipi_tx.h>
|
||||
|
||||
int mipi_tx_cfg(int fd, struct combo_dev_cfg_s *dev_cfg);
|
||||
int mipi_tx_send_cmd(int fd, struct cmd_info_s *cmd_info);
|
||||
int mipi_tx_recv_cmd(int fd, struct get_cmd_info_s *cmd_info);
|
||||
int mipi_tx_enable(int fd);
|
||||
int mipi_tx_disable(int fd);
|
||||
int mipi_tx_set_hs_settle(int fd, const struct hs_settle_s *hs_cfg);
|
||||
int mipi_tx_get_hs_settle(int fd, struct hs_settle_s *hs_cfg);
|
||||
|
||||
#endif // __MIPI_TX_H__
|
||||
|
||||
140
middleware/v2/include/osd_cmpr.h
Normal file
140
middleware/v2/include/osd_cmpr.h
Normal file
@@ -0,0 +1,140 @@
|
||||
#ifndef __OSD_CMPR_H__
|
||||
#define __OSD_CMPR_H__
|
||||
#include <cstdlib>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
// DataType-free color field copy
|
||||
#define CPY_C(in, out) \
|
||||
{ \
|
||||
out.r = in.r; \
|
||||
out.g = in.g; \
|
||||
out.b = in.b; \
|
||||
out.a = in.a; \
|
||||
}
|
||||
|
||||
#define HDR_SZ (8)
|
||||
|
||||
enum OSD_FORMAT {
|
||||
OSD_ARGB8888 = 0,
|
||||
OSD_ARGB4444 = 4,
|
||||
OSD_ARGB1555 = 5,
|
||||
OSD_LUT8 = 8,
|
||||
OSD_LUT4 = 10,
|
||||
NUM_OF_FORMAT
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int img_width;
|
||||
int img_height;
|
||||
bool palette_mode_en;
|
||||
bool zeroize_by_alpha;
|
||||
int rgb_trunc_bit;
|
||||
int alpha_trunc_bit;
|
||||
int run_len_bd;
|
||||
int palette_idx_bd;
|
||||
OSD_FORMAT osd_format;
|
||||
bool hdr_en;
|
||||
} OSDCmpr_Cfg;
|
||||
|
||||
typedef struct {
|
||||
uint8_t *stream; // stream buffer pointer
|
||||
int bit_pos; // current pointer (in bit)
|
||||
int buf_size; // in byte
|
||||
int status;
|
||||
} StreamBuffer;
|
||||
|
||||
void init_stream(StreamBuffer *bs, const uint8_t *buf, int buf_size,
|
||||
bool read_only);
|
||||
void write_stream(StreamBuffer *bs, uint8_t *src, int bit_len);
|
||||
void parse_stream(StreamBuffer *bs, uint8_t *dest, int bit_len, bool read_only);
|
||||
void move_stream_ptr(StreamBuffer *bs, int bit_len);
|
||||
|
||||
uint8_t get_bit_val(uint8_t *buf, int byte_idx, int bit_idx);
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
uint8_t g;
|
||||
uint8_t b;
|
||||
uint8_t r;
|
||||
uint8_t a;
|
||||
};
|
||||
uint32_t code;
|
||||
} RGBA;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
uint16_t g : 4;
|
||||
uint16_t b : 4;
|
||||
uint16_t r : 4;
|
||||
uint16_t a : 4;
|
||||
};
|
||||
uint16_t code;
|
||||
} ARGB4444;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
uint16_t g : 5;
|
||||
uint16_t b : 5;
|
||||
uint16_t r : 5;
|
||||
uint16_t a : 1;
|
||||
};
|
||||
uint16_t code;
|
||||
} ARGB1555;
|
||||
|
||||
union CODE {
|
||||
RGBA color;
|
||||
int palette_idx;
|
||||
};
|
||||
|
||||
enum MODE_TYPE { Literal = 0, Palette, Literal_RL, Palette_RL, NUM_OF_MODE };
|
||||
|
||||
typedef struct {
|
||||
int reg_image_width;
|
||||
int reg_image_height;
|
||||
bool reg_zeroize_by_alpha;
|
||||
int reg_rgb_trunc_bit;
|
||||
int reg_alpha_trunc_bit;
|
||||
bool reg_palette_mode_en;
|
||||
int reg_run_len_bd;
|
||||
int reg_palette_idx_bd;
|
||||
OSD_FORMAT reg_osd_format;
|
||||
int pel_sz;
|
||||
vector<RGBA> palette_cache;
|
||||
int bs_buf_size;
|
||||
uint8_t *bsbuf; // intermediate bitstream buffer
|
||||
} OSDCmpr_Ctrl;
|
||||
|
||||
RGBA get_color(uint8_t *ptr, OSD_FORMAT format = OSD_ARGB8888);
|
||||
void set_color(uint8_t *ptr, RGBA color, OSD_FORMAT format = OSD_ARGB8888);
|
||||
|
||||
void osd_cmpr_frame_init(OSDCmpr_Ctrl *p_ctrl);
|
||||
int osd_cmpr_enc_one_frame(uint8_t *ibuf, uint8_t *obs, OSDCmpr_Ctrl *p_ctrl);
|
||||
void osd_cmpr_dec_one_frame(uint8_t *bsbuf, size_t bs_size, uint8_t *obuf,
|
||||
OSDCmpr_Ctrl *p_ctrl);
|
||||
void osd_cmpr_enc_header(uint8_t *hdrbuf, OSDCmpr_Ctrl *p_ctrl);
|
||||
void osd_cmpr_dec_header(uint8_t *hdrbuf, OSDCmpr_Ctrl *p_ctrl);
|
||||
|
||||
void osd_cmpr_setup(OSDCmpr_Ctrl *p_ctrl, OSDCmpr_Cfg *p_cfg);
|
||||
void osd_cmpr_enc_const_pixel(RGBA cur_c, RGBA &last_c, int &rl_cnt,
|
||||
MODE_TYPE &md, CODE &code, int &length,
|
||||
bool is_force_new_run, int max_run_len,
|
||||
OSDCmpr_Ctrl *p_ctrl, StreamBuffer *bitstream);
|
||||
void osd_cmpr_enc_followed_run(RGBA cur_c, int &rl_cnt, MODE_TYPE &md,
|
||||
CODE &code, int &length, int max_run_len,
|
||||
OSDCmpr_Ctrl *p_ctrl, StreamBuffer *bitstream);
|
||||
|
||||
size_t osd_cmpr_get_pixel_sz(OSD_FORMAT format);
|
||||
size_t osd_cmpr_get_bs_buf_max_sz(int pel_num, int pel_sz);
|
||||
size_t osd_cmpr_get_header_sz(void);
|
||||
|
||||
void osd_cmpr_debug_frame_compare(OSDCmpr_Ctrl *p_ctrl, uint8_t *buf0,
|
||||
uint8_t *buf1);
|
||||
|
||||
void palette_cache_init(vector<RGBA> &cache);
|
||||
int palette_cache_lookup_color(vector<RGBA> &cache, RGBA color);
|
||||
void palette_cache_lru_update(vector<RGBA> &cache, int index);
|
||||
void palette_cache_push_color(vector<RGBA> &cache, RGBA color);
|
||||
#endif /* __OSD_CMPR_H__ */
|
||||
108
middleware/v2/include/peri.h
Normal file
108
middleware/v2/include/peri.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Copyright (C) Cvitek Co., Ltd. 2019-2020. All rights reserved.
|
||||
*
|
||||
* File Name: include/peri.h
|
||||
* Description:
|
||||
* peripheral includes i2c for sns and reg for isp.
|
||||
*/
|
||||
|
||||
#ifndef __PERI_H__
|
||||
#define __PERI_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
/* This function must be called to initialize the I2C master interface on the respective hardware pins.
|
||||
*
|
||||
* @i2c_bus: id of the i2c bus
|
||||
* @slave_addr: slave addr of the i2c device
|
||||
*/
|
||||
int i2cInit(uint8_t i2c_bus, uint8_t slave_addr);
|
||||
|
||||
/* This function must be called to release resource.
|
||||
*
|
||||
*/
|
||||
void i2cExit(void);
|
||||
|
||||
/* I2C Read
|
||||
*
|
||||
* @addr: reg address
|
||||
* @addr_nbytes: number of bytes of reg address. 2 for 16-bit;1 for 8-bit address.
|
||||
* @buffer: Pointer to the buffer where the data bytes that are received will be written to
|
||||
* @nbytes: Number of bytes to receive
|
||||
*
|
||||
* @return: Zero on success
|
||||
*/
|
||||
int i2cRead(uint16_t addr, unsigned int addr_nbytes, uint8_t *buffer,
|
||||
unsigned int data_nbytes);
|
||||
|
||||
/* I2C Write
|
||||
*
|
||||
* @addr: reg address
|
||||
* @addr_nbytes: number of bytes of reg address. 2 for 16-bit;1 for 8-bit address.
|
||||
* @buffer: Pointer to the buffer that holds data bytes to send
|
||||
* @nbytes: Number of bytes to send
|
||||
*
|
||||
* @return: Zero on success
|
||||
*/
|
||||
int i2cWrite(uint16_t addr, unsigned int addr_nbytes, uint8_t *buffer,
|
||||
unsigned int data_nbytes);
|
||||
|
||||
/* This function must be called to initialize the reg access.
|
||||
*
|
||||
*/
|
||||
int regInit(void);
|
||||
|
||||
/* This function must be called to release resource.
|
||||
*
|
||||
*/
|
||||
int regExit(void);
|
||||
|
||||
/* REG Read
|
||||
*
|
||||
* @addr: reg address(32bit)
|
||||
*
|
||||
* @return: Zero on success
|
||||
*/
|
||||
uint32_t regRead(uint32_t addr);
|
||||
|
||||
/* REG Write
|
||||
*
|
||||
* @addr: reg address(32bit)
|
||||
* @data: data to be writen.
|
||||
*
|
||||
*/
|
||||
void regWrite(uint32_t addr, uint32_t data);
|
||||
|
||||
/* REG Write with mask
|
||||
*
|
||||
* @addr: reg address(32bit)
|
||||
* @data: data to be writen.
|
||||
* @mask: only masked bits will be updated.
|
||||
*
|
||||
*/
|
||||
void regWriteMask(uint32_t addr, uint32_t data, uint32_t mask);
|
||||
|
||||
/* REG Read
|
||||
*
|
||||
* @addr: reg address(32bit)
|
||||
* @buffer: Pointer to the buffer where the data bytes that are received will be written to
|
||||
* @ndws: Number of DWORDs to receive
|
||||
*
|
||||
*/
|
||||
void regReadBurst(uint32_t addr, uint32_t *buffer, unsigned int ndws);
|
||||
|
||||
/* REG Write
|
||||
*
|
||||
* @addr: reg address(32bit)
|
||||
* @buffer: Pointer to the buffer that holds data bytes to send
|
||||
* @ndws: Number of DWORDs to send
|
||||
*
|
||||
*/
|
||||
void regWriteBurst(uint32_t addr, uint32_t *buffer, unsigned int ndws);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
#endif /*__PERI_H__ */
|
||||
89
middleware/v2/include/rtos_cmdqu.h
Normal file
89
middleware/v2/include/rtos_cmdqu.h
Normal file
@@ -0,0 +1,89 @@
|
||||
#ifndef __RTOS_COMMAND_QUEUE__
|
||||
#define __RTOS_COMMAND_QUEUE__
|
||||
|
||||
#ifdef __linux__
|
||||
#include <linux/kernel.h>
|
||||
#endif
|
||||
|
||||
#define NR_SYSTEM_CMD 20
|
||||
#define NR_RTOS_CMD 127
|
||||
#define NR_RTOS_IP IP_LIMIT
|
||||
|
||||
enum IP_TYPE {
|
||||
IP_ISP = 0,
|
||||
IP_VCODEC,
|
||||
IP_VIP,
|
||||
IP_VI,
|
||||
IP_RGN,
|
||||
IP_AUDIO,
|
||||
IP_SYSTEM,
|
||||
IP_CAMERA,
|
||||
IP_LIMIT,
|
||||
};
|
||||
|
||||
enum SYS_CMD_ID {
|
||||
SYS_CMD_INFO_TRANS = 0x50,
|
||||
SYS_CMD_INFO_LINUX_INIT_DONE,
|
||||
SYS_CMD_INFO_RTOS_INIT_DONE,
|
||||
SYS_CMD_INFO_STOP_ISR,
|
||||
SYS_CMD_INFO_STOP_ISR_DONE,
|
||||
SYS_CMD_INFO_LINUX,
|
||||
SYS_CMD_INFO_RTOS,
|
||||
SYS_CMD_SYNC_TIME,
|
||||
SYS_CMD_INFO_DUMP_MSG,
|
||||
SYS_CMD_INFO_DUMP_EN,
|
||||
SYS_CMD_INFO_DUMP_DIS,
|
||||
SYS_CMD_INFO_TRACE_SNAPSHOT_START,
|
||||
SYS_CMD_INFO_TRACE_SNAPSHOT_STOP,
|
||||
SYS_CMD_INFO_TRACE_STREAM_START,
|
||||
SYS_CMD_INFO_TRACE_STREAM_STOP,
|
||||
SYS_CMD_INFO_LIMIT,
|
||||
};
|
||||
|
||||
struct valid_t {
|
||||
unsigned char linux_valid;
|
||||
unsigned char rtos_valid;
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef union resv_t {
|
||||
struct valid_t valid;
|
||||
unsigned short mstime; // 0 : noblock, -1 : block infinite
|
||||
} resv_t;
|
||||
|
||||
typedef struct cmdqu_t cmdqu_t;
|
||||
/* cmdqu size should be 8 bytes because of mailbox buffer size */
|
||||
struct cmdqu_t {
|
||||
unsigned char ip_id;
|
||||
unsigned char cmd_id : 7;
|
||||
unsigned char block : 1;
|
||||
union resv_t resv;
|
||||
unsigned int param_ptr;
|
||||
} __attribute__((packed)) __attribute__((aligned(0x8)));
|
||||
|
||||
#ifdef __linux__
|
||||
/* keep those commands for ioctl system used */
|
||||
enum SYSTEM_CMD_TYPE {
|
||||
CMDQU_SEND = 1,
|
||||
CMDQU_REQUEST,
|
||||
CMDQU_REQUEST_FREE,
|
||||
CMDQU_SEND_WAIT,
|
||||
CMDQU_SEND_WAKEUP,
|
||||
CMDQU_SYSTEM_LIMIT = NR_SYSTEM_CMD,
|
||||
};
|
||||
|
||||
#define RTOS_CMDQU_DEV_NAME "cvi-rtos-cmdqu"
|
||||
#define RTOS_CMDQU_SEND _IOW('r', CMDQU_SEND, unsigned long)
|
||||
#define RTOS_CMDQU_REQUEST _IOW('r', CMDQU_REQUEST, unsigned long)
|
||||
#define RTOS_CMDQU_REQUEST_FREE _IOW('r', CMDQU_REQUEST_FREE, unsigned long)
|
||||
#define RTOS_CMDQU_SEND_WAIT _IOW('r', CMDQU_SEND_WAIT, unsigned long)
|
||||
#define RTOS_CMDQU_SEND_WAKEUP _IOW('r', CMDQU_SEND_WAKEUP, unsigned long)
|
||||
|
||||
int rtos_cmdqu_send(cmdqu_t *cmdq);
|
||||
int rtos_cmdqu_send_wait(cmdqu_t *cmdq, int wait_cmd_id);
|
||||
int request_rtos_irq(unsigned char ip_id, void *handler, const char *devname, void *dev_id);
|
||||
int free_rtos_irq(unsigned char ip_id);
|
||||
|
||||
#endif // end of __linux__
|
||||
|
||||
#endif // end of __RTOS_COMMAND_QUEUE__
|
||||
|
||||
Reference in New Issue
Block a user