Function: set_aipp_csc_params
|
C Prototype |
aclError aclmdlSetAIPPCscParams(aclmdlAIPP *aippParmsSet, int8_t cscSwitch, int16_t cscMatrixR0C0, int16_t cscMatrixR0C1, int16_t cscMatrixR0C2, int16_t cscMatrixR1C0, int16_t cscMatrixR1C1,int16_t cscMatrixR1C2, int16_t cscMatrixR2C0, int16_t cscMatrixR2C1, int16_t cscMatrixR2C2, uint8_t cscOutputBiasR0, uint8_t cscOutputBiasR1, uint8_t cscOutputBiasR2, uint8_t cscInputBiasR0, uint8_t cscInputBiasR1, uint8_t cscInputBiasR2) |
|---|---|
|
Python Function |
ret = acl.mdl.set_aipp_csc_params(aipp_parms_set, csc_switch, csc_matrix_R0C0, csc_matrix_R0C1, csc_matrix_R0C2,csc_matrix_R1C0, csc_matrix_R1C1, csc_matrix_R1C2, csc_matrix_R2C0, csc_matrix_R2C1, csc_matrix_R2C2, csc_output_bias_R0, csc_output_bias_R1, csc_output_bias_R2, csc_input_bias_R0, csc_input_bias_R1, csc_input_bias_R2) |
|
Function Usage |
Sets CSC parameters in dynamic AIPP scenarios. If the CSC switch is disabled, parameters set by calling this API are invalid. YUV-to-BGR conversion: | B | | cscMatrixR0C0 cscMatrixR0C1 cscMatrixR0C2 | | Y - cscInputBiasR0 | | G | = | cscMatrixR1C0 cscMatrixR1C1 cscMatrixR1C2 | | U - cscInputBiasR1 | >> 8 | R | | cscMatrixR2C0 cscMatrixR2C1 cscMatrixR2C2 | | V - cscInputBiasR2 | BGR-to-YUV conversion: | Y | | cscMatrixR0C0 cscMatrixR0C1 cscMatrixR0C2 | | B | | cscOutputBiasR0 | | U | = | cscMatrixR1C0 cscMatrixR1C1 cscMatrixR1C2 | | G | >> 8 + | cscOutputBiasR1 | | V | | cscMatrixR2C0 cscMatrixR2C1 cscMatrixR2C2 | | R | | cscOutputBiasR2 | CSC parameters are closely related to the formats of the source and destination images. You can refer to the CSC configuration description in ATC Instructions for CSC parameter settings. Configure CSC parameters as required if the listed image formats do not meet your requirements. |
|
Input Description |
aipp_parms_set: int, pointer address of the dynamic AIPP configuration object. The aclmdlAIPP data must be created by calling acl.mdl.create_aipp in advance.
csc_switch: int, CSC switch. Values:
csc_matrix_R0C0: int, CSC matrix parameter. Value range: [–32677, 32676]. csc_matrix_R0C1: int, CSC matrix parameter. Value range: [–32677, 32676]. csc_matrix_R0C2: int, CSC matrix parameter. Value range: [–32677, 32676]. csc_matrix_R1C0: int, CSC matrix parameter. Value range: [–32677, 32676]. csc_matrix_R1C1: int, CSC matrix parameter. Value range: [–32677, 32676]. csc_matrix_R1C2: int, CSC matrix parameter. Value range: [–32677, 32676]. csc_matrix_R2C0: int, CSC matrix parameter. Value range: [–32677, 32676]. csc_matrix_R2C1: int, CSC matrix parameter. Value range: [–32677, 32676]. csc_matrix_R2C2: int, CSC matrix parameter. Value range: [–32677, 32676]. csc_output_bias_R0: int, output bias during RGB2YUV conversion. The default value is 0. Value range: [0, 255]. csc_output_bias_R1: int, output bias during RGB2YUV conversion. The default value is 0. Value range: [0, 255]. csc_output_bias_R2: int, output bias during RGB2YUV conversion. The default value is 0. Value range: [0, 255]. csc_input_bias_R0: int, input bias during YUV2RGB conversion. The default value is 0. Value range: [0, 255]. csc_input_bias_R1: int, input bias during YUV2RGB conversion. The default value is 0. Value range: [0, 255]. csc_input_bias_R2: int, input bias during YUV2RGB conversion. The default value is 0. Value range: [0, 255]. |
|
Return Value |
ret: int, error code.
|
|
Restrictions |
If the original image format is set to YUV400 by the acl.mdl.set_aipp_input_format call, it is not supported to set the CSC attributes by this API. |