aclmdlSetAIPPCscParams
Description
Sets CSC parameters in the dynamic AIPP scenario. If the CSC switch is turned off, the following parameters set by using this API call are invalid.
YUV2BGR conversion: | B | | cscMatrixR0C0 cscMatrixR0C1 cscMatrixR0C2 | | Y - cscInputBiasR0 | | G | = | cscMatrixR1C0 cscMatrixR1C1 cscMatrixR1C2 | | U - cscInputBiasR1 | >> 8 | R | | cscMatrixR2C0 cscMatrixR2C1 cscMatrixR2C2 | | V - cscInputBiasR2 | BGR2YUV conversion: | Y | | cscMatrixR0C0 cscMatrixR0C1 cscMatrixR0C2 | | B | | cscOutputBiasR0 | | U | = | cscMatrixR1C0 cscMatrixR1C1 cscMatrixR1C2 | | G | >> 8 + | cscOutputBiasR1 | | V | | cscMatrixR2C0 cscMatrixR2C1 cscMatrixR2C2 | | R | | cscOutputBiasR2 |
The CSC parameters are closely related to the image formats before and after conversion. You can configure CSC parameters based on the image formats before and after conversion by referring to CSC Configuration in ATC Instructions. Configure CSC parameters as required if the listed image formats do not meet your requirements.
Restrictions
If the source image format is set to YUV400 by the aclmdlSetAIPPInputFormat call, it is not supported to set the CSC attributes by this API.
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)
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
aippParmsSet |
Output |
Pointer to the dynamic AIPP parameter object. Call aclmdlCreateAIPP in advance to create data of the aclmdlAIPP type. |
|
cscSwitch |
Input |
CSC enable.
|
|
cscMatrixR0C0 |
Input |
CSC matrix parameter. Value range: [–32677, +32676] |
|
cscMatrixR0C1 |
Input |
CSC matrix parameter. Value range: [–32677, +32676] |
|
cscMatrixR0C2 |
Input |
CSC matrix parameter. Value range: [–32677, +32676] |
|
cscMatrixR1C0 |
Input |
CSC matrix parameter. Value range: [–32677, +32676] |
|
cscMatrixR1C1 |
Input |
CSC matrix parameter. Value range: [–32677, +32676] |
|
cscMatrixR1C2 |
Input |
CSC matrix parameter. Value range: [–32677, +32676] |
|
cscMatrixR2C0 |
Input |
CSC matrix parameter. Value range: [–32677, +32676] |
|
cscMatrixR2C1 |
Input |
CSC matrix parameter. Value range: [–32677, +32676] |
|
cscMatrixR2C2 |
Input |
CSC matrix parameter. Value range: [–32677, 32676] |
|
cscOutputBiasR0 |
Input |
Output bias for RGB2YUV conversion. Value range: [0, 255] |
|
cscOutputBiasR1 |
Input |
Output bias for RGB2YUV conversion. Value range: [0, 255] |
|
cscOutputBiasR2 |
Input |
Output bias for RGB2YUV conversion. Value range: [0, 255] |
|
cscInputBiasR0 |
Input |
Input bias for YUV2RGB conversion. Value range: [0, 255] |
|
cscInputBiasR1 |
Input |
Input bias for YUV2RGB conversion. Value range: [0, 255] |
|
cscInputBiasR2 |
Input |
Input bias for YUV2RGB conversion. Value range: [0, 255] |
Returns
The value 0 indicates success, and other values indicate failure. For details, see aclError.