hi_mpi_sys_set_chn_csc_matrix
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
☓ |
Function 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. If this API is not called to set CSC parameters, the CSC matrix parameters complying with the BT.601 wide standard are used by default.
If the default CSC parameters are not applicable, the sequence of calling related APIs varies according to the modification method.
- 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 (Modifying CSC Parameters for the First Time)
- hi_mpi_vpc_crop (Image Cropping)
- hi_mpi_vpc_get_process_result (Waiting for the End of the Image Cropping Task)
- hi_mpi_sys_set_chn_csc_matrix (Modifying CSC Parameters for the Second Time)
- hi_mpi_vpc_resize (Scaling)
- hi_mpi_vpc_get_process_result (Waiting for the Scaling Task to End)
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. Currently, only HI_ID_VDEC and HI_ID_VPC are supported. |
chn |
Input |
Channel ID. When mode is set to HI_ID_VDEC, see the value range of the chn parameter in hi_mpi_vdec_create_chn for the channel ID range. When mode is set to HI_ID_VPC, see the value range of the chn parameter in hi_mpi_vpc_create_chn for the channel ID range. |
csc_matrix |
Input |
Data standard of the CSC matrix. |
csc_coefficient |
Input |
Pointer to the CSC matrix parameter value. If csc_matrix is set to HI_CSC_MATRIX_USER, you need to use the csc_coefficient parameter to set the CSC matrix parameters. Otherwise, set this parameter to any value. |
Returns
- 0: success
- Other values: failure. For details, see Common Return Codes.