sys_set_chn_csc_matrix
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
x |
|
√ |
|
√ |
Function Usage
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.
Prototype
- C Prototype
1hi_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);
- Python Function
1ret = acl.himpi.sys_set_chn_csc_matrix(mode, chn, csc_matrix, csc_coefficient)
Parameter Description
Parameter |
Description |
|---|---|
mode |
Int, module ID, either HI_ID_VDEC or HI_ID_VPC. |
chn |
Int, channel ID.
|
csc_matrix |
Int, data standard of the CSC matrix. For details, see hi_csc_matrix. |
csc_coefficient |
Dict, CSC matrix parameter value dictionary. For details, see hi_csc_coefficient. Use csc_coefficient to set the CSC matrix parameters when csc_matrix is set to HI_CSC_MATRIX_USER. Otherwise, pass a random value to this parameter. |
Return Value Description
Return Value |
Description |
|---|---|
ret |
Int, error code: 0 on success; else, failure. |
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:
- acl.himpi.sys_set_chn_csc_matrix (first CSC parameter modification)
- acl.himpi.vpc_crop (cropping)
- acl.himpi.vpc_get_process_result (waiting for the cropping task to complete)
- acl.himpi.sys_set_chn_csc_matrix (second CSC parameter modification)
- acl.himpi.vpc_resize (resizing)
- acl.himpi.vpc_get_process_result (waiting for the resizing task to complete)