hi_mpi_sys_set_chn_csc_matrix
The
The
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:
- hi_mpi_sys_set_chn_csc_matrix (first CSC parameter modification)
- hi_mpi_vpc_crop (cropping)
- hi_mpi_vpc_get_process_result (waiting for the cropping task to complete)
- hi_mpi_sys_set_chn_csc_matrix (second CSC parameter modification)
- hi_mpi_vpc_resize (resizing)
- 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
- 0: success
- Other values: failure. For details, see Common Return Codes.