hi_mpi_sys_set_chn_csc_matrix

The Atlas 200/300/500 Inference Product does not support this API.

The Atlas Training Series Product does not support this API.

Description

Sets the CSC parameters after the corresponding image or video processing channel is created if the CSC parameters need to be adjusted in the conversion between YUV and RGB before images or videos are processed.

Restrictions

If this API is not called to set CSC parameters, the CSC matrix parameters following the BT.601 Wide standard are used by default.

If the default CSC parameters are not applicable, they need to be modified only once for all other tasks in the channel. You can call this API to set CSC parameters after the corresponding image or video processing channel is created. After that, call the specific image or video processing API, and then call the API that obtains the image or video processing result.

If the default CSC parameters are not applicable and different CSC parameters are used for different tasks, modify the parameters for multiple times after the corresponding image or video processing channel is created, after the previous task is complete, and before the next task is executed. (If this API is called again before the previous task is complete, the task processing result may be incorrect.) After that, call the specific image or video processing API, and then call the API that obtains the image or video processing result.

The call sequence is as follows:

  1. hi_mpi_sys_set_chn_csc_matrix (first CSC parameter modification)
  2. hi_mpi_vpc_crop (cropping)
  3. hi_mpi_vpc_get_process_result (waiting for the cropping task to complete)
  4. hi_mpi_sys_set_chn_csc_matrix (second CSC parameter modification)
  5. hi_mpi_vpc_resize (resizing)
  6. hi_mpi_vpc_get_process_result (waiting for the resizing task to complete)

Prototype

hi_s32 hi_mpi_sys_set_chn_csc_matrix(hi_mod_id mode, hi_s32 chn, hi_csc_matrix csc_matrix, hi_csc_coefficient *csc_coefficient)

Parameters

Parameter

Input/Output

Description

mode

Input

Module ID, either HI_ID_VDEC or HI_ID_VPC.

chn

Input

Channel ID. For the channel ID range, see the chn value range in hi_mpi_vdec_create_chn when mode is set to HI_ID_VDEC or in hi_mpi_vpc_create_chn when mode is set to HI_ID_VPC.

csc_matrix

Input

Data standard of the CSC matrix.

csc_coefficient

Input

Pointer to the CSC matrix parameters.

CSC matrix parameters when csc_matrix is set to HI_CSC_MATRIX_USER. Ignored when csc_matrix is set to other values.

Returns