Updated on 2022-03-13 GMT+08:00

VPC Parameters

Input Parameter: VpcUserImageConfigure

Table 1 Input parameter VpcUserImageConfigure

Member Variable

Description

Value Range

uint8_t* bareDataAddr

Address of an uncompressed input image. If the input image is compressed, this parameter does not need to be set and the default value is null.

You are advised to allocate the buffer by calling HIAI_DVPP_DMalloc provided by Matrix. The allocated buffer must meet the DVPP requirements, that is, the buffer addresses of the input and output images must be in the same 4 GB space, and the start addresses must be 16-pixel aligned. For details about HIAI_DVPP_DMalloc, see Matrix API Reference.

-

uint32_t bareDataBufferSize

Buffer size of an uncompressed input image. The buffer size is calculated based on the width stride and height stride of the image. The buffer size pointed by bareDataAddr must be the same as the value of bareDataBufferSize. When the input image is not compressed, this parameter does not need to be set and the default value is 0.

For the uncompressed format, the buffer size is calculated as follows based on the image format:

  • YUV400SP and YUV420SP: widthStride x heightStride x 3/2
  • YUV422SP: widthStride x heightStride x 2
  • YUV444SP: widthStride x heightStride x 3
  • YUV422 packed: widthStride x heightStride
  • YUV444 packed and RGB888: widthStride x heightStride
  • XRGB8888: widthStride x heightStride

uint32_t widthStride

Width stride of the image

The minimum width stride is 32, and the maximum width stride is 4096 x 4 (the image width is 4096 and the image format is ARGB).

For 8K image resizing, the width stride must be 2-pixel aligned. For non-8K image resizing, the formula for calculating widthStride varies according to the image format.

  • YUV400SP, YUV420SP, YUV422SP, and YUV444SP: Align the width of the input image to a 16-pixel boundary.
  • YUV422 packed: Align the width of the input image to a 16-pixel boundary and multiply the result by 2 (the width is 16-pixel aligned and each pixel occupies 2 bytes).
  • YUV444 packed and RGB888: Align the width of the input image to a 16-pixel boundary and multiply the result by 3 (the width is 16-pixel aligned and each pixel occupies 3 bytes).
  • XRGB8888: Align the width of the input image to a 16-pixel boundary and multiply the result by 4 (the width is 16-pixel aligned and each pixel occupies 4 bytes).
  • HFBC format: The wide stride equals the width of the input image.

uint32_t heightStride

Height stride. You can calculate the UV data start addresses of YUV SP images based on this parameter.

Value: The height of the input image must be 2-pixel aligned. The minimum height stride is 6, and the maximum height stride is 4096.

enum VpcInputFormat inputFormat

Input image format

enum VpcInputFormat {

INPUT_YUV400, // 0

INPUT_YUV420_SEMI_PLANNER_UV, // 1

INPUT_YUV420_SEMI_PLANNER_VU, // 2

INPUT_YUV422_SEMI_PLANNER_UV, // 3

INPUT_YUV422_SEMI_PLANNER_VU, // 4

INPUT_YUV444_SEMI_PLANNER_UV, // 5

INPUT_YUV444_SEMI_PLANNER_VU, // 6

INPUT_YUV422_PACKED_YUYV, // 7

INPUT_YUV422_PACKED_UYVY, // 8

INPUT_YUV422_PACKED_YVYU, // 9

INPUT_YUV422_PACKED_VYUY, // 10

INPUT_YUV444_PACKED_YUV, // 11

INPUT_RGB, // 12, input image format: RGB888

INPUT_BGR, // 13, input image format: BGR888

INPUT_ARGB, // 14. The component sequence of an input image in this format during storage is similar to RGB888. A indicates transparency.

INPUT_ABGR, // 15. The component sequence of an input image in this format during storage is similar to BGR888. A indicates transparency.

INPUT_RGBA, // 16. The component sequence of an input image in this format during storage is similar to RGB888. A indicates transparency.

INPUT_BGRA, // 17. The component sequence of an input image in this format during storage is similar to BGR888. A indicates transparency.

INPUT_YUV420_SEMI_PLANNER_UV_10BIT, // 18

INPUT_YUV420_SEMI_PLANNER_VU_10BIT, // 19

};

enum VpcOutputFormat outputFormat

Output image format

enum VpcOutputFormat {

OUTPUT_YUV420SP_UV,

OUTPUT_YUV420SP_VU

};

VpcUserRoiConfigure* roiConfigure

Cropped area configuration. For details, see VpcUserRoiConfigure structure.

-

bool isCompressData

Whether the HFBC compressed image format of the VDEC output is used

When the image comes from the VDEC, set this parameter to true. For other image formats, set this parameter to false. The default value is false.

The HFBC compression format supports single-image cropping/resizing and single-image multi-ROI cropping/resizing.

VpcCompressDataConfigure compressDataConfigure

Data configuration of the HFBC compressed image output by the VDEC. For details, see VpcCompressDataConfigure structure.

-

bool yuvSumEnable

Whether to calculate the yuvSum value. Calculation of the yuvSum value supports only the single-image single-ROI mode.

When the yuvSum value needs to be calculated, set this parameter to true. Otherwise, set this parameter to false. The default value is false.

The restrictions for calculating the yuvSum value are as follows:

1. The input image resolution is less than or equal to 4096 x 4096.

2. The start point of the overwritten area is (0, 0).

3. The input is a single image with a single ROI.

VpcUserYuvSum yuvSum

yuvSum calculation configuration. For details, see VpcUserYuvSum structure.

-

VpcUserPerformanceTuningParameter tuningParameter

Reserved. This parameter is used for parameter tuning. For details, see VpcUserPerformanceTunin....

-

uint32_t* cmdListBufferAddr

Reserved

-

uint32_t cmdListBufferSize

Reserved

-

uint64_t yuvScalerParaSetAddr

Reserved. This parameter indicates the file path and file name array of the filtering parameter set.

NOTE:
  • The parameter set must be on the device.
  • Ensure that the input file path is correct.

A parameter set file path consists of an absolute file path on the device side and the file name, for example, {"/root/share/vpc/YUVScaler_pra.h"}.

uint16_t yuvScalerParaSetSize

Reserved. This parameter indicates the number of elements in the parameter set array to which the parameter set address points. The default value is 1.

1 ≤ yuvscaler_paraset_size ≤ 10

uint16_t yuvScalerParaSetIndex

Reserved. This parameter indicates the index of yuvScalerParaSetAddr corresponding to yuvScalerParaSetIndex (The default value is 0.)

0≤ yuvScalerParaSetIndex < 10

uint8_t isUseMultiCoreAccelerate

Reserved

-

uint8_t reserve1

Reserved

-

uint16_t reserve2;

Reserved

-

Output Parameters

None