6.4. Data Types

The data types of VPSS module are defined as follows:

6.4.1. VPSS_IP_NUM

【Description】

Define the number of VPSS IP.

【Syntax】

#define VPSS_IP_NUM 2

【Note】

None.

【Related Data Type and Interface】

None.

6.4.2. VPSS_MAX_GRP_NUM

【Description】

Define the maximum number of VPSS GROUP.

【Syntax】

#define VPSS_MAX_GRP_NUM 16

【Note】

None.

【Related Data Type and Interface】

None.

6.4.3. VPSS_ONLINE_NUM

【Description】

Define the maximum number of VPSS ONLINE GROUP.

【Syntax】

#define VPSS_ONLINE_NUM 5

【Note】

None.

【Related Data Type and Interface】

None.

6.4.4. VPSS_ONLINE_GRP_0

【Description】

Define VPSS ONLINE GROUP 0.

【Syntax】

#define VPSS_ONLINE_GRP_0 0

【Note】

None.

【Related Data Type and Interface】

None.

6.4.5. VPSS_ONLINE_GRP_1

【Description】

Define VPSS ONLINE GROUP 1.

【Syntax】

#define VPSS_ONLINE_GRP_1 1

【Note】

None.

【Related Data Type and Interface】

None.

6.4.6. VPSS_MAX_CHN_NUM

【Description】

Define the maximum number of VPSS channels.

【Syntax】

#define VPSS_MAX_CHN_NUM  VPSS_MAX_PHY_CHN_NUM

【Note】

The maximum number of VPSS channels is the number of physical channels.

【Related Data Type and Interface】

None.

6.4.7. VPSS_MAX_PHY_CHN_NUM

【Description】

Define the maximum number of VPSS physical channels.

【Syntax】

// cv181x
#define VPSS_MAX_PHY_CHN_NUM     4
// cv180x
#define VPSS_MAX_PHY_CHN_NUM     3

【Note】

None.

【Related Data Type and Interface】

None.

6.4.8. SC_D_MAX_LIMIT

【Description】

Define the maximum width of VPSS sc_d.

【Syntax】

// cv181x
#define SC_D_MAX_LIMIT     1920
// cv180x
#define SC_D_MAX_LIMIT     1280

【Note】

None.

【Related Data Type and Interface】

None.

6.4.9. SC_V1_MAX_LIMIT

【Description】

Define the maximum width of VPSS sc_v1.

【Syntax】

// cv181x
#define SC_V1_MAX_LIMIT     2880
// cv180x
#define SC_V1_MAX_LIMIT     2880

【Note】

None.

【Related Data Type and Interface】

None.

6.4.10. SC_V2_MAX_LIMIT

【Description】

Define the maximum width of VPSS sc_v2.

【Syntax】

// cv181x
#define SC_V2_MAX_LIMIT     1920
// cv180x
#define SC_V2_MAX_LIMIT     1920

【Note】

None.

【Related Data Type and Interface】

None.

6.4.11. SC_V3_MAX_LIMIT

【Description】

Define the maximum width of VPSS sc_v3.

【Syntax】

// cv181x
#define SC_V3_MAX_LIMIT     1280

【Note】

cv180x does not have sc_v3.

【Related Data Type and Interface】

None.

6.4.12. VPSS_MIN_IMAGE_WIDTH

【Description】

Define the minimum width of the VPSS image.

【Syntax】

#define VPSS_MIN_IMAGE_WIDTH 32

【Note】

None.

【Related Data Type and Interface】

None.

6.4.13. VPSS_MIN_IMAGE_HEIGHT

【Description】

Define the minimum height of the VPSS image.

【Syntax】

#define VPSS_MIN_IMAGE_HEIGHT 32

【Note】

None.

【Related Data Type and Interface】

None.

6.4.14. VPSS_MAX_IMAGE_WIDTH

【Description】

Define the maximum width of the VPSS image.

【Syntax】

#define VPSS_MAX_IMAGE_WIDTH 2880

【Note】

None.

【Related Data Type and Interface】

None.

6.4.15. VPSS_MAX_IMAGE_HEIGHT

【Description】

Define the maximum height of the VPSS image.

【Syntax】

#define VPSS_MAX_IMAGE_HEIGHT 4096

【Note】

None.

【Related Data Type and Interface】

None.

6.4.16. VPSS_MAX_ZOOMIN

【Description】

Definition of the maximum zoom-in factor of VPSS physical channels.

【Syntax】

#define VPSS_MAX_ZOOMIN                 32

【Note】

None.

【Related Data Type and Interface】

None.

6.4.17. VPSS_MAX_ZOOMOUT

【Description】

Definition of the maximum zoom-out factor of VPSS physical channels.

【Syntax】

#define VPSS_MAX_ZOOMOUT                32

【Note】

None.

【Related Data Type and Interface】

None.

6.4.18. VPSS_GRP

【Description】

Define VPSS group number.

【Syntax】

typedef CVI_U32 VPSS_GRP;

【Note】

None.

【Related Data Type and Interface】

None.

6.4.19. VPSS_CHN

【Description】

Define the VPSS channel number.

【Syntax】

typedef CVI_U32 VPSS_CHN;

【Note】

None.

【Related Data Type and Interface】

None.

6.4.20. VPSS_ROUNDING_E

【Description】

Define the pattern of rounding mode during Normalize.

【Syntax】

 typedef enum _VPSS_ROUNDING_E {
  VPSS_ROUNDING_TO_EVEN = 0,
  VPSS_ROUNDING_AWAY_FROM_ZERO,
  VPSS_ROUNDING_TRUNCATE,
  VPSS_ROUNDING_MAX,
} VPSS_ROUNDING_E;

【Member】

Member

Description

VPSS_ROUNDING_TO_EVEN

Round off, refer to the table below.

VPSS_ROUNDING_AWAY_FROM_ZERO

Round off, refer to the table below.

VPSS_ROUNDING_TRUNCATE

Unconditional rounding, see table below.

【Note】

TO_EVEN

AWAY_FROM_ZERO

TRUNCATE

+1.8

+2

+2

+1

+1.5

+1.2

+1

+1

+0.8

0

+0.5

0

+0.2

0

−0.2

−0.5

−1

−0.8

−1

−1.2

−1

−1.5

−2

−2

−1.8

【Related Data Type and Interface】

6.4.21. VPSS_CROP_COORDINATE_E

【Description】

Define the start point coordinate mode of CROP.

【Syntax】

 typedef enum _VPSS_CROP_COORDINATE_E
{
  VPSS_CROP_RATIO_COOR = 0,
  VPSS_CROP_ABS_COOR
}VPSS_CROP_COORDINATE_E;

【Member】

Member

Description

VPSS_CROP_RATIO_COOR

Relative coordinates.

VPSS_CROP_ABS_COOR

Absolute coordinates.

【Note】

VPSS_CROP_RATIO_COOR not supported currently.

【Related Data Type and Interface】

6.4.22. VPSS_NORMALIZE_S

【Description】

Define the information required for Normalize function.

【Syntax】

 typedef struct _VPSS_NORMALIZE_S {
  CVI_BOOL bEnable;
  CVI_FLOAT factor[3];
  CVI_FLOAT mean[3];
  VPSS_ROUNDING_E rounding;
} VPSS_NORMALIZE_S;

【Member】

Member

Description

bEnable

Normalize enable switch.

factor

Normalization factor.

1/8192 ~ 8191/8192

or

1/4096 ~ 8191/4096

mean

Normalized root mean square difference.

0 ~ 255

rounding

Method to deal with the decimal part.

【Note】

  1. After Normalize is enabled, the Output is int8, -128 ~ 127

  2. Normalize is equivalent to convertTo() function in OpenCV

    cv::convertTo(image, CV_8S, factor, -mean)
  3. According to the format of VPSS CHN, the results will be different.

    If the format is PIXEL_FORMAT_RGB_888_PLANAR or PIXEL_FORMAT_RGB_888, the operation modes are as follows:

    • (Pixel Value R) * factor[0] – mean[0] and then rounding。

    • (Pixel Value G) * factor[1] – mean[1] and then rounding。

    • (Pixel Value B) * factor[2] – mean[2] and then rounding。

If the format is PIXEL_FORMAT_BGR_888, the operation modes are as follows:

  • (Pixel Value B) * factor[0] – mean[0] and then rounding。

  • (Pixel Value G) * factor[1] – mean[1] and then rounding。

  • (Pixel Value R) * factor[2] – mean[2] and then rounding。

【Related Data Type and Interface】

6.4.23. VPSS_CROP_INFO_S

【Description】

Define the information required for the CROP function.

【Syntax】

 typedef struct _VPSS_CROP_INFO_S {
  CVI_BOOL bEnable;
  VPSS_CROP_COORDINATE_E enCropCoordinate;
  RECT_S stCropRect;
} VPSS_CROP_INFO_S;

【Member】

Member

Description

bEnable

CROP enable switch.

enCropCoordinate

CROP start point coordinate mode

stCropRect

The rectangular area of CROP.

【Note】

None.

【Related Data Type and Interface】

6.4.24. VPSS_GRP_ATTR_S

【Description】

Define the VPSS GROUP attribute.

【Syntax】

 typedef struct _VPSS_GRP_ATTR_S {
  CVI_U32 u32MaxW;
  CVI_U32 u32MaxH;
  PIXEL_FORMAT_E enPixelFormat;
  FRAME_RATE_CTRL_S stFrameRate;
  CVI_U8 u8VpssDev;
} VPSS_GRP_ATTR_S;

【Member】

Member

Description

u32MaxW

The input image width.

u32MaxH

The input image height.

enPixelFormat

The input image pixel format.

stFrameRate

Group frame rate.

u8VpssDev

Specify which hardware this VPSS group will work with.

【Note】

The parameter u8VpssDev should be set to 0 or 1 after setting the VPSS_MODE_DUAL or VPSS_MODE_RGNEX in CVI_SYS_SetVPSSMode to specify different hardware devices.

【Related Data Type and Interface】

  • PIXEL_FORMAT_E

  • CVI_VPSS_CreateGrp

  • CVI_VPSS_SetGrpAttr

  • CVI_VPSS_GetGrpAttr

6.4.25. VPSS_CHN_ATTR_S

【Description】

Define VPSS physical channel properties.

【Syntax】

 typedef struct _VPSS_CHN_ATTR_S {
  CVI_U32 u32Width;
  CVI_U32 u32Height;
  VIDEO_FORMAT_E enVideoFormat;
  PIXEL_FORMAT_E enPixelFormat;
  FRAME_RATE_CTRL_S stFrameRate;
  CVI_BOOL bMirror;
  CVI_BOOL bFlip;
  CVI_U32 u32Depth;
  ASPECT_RATIO_S stAspectRatio;
  VPSS_NORMALIZE_S stNormalize;
} VPSS_CHN_ATTR_S;

【Member】

Member

Description

u32Width

Target image width

u32Height

Target image height

enVideoFormat

Target image video format.

enPixelFormat

Target image pixel format

stFrameRate

Frame rate control information, proportional control of frame rate only when s32DstFrameRate is less than s32SrcFrameRate. For example, if s32SrcFrameRate is 60 and s32DstFrameRate is 30, then every other frame is lost.

bMirror

Horizontal mirroring enable.

bFlip

Vertical flipping enable.

u32Depth

Get the queue length for obtaining channel images. This is a static property.

stAspectRatio

Amplitude shape ratio parameter.

stNormalize

Performing normalization to accelerate subsequent TPU operation.

【Note】

None.

【Related Data Type and Interface】

  • CVI_VPSS_SetChnAttr

6.4.26. VPSS_MOD_PARAM_S

【Description】

Set the module parameters through the interface.

【Syntax】

 typedef struct _VPSS_PARAM_MOD_S {
  CVI_U32 u32VpssVbSource;
  CVI_U32 u32VpssSplitNodeNum;
} VPSS_MOD_PARAM_S;

【Member】

Member

Description

u32VpssVbSource

Video memory block pool type.

u32VpssSplitNodeNum

Number of block nodes.

【Note】

This structure attribute is not used in the current version.

【Related Data Type and Interface】

6.4.27. PROC_AMP_E

【Description】

Define the VPSS PROCAMP category.

【Syntax】

 typedef enum _PROC_AMP_E {
  PROC_AMP_BRIGHTNESS = 0,
  PROC_AMP_CONTRAST,
  PROC_AMP_SATURATION,
  PROC_AMP_HUE,
  PROC_AMP_MAX,
} PROC_AMP_E;

【Member】

Member

Description

PROC_AMP_BRIGHTNESS

Brightness value.

PROC_AMP_CONTRAST

Contrast value.

PROC_AMP_SATURATION

Saturation value.

PROC_AMP_HUE

HUE value.

【Note】

【Related Data Type and Interface】

6.4.28. PROC_AMP_CTRL_S

【Description】

Define the VPSS PROCAMP property.

【Syntax】

 typedef struct _PROC_AMP_CTRL_S {
  CVI_S32 minimum;
  CVI_S32 maximum;
  CVI_S32 step;
  CVI_S32 default_value;
} PROC_AMP_CTRL_S;

【Member】

Member

Description

minimum

The minimum value of this color control function.

maximum

The maximum value of this color control function.

step

The effective adjustment value of this color control function.

default_value

The default value of this color control function.

【Note】

It is recommended to obtain these attributes before starting the operation on VPSS ProcAmp to avoid the operation failure.

【Related Data Type and Interface】

  • PROC_AMP_E

  • CVI_VPSS_GetGrpProcAmpCtrl

6.4.29. vpss_proc_amp_cfg

【Description】

Record ISP bindata secne.

【Syntax】

 struct vpss_proc_amp_cfg {
  CVI_S32 proc_amp[PROC_AMP_MAX];
  VPSS_GRP VpssGrp;
  CVI_U8 scene;
};

【Member】

Member

Description

proc_amp

color control function.

VpssGrp

VPSS GROUP Number

scene

the settings stored in bin to use

【Note】

None.

【Related Data Type and Interface】

  • CVI_VPSS_SetGrpParamfromBin

6.4.30. vpss_all_proc_amp_cfg

【Description】

Define the VPSS all group ctrl info.

【Syntax】

 struct vpss_all_proc_amp_cfg {
  CVI_S32 proc_amp[VPSS_MAX_GRP_NUM][PROC_AMP_MAX];
};

【Member】

Member

Description

proc_amp

color control function of vpss group.

【Note】

None.

【Related Data Type and Interface】

  • CVI_VPSS_GetAllProcAmp

6.4.31. VPSS_LDC_ATTR_S

【Description】

Define the VPSS lens distortion correction structure.

【Syntax】

 typedef struct _VPSS_LDC_ATTR_S {
  CVI_BOOL bEnable;
  LDC_ATTR_S stAttr;
} VPSS_LDC_ATTR_S;

【Member】

Member

Description

bEnable

LDC enable

stAttr

LDC configuration parameters

【Note】

None.

【Related Data Type and Interface】

  • LDC_ATTR_S

  • CVI_VI_GetChnLDCAttr

  • CVI_VI_SetChnLDCAttr

6.4.32. VPSS_CHN_BUF_WRAP_S

【Description】

Definition of VPSS buffer wrap property.

【Syntax】

typedef struct _VPSS_CHN_BUF_WRAP_S {
   CVI_BOOL bEnable;
   CVI_U32 u32BufLine;   // 64, 128
   CVI_U32 u32WrapBufferSize;
} VPSS_CHN_BUF_WRAP_S;

【Member】

Member

Description

bEnable

switch for enable chn buffer wrap.

u32BufLine

wrap buffer row height.

u32WrapBufferSize

wrap buffer size.

【Note】

  • u32BufLine needs to be smaller than the height of the output image.

  • u32BufLine only comes in two sizes: 64/128.

  • When enabling wrap, u32WrapBufferSize must be greater than 0, and its calculation can refer to the function CVI_VPSS_GetWrapBufferSize.

【Related Data Type and Interface】

  • CVI_VPSS_SetChnScaleCoefLevel

  • CVI_VPSS_GetChnScaleCoefLevel

6.4.33. VPSS_SCALE_COEF_E

【Description】

Define VPSS image scaling algorithm.

【Syntax】

typedef enum _VPSS_SCALE_COEF_E {
   VPSS_SCALE_COEF_BICUBIC = 0,
   VPSS_SCALE_COEF_BILINEAR,
   VPSS_SCALE_COEF_NEAREST,
   VPSS_SCALE_COEF_DOWNSCALE_SMOOTH,
   VPSS_SCALE_COEF_OPENCV_BILINEAR,
   VPSS_SCALE_COEF_MAX,
 } VPSS_SCALE_COEF_E;

【Member】

Member

Description

VPSS_SCALE_COEF_BICUBIC

bicubic algorithm.

VPSS_SCALE_COEF_BILINEAR

bilinear algorithm.

VPSS_SCALE_COEF_NEAREST

nearest algorithm.

VPSS_SCALE_COEF_DOWNSCALE_SMOOTH

downscale algorithm.

VPSS_SCALE_COEF_OPENCV_BILINEAR

opencv bilinear algorithm.

【Note】

None.

【Related Data Type and Interface】

  • CVI_VPSS_SetChnScaleCoefLevel

  • CVI_VPSS_GetChnScaleCoefLevel

6.4.34. CVI_STITCH_SRC_S

【Description】

Define VPSS stitch src info.

【Syntax】

typedef struct _CVI_STITCH_SRC_S {
   VPSS_GRP VpssGrp;
   VPSS_CHN VpssChn;
 } CVI_STITCH_SRC_S;

【Member】

Member

Description

VpssGrp

VPSS Group Number.

VpssChn

VPSS Channel Number.

【Note】

None.

【Related Data Type and Interface】

6.4.35. CVI_STITCH_CHN_S

【Description】

Define VPSS stitch chn property.

【Syntax】

typedef struct _CVI_STITCH_CHN_S {
   CVI_STITCH_SRC_S stStitchSrc;
   RECT_S stDstRect;
   CVI_U8 u8Priority;
 } CVI_STITCH_CHN_S;

【Member】

Member

Description

stStitchSrc

VPSS stitch src info.

stDstRect

VPSS stitch dest position.

u8Priority

Priority.

【Note】

None.

【Related Data Type and Interface】

6.4.36. CVI_STITCH_ATTR_S

【Description】

Define VPSS stitch property.

【Syntax】

typedef struct _CVI_STITCH_ATTR_S {
   CVI_U8 u8ChnNum;
   CVI_U8 VoChn;
   CVI_S32 s32OutFps;
   PIXEL_FORMAT_E enOutPixelFormat;
   SIZE_S stOutSize;
   VB_POOL hVbPool;
   CVI_STITCH_CHN_S astStitchChn[CVI_STITCH_CHN_MAX_NUM];
 } CVI_STITCH_ATTR_S;

【Member】

Member

Description

u8ChnNum

the number of vpss stitch chn.

VoChn

Vo chn id.

s32OutFps

Output FPS.

enOutPixelFormat

image pixel format.

stOutSize

Output size.

hVbPool

Attached vb pool.

astStitchChn

vpss stitch chn attr.

【Note】

None.

【Related Data Type and Interface】