---
title: 色域转换配置说明
description: "AIPP提供了更为方便的图像格式转换方式：色域转换，用于将输入的图片格式，转换为模型需要的图片格式，一旦确认了AIPP处理前与AIPP处理后的图片格式，即可确定色域转换相关的参数值（matrix_r*c*配置项的值是固定的，不需要调整）。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/devaids/atctool/atlasatc_16_0021.html
sourcePath: /source/zh/canncommercial/900/devaids/atctool/atlasatc_16_0021.html
indexId: c9204cab7fd8730c21d41be4cbb26899642442ce16db76de866a037c6d6d9be867
---
# 色域转换配置说明

AIPP提供了更为方便的图像格式转换方式：色域转换，用于将输入的图片格式，转换为模型需要的图片格式，一旦确认了AIPP处理前与AIPP处理后的图片格式，即可确定色域转换相关的参数值（matrix_r*c*配置项的值是固定的，不需要调整）。

例如：将JPEG格式的图像文件（如后缀为jpg、jpeg、JPG、JPEG的图像文件）转为RGB格式；将视频解码后的YUV格式数据转为RGB格式。而根据不同的彩色视频数字化标准又可以将视频格式分为BT-601标准清晰度视频格式（定义于SDTV标准中）和BT-709高清晰度视频格式（定义于HDTV标准中）。两种视频格式又分为NARROW和WIDE，其中：

NARROW取值范围为：，WIDE取值范围为：

关于如何判断输入数据的标准，请参见使用AIPP色域转换模型时如何判断视频流的格式标准。

YUV格式的数据转为RGB格式可以视作如下公式展示的矩阵乘法，这其中的转换矩阵就是待配置的参数和偏移量。

```
# YUV转BGR：
| B |   | matrix_r0c0 matrix_r0c1 matrix_r0c2 | | Y - input_bias_0 |
| G | = | matrix_r1c0 matrix_r1c1 matrix_r1c2 | | U - input_bias_1 | >> 8
| R |   | matrix_r2c0 matrix_r2c1 matrix_r2c2 | | V - input_bias_2 |
```

在AIPP处理前，针对模型输入的图片或视频（各颜色编码方式，如YUV420SP_U8、RGB888_U8等），当前给出JPEG、BT-601NARROW、BT-601WIDE、BT-709NARROW、BT-709WIDE几种典型场景下的色域转换配置。

DVPP处理后的数据，不会对色域配置产生影响，例如DVPP处理前的数据为BT-709格式，经过DVPP处理后，输入给AIPP，此时数据仍为BT-709格式。


#### 色域转换概览

支持的色域转换配置如表1所示。


**表1 色域转换概览表**

| 支持的色域转换列表 | 支持的色域转换列表 | 支持的色域转换列表 | 支持的色域转换列表 |
| --- | --- | --- | --- |
| YUV420SP\_U8转YUV444 | RGB888\_U8转BGR | XRGB8888\_U8转BGR | RGB888\_U8转FP16 RGB |
| YUV420SP\_U8转YVU444 | RGB888\_U8转YUV444 | XRGB8888\_U8转YUV444 | \- |
| YUV420SP\_U8转RGB | RGB888\_U8转YVU444 | XRGB8888\_U8转YVU444 | \- |
| YUV420SP\_U8转BGR | RGB888\_U8转GRAY | XRGB8888\_U8转GRAY | \- |
| YUV420SP\_U8转GRAY | BGR888\_U8转GRAY | XBGR8888\_U8转GRAY | \- |
| YVU420SP\_U8转RGB | BGR888\_U8转RGB | RGBX8888\_U8转GRAY | \- |
| YVU420SP\_U8转BGR | BGR888\_U8转BGR | BGRX8888\_U8转GRAY | \- |
| RGB888\_U8转RGB | XRGB8888\_U8转RGB | YUV400\_U8转GRAY | \- |


#### YUV420SP_U8转YUV444

```
aipp_op {
aipp_mode: static
input_format : YUV420SP_U8
csc_switch : false
rbuv_swap_switch : false
}
```


#### YUV420SP_U8转YVU444

```
aipp_op {
aipp_mode: static
input_format : YUV420SP_U8
csc_switch : false
rbuv_swap_switch : true
}
```


#### YUV420SP_U8转RGB

- 输入数据为JPEG图像| JPEG |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 256 matrix\_r0c1 : 0 matrix\_r0c2 : 359 matrix\_r1c0 : 256 matrix\_r1c1 : \-88 matrix\_r1c2 : \-183 matrix\_r2c0 : 256 matrix\_r2c1 : 454 matrix\_r2c2 : 0 input\_bias\_0 : 0 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-601NARROW视频| BT\-601NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 298 matrix\_r0c1 : 0 matrix\_r0c2 : 409 matrix\_r1c0 : 298 matrix\_r1c1 : \-100 matrix\_r1c2 : \-208 matrix\_r2c0 : 298 matrix\_r2c1 : 516 matrix\_r2c2 : 0 input\_bias\_0 : 16 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-601WIDE视频| BT\-601WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 256 matrix\_r0c1 : 0 matrix\_r0c2 : 359 matrix\_r1c0 : 256 matrix\_r1c1 : \-88 matrix\_r1c2 : \-183 matrix\_r2c0 : 256 matrix\_r2c1 : 454 matrix\_r2c2 : 0 input\_bias\_0 : 0 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-709NARROW视频| BT\-709NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 298 matrix\_r0c1 : 0 matrix\_r0c2 : 459 matrix\_r1c0 : 298 matrix\_r1c1 : \-55 matrix\_r1c2 : \-136 matrix\_r2c0 : 298 matrix\_r2c1 : 541 matrix\_r2c2 : 0 input\_bias\_0 : 16 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-709WIDE视频| BT\-709WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 256 matrix\_r0c1 : 0 matrix\_r0c2 : 403 matrix\_r1c0 : 256 matrix\_r1c1 : \-48 matrix\_r1c2 : \-120 matrix\_r2c0 : 256 matrix\_r2c1 : 475 matrix\_r2c2 : 0 input\_bias\_0 : 0 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


#### YUV420SP_U8转BGR

- 输入数据为JPEG图像| JPEG |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 256 matrix\_r0c1 : 454 matrix\_r0c2 : 0 matrix\_r1c0 : 256 matrix\_r1c1 : \-88 matrix\_r1c2 : \-183 matrix\_r2c0 : 256 matrix\_r2c1 : 0 matrix\_r2c2 : 359 input\_bias\_0 : 0 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-601NARROW视频| BT\-601NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 298 matrix\_r0c1 : 516 matrix\_r0c2 : 0 matrix\_r1c0 : 298 matrix\_r1c1 : \-100 matrix\_r1c2 : \-208 matrix\_r2c0 : 298 matrix\_r2c1 : 0 matrix\_r2c2 : 409 input\_bias\_0 : 16 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-601WIDE视频| BT\-601WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 256 matrix\_r0c1 : 454 matrix\_r0c2 : 0 matrix\_r1c0 : 256 matrix\_r1c1 : \-88 matrix\_r1c2 : \-183 matrix\_r2c0 : 256 matrix\_r2c1 : 0 matrix\_r2c2 : 359 input\_bias\_0 : 0 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-709NARROW视频| BT\-709NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 298 matrix\_r0c1 : 541 matrix\_r0c2 : 0 matrix\_r1c0 : 298 matrix\_r1c1 : \-55 matrix\_r1c2 : \-136 matrix\_r2c0 : 298 matrix\_r2c1 : 0 matrix\_r2c2 : 459 input\_bias\_0 : 16 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-709WIDE视频| BT\-709WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 256 matrix\_r0c1 : 475 matrix\_r0c2 : 0 matrix\_r1c0 : 256 matrix\_r1c1 : \-48 matrix\_r1c2 : \-120 matrix\_r2c0 : 256 matrix\_r2c1 : 0 matrix\_r2c2 : 403 input\_bias\_0 : 0 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


#### YUV420SP_U8转GRAY

```
aipp_op {
aipp_mode: static
input_format : YUV420SP_U8
csc_switch : true
rbuv_swap_switch : false
matrix_r0c0 : 256
matrix_r0c1 : 0
matrix_r0c2 : 0
matrix_r1c0 : 0
matrix_r1c1 : 0
matrix_r1c2 : 0
matrix_r2c0 : 0
matrix_r2c1 : 0
matrix_r2c2 : 0
input_bias_0 : 0
input_bias_1 : 0
input_bias_2 : 0
}
```


#### YVU420SP_U8转RGB

- 输入数据为JPEG图像| JPEG |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : true matrix\_r0c0 : 256 matrix\_r0c1 : 0 matrix\_r0c2 : 359 matrix\_r1c0 : 256 matrix\_r1c1 : \-88 matrix\_r1c2 : \-183 matrix\_r2c0 : 256 matrix\_r2c1 : 454 matrix\_r2c2 : 0 input\_bias\_0 : 0 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-601NARROW视频| BT\-601NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : true matrix\_r0c0 : 298 matrix\_r0c1 : 0 matrix\_r0c2 : 409 matrix\_r1c0 : 298 matrix\_r1c1 : \-100 matrix\_r1c2 : \-208 matrix\_r2c0 : 298 matrix\_r2c1 : 516 matrix\_r2c2 : 0 input\_bias\_0 : 16 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-601WIDE视频| BT\-601WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : true matrix\_r0c0 : 256 matrix\_r0c1 : 0 matrix\_r0c2 : 359 matrix\_r1c0 : 256 matrix\_r1c1 : \-88 matrix\_r1c2 : \-183 matrix\_r2c0 : 256 matrix\_r2c1 : 454 matrix\_r2c2 : 0 input\_bias\_0 : 0 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-709NARROW视频| BT\-709NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : true matrix\_r0c0 : 298 matrix\_r0c1 : 0 matrix\_r0c2 : 459 matrix\_r1c0 : 298 matrix\_r1c1 : \-55 matrix\_r1c2 : \-136 matrix\_r2c0 : 298 matrix\_r2c1 : 541 matrix\_r2c2 : 0 input\_bias\_0 : 16 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-709WIDE视频| BT\-709WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : true matrix\_r0c0 : 256 matrix\_r0c1 : 0 matrix\_r0c2 : 403 matrix\_r1c0 : 256 matrix\_r1c1 : \-48 matrix\_r1c2 : \-120 matrix\_r2c0 : 256 matrix\_r2c1 : 475 matrix\_r2c2 : 0 input\_bias\_0 : 0 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


#### YVU420SP_U8转BGR

- 输入数据为JPEG图像| JPEG |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : true matrix\_r0c0 : 256 matrix\_r0c1 : 454 matrix\_r0c2 : 0 matrix\_r1c0 : 256 matrix\_r1c1 : \-88 matrix\_r1c2 : \-183 matrix\_r2c0 : 256 matrix\_r2c1 : 0 matrix\_r2c2 : 359 input\_bias\_0 : 0 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-601NARROW视频| BT\-601NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : true matrix\_r0c0 : 298 matrix\_r0c1 : 516 matrix\_r0c2 : 0 matrix\_r1c0 : 298 matrix\_r1c1 : \-100 matrix\_r1c2 : \-208 matrix\_r2c0 : 298 matrix\_r2c1 : 0 matrix\_r2c2 : 409 input\_bias\_0 : 16 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-601WIDE视频| BT\-601WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : true matrix\_r0c0 : 256 matrix\_r0c1 : 454 matrix\_r0c2 : 0 matrix\_r1c0 : 256 matrix\_r1c1 : \-88 matrix\_r1c2 : \-183 matrix\_r2c0 : 256 matrix\_r2c1 : 0 matrix\_r2c2 : 359 input\_bias\_0 : 0 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-709NARROW视频| BT\-709NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : true matrix\_r0c0 : 298 matrix\_r0c1 : 541 matrix\_r0c2 : 0 matrix\_r1c0 : 298 matrix\_r1c1 : \-55 matrix\_r1c2 : \-136 matrix\_r2c0 : 298 matrix\_r2c1 : 0 matrix\_r2c2 : 459 input\_bias\_0 : 16 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


- 输入数据为BT-709WIDE视频| BT\-709WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : YUV420SP\_U8 csc\_switch : true rbuv\_swap\_switch : true matrix\_r0c0 : 256 matrix\_r0c1 : 475 matrix\_r0c2 : 0 matrix\_r1c0 : 256 matrix\_r1c1 : \-48 matrix\_r1c2 : \-120 matrix\_r2c0 : 256 matrix\_r2c1 : 0 matrix\_r2c2 : 403 input\_bias\_0 : 0 input\_bias\_1 : 128 input\_bias\_2 : 128 } |


#### RGB888_U8转RGB

```
aipp_op {
aipp_mode: static
input_format : RGB888_U8
csc_switch : false
rbuv_swap_switch : false
}
```


#### RGB888_U8转BGR

```
aipp_op {
aipp_mode: static
input_format : RGB888_U8
csc_switch : false
rbuv_swap_switch : true
}
```


#### RGB888_U8转YUV444

- 输入数据为JPEG图像| JPEG |
| --- |
| aipp\_op { aipp\_mode: static input\_format : RGB888\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 77 matrix\_r0c1 : 150 matrix\_r0c2 : 29 matrix\_r1c0 : \-43 matrix\_r1c1 : \-85 matrix\_r1c2 : 128 matrix\_r2c0 : 128 matrix\_r2c1 : \-107 matrix\_r2c2 : \-21 output\_bias\_0 : 0 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-601NARROW视频| BT\-601NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : RGB888\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 66 matrix\_r0c1 : 129 matrix\_r0c2 : 25 matrix\_r1c0 : \-38 matrix\_r1c1 : \-74 matrix\_r1c2 : 112 matrix\_r2c0 : 112 matrix\_r2c1 : \-94 matrix\_r2c2 : \-18 output\_bias\_0 : 16 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-601WIDE视频| BT\-601WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : RGB888\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 77 matrix\_r0c1 : 150 matrix\_r0c2 : 29 matrix\_r1c0 : \-43 matrix\_r1c1 : \-85 matrix\_r1c2 : 128 matrix\_r2c0 : 128 matrix\_r2c1 : \-107 matrix\_r2c2 : \-21 output\_bias\_0 : 0 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-709NARROW视频| BT\-709NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : RGB888\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 47 matrix\_r0c1 : 157 matrix\_r0c2 : 16 matrix\_r1c0 : \-26 matrix\_r1c1 : \-87 matrix\_r1c2 : 112 matrix\_r2c0 : 112 matrix\_r2c1 : \-102 matrix\_r2c2 : \-10 output\_bias\_0 : 16 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-709WIDE视频| BT\-709WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : RGB888\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 55 matrix\_r0c1 : 183 matrix\_r0c2 : 19 matrix\_r1c0 : \-29 matrix\_r1c1 : \-99 matrix\_r1c2 : 128 matrix\_r2c0 : 128 matrix\_r2c1 : \-116 matrix\_r2c2 : \-12 output\_bias\_0 : 0 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


#### RGB888_U8转YVU444

- 输入数据为JPEG图像| JPEG |
| --- |
| aipp\_op { aipp\_mode: static input\_format : RGB888\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 77 matrix\_r0c1 : 150 matrix\_r0c2 : 29 matrix\_r1c0 : 128 matrix\_r1c1 : \-107 matrix\_r1c2 : \-21 matrix\_r2c0 : \-43 matrix\_r2c1 : \-85 matrix\_r2c2 : 128 output\_bias\_0 : 0 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-601NARROW视频| BT\-601NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : RGB888\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 66 matrix\_r0c1 : 129 matrix\_r0c2 : 25 matrix\_r1c0 : 112 matrix\_r1c1 : \-94 matrix\_r1c2 : \-18 matrix\_r2c0 : \-38 matrix\_r2c1 : \-74 matrix\_r2c2 : 112 output\_bias\_0 : 16 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-601WIDE视频| BT\-601WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : RGB888\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 77 matrix\_r0c1 : 150 matrix\_r0c2 : 29 matrix\_r1c0 : 128 matrix\_r1c1 : \-107 matrix\_r1c2 : \-21 matrix\_r2c0 : \-43 matrix\_r2c1 : \-85 matrix\_r2c2 : 128 output\_bias\_0 : 0 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-709NARROW视频| BT\-709NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : RGB888\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 47 matrix\_r0c1 : 157 matrix\_r0c2 : 16 matrix\_r1c0 : 112 matrix\_r1c1 : \-102 matrix\_r1c2 : \-10 matrix\_r2c0 : \-26 matrix\_r2c1 : \-87 matrix\_r2c2 : 112 output\_bias\_0 : 16 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-709WIDE视频| BT\-709WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : RGB888\_U8 csc\_switch : true rbuv\_swap\_switch : false matrix\_r0c0 : 55 matrix\_r0c1 : 183 matrix\_r0c2 : 19 matrix\_r1c0 : 128 matrix\_r1c1 : \-116 matrix\_r1c2 : \-12 matrix\_r2c0 : \-29 matrix\_r2c1 : \-99 matrix\_r2c2 : 128 output\_bias\_0 : 0 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


#### RGB888_U8转GRAY

```
aipp_op {
aipp_mode: static
input_format : RGB888_U8
csc_switch : true
rbuv_swap_switch : false
matrix_r0c0 : 76
matrix_r0c1 : 150
matrix_r0c2 : 30
matrix_r1c0 : 0
matrix_r1c1 : 0
matrix_r1c2 : 0
matrix_r2c0 : 0
matrix_r2c1 : 0
matrix_r2c2 : 0
output_bias_0 : 0
output_bias_1 : 0
output_bias_2 : 0
}
```


#### BGR888_U8转GRAY

```
aipp_op {
aipp_mode: static
input_format : RGB888_U8
csc_switch : true
rbuv_swap_switch : true
matrix_r0c0 : 76
matrix_r0c1 : 150
matrix_r0c2 : 30
matrix_r1c0 : 0
matrix_r1c1 : 0
matrix_r1c2 : 0
matrix_r2c0 : 0
matrix_r2c1 : 0
matrix_r2c2 : 0
output_bias_0 : 0
output_bias_1 : 0
output_bias_2 : 0
}
```


#### BGR888_U8转RGB

```
aipp_op {
aipp_mode: static
input_format : RGB888_U8
csc_switch : false
rbuv_swap_switch : true
}
```


#### BGR888_U8转BGR

```
aipp_op {
aipp_mode: static
input_format : RGB888_U8
csc_switch : false
rbuv_swap_switch : false
}
```


#### XRGB8888_U8转RGB

```
aipp_op {
aipp_mode: static
input_format : XRGB8888_U8
csc_switch : false
rbuv_swap_switch : false
ax_swap_switch : true
}
```


#### XRGB8888_U8转BGR

```
aipp_op {
aipp_mode: static
input_format : XRGB8888_U8
csc_switch : false
rbuv_swap_switch : true
ax_swap_switch : true
}
```


#### XRGB8888_U8转YUV444

- 输入数据为JPEG图像| JPEG |
| --- |
| aipp\_op { aipp\_mode: static input\_format : XRGB8888\_U8 csc\_switch : true rbuv\_swap\_switch : false ax\_swap\_switch : true matrix\_r0c0 : 77 matrix\_r0c1 : 150 matrix\_r0c2 : 29 matrix\_r1c0 : \-43 matrix\_r1c1 : \-85 matrix\_r1c2 : 128 matrix\_r2c0 : 128 matrix\_r2c1 : \-107 matrix\_r2c2 : \-21 output\_bias\_0 : 0 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-601NARROW视频| BT\-601NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : XRGB8888\_U8 csc\_switch : true rbuv\_swap\_switch : false ax\_swap\_switch : true matrix\_r0c0 : 66 matrix\_r0c1 : 129 matrix\_r0c2 : 25 matrix\_r1c0 : \-38 matrix\_r1c1 : \-74 matrix\_r1c2 : 112 matrix\_r2c0 : 112 matrix\_r2c1 : \-94 matrix\_r2c2 : \-18 output\_bias\_0 : 16 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-601WIDE视频| BT\-601WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : XRGB8888\_U8 csc\_switch : true rbuv\_swap\_switch : false ax\_swap\_switch : true matrix\_r0c0 : 77 matrix\_r0c1 : 150 matrix\_r0c2 : 29 matrix\_r1c0 : \-43 matrix\_r1c1 : \-85 matrix\_r1c2 : 128 matrix\_r2c0 : 128 matrix\_r2c1 : \-107 matrix\_r2c2 : \-21 output\_bias\_0 : 0 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-709NARROW视频| BT\-709NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : XRGB8888\_U8 csc\_switch : true rbuv\_swap\_switch : false ax\_swap\_switch : true matrix\_r0c0 : 47 matrix\_r0c1 : 157 matrix\_r0c2 : 16 matrix\_r1c0 : \-26 matrix\_r1c1 : \-87 matrix\_r1c2 : 112 matrix\_r2c0 : 112 matrix\_r2c1 : \-102 matrix\_r2c2 : \-10 output\_bias\_0 : 16 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-709WIDE视频| BT\-709WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : XRGB8888\_U8 csc\_switch : true rbuv\_swap\_switch : false ax\_swap\_switch : true matrix\_r0c0 : 55 matrix\_r0c1 : 183 matrix\_r0c2 : 19 matrix\_r1c0 : \-29 matrix\_r1c1 : \-99 matrix\_r1c2 : 128 matrix\_r2c0 : 128 matrix\_r2c1 : \-116 matrix\_r2c2 : \-12 output\_bias\_0 : 0 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


#### XRGB8888_U8转YVU444

- 输入数据为JPEG图像| JPEG |
| --- |
| aipp\_op { aipp\_mode: static input\_format : XRGB8888\_U8 csc\_switch : true rbuv\_swap\_switch : false ax\_swap\_switch : true matrix\_r0c0 : 77 matrix\_r0c1 : 150 matrix\_r0c2 : 29 matrix\_r1c0 : 128 matrix\_r1c1 : \-107 matrix\_r1c2 : \-21 matrix\_r2c0 : \-43 matrix\_r2c1 : \-85 matrix\_r2c2 : 128 output\_bias\_0 : 0 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-601NARROW视频| BT\-601NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : XRGB8888\_U8 csc\_switch : true rbuv\_swap\_switch : false ax\_swap\_switch : true matrix\_r0c0 : 66 matrix\_r0c1 : 129 matrix\_r0c2 : 25 matrix\_r1c0 : 112 matrix\_r1c1 : \-94 matrix\_r1c2 : \-18 matrix\_r2c0 : \-38 matrix\_r2c1 : \-74 matrix\_r2c2 : 112 output\_bias\_0 : 16 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-601WIDE视频| BT\-601WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : XRGB8888\_U8 csc\_switch : true rbuv\_swap\_switch : false ax\_swap\_switch : true matrix\_r0c0 : 77 matrix\_r0c1 : 150 matrix\_r0c2 : 29 matrix\_r1c0 : 128 matrix\_r1c1 : \-107 matrix\_r1c2 : \-21 matrix\_r2c0 : \-43 matrix\_r2c1 : \-85 matrix\_r2c2 : 128 output\_bias\_0 : 0 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-709NARROW视频| BT\-709NARROW |
| --- |
| aipp\_op { aipp\_mode: static input\_format : XRGB8888\_U8 csc\_switch : true rbuv\_swap\_switch : false ax\_swap\_switch : true matrix\_r0c0 : 47 matrix\_r0c1 : 157 matrix\_r0c2 : 16 matrix\_r1c0 : 112 matrix\_r1c1 : \-102 matrix\_r1c2 : \-10 matrix\_r2c0 : \-26 matrix\_r2c1 : \-87 matrix\_r2c2 : 112 output\_bias\_0 : 16 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


- 输入数据为BT-709WIDE视频| BT\-709WIDE |
| --- |
| aipp\_op { aipp\_mode: static input\_format : XRGB8888\_U8 csc\_switch : true rbuv\_swap\_switch : false ax\_swap\_switch : true matrix\_r0c0 : 55 matrix\_r0c1 : 183 matrix\_r0c2 : 19 matrix\_r1c0 : 128 matrix\_r1c1 : \-116 matrix\_r1c2 : \-12 matrix\_r2c0 : \-29 matrix\_r2c1 : \-99 matrix\_r2c2 : 128 output\_bias\_0 : 0 output\_bias\_1 : 128 output\_bias\_2 : 128 } |


#### XRGB8888_U8转GRAY

```
aipp_op {
aipp_mode: static
input_format : XRGB8888_U8
csc_switch : true
rbuv_swap_switch : false
ax_swap_switch : true
matrix_r0c0 : 76
matrix_r0c1 : 150
matrix_r0c2 : 30
matrix_r1c0 : 0
matrix_r1c1 : 0
matrix_r1c2 : 0
matrix_r2c0 : 0
matrix_r2c1 : 0
matrix_r2c2 : 0
output_bias_0 : 0
output_bias_1 : 0
output_bias_2 : 0
}
```


#### XBGR8888_U8转GRAY

```
aipp_op {
aipp_mode: static
input_format : XRGB8888_U8
csc_switch : true
rbuv_swap_switch : true
ax_swap_switch : true
matrix_r0c0 : 76
matrix_r0c1 : 150
matrix_r0c2 : 30
matrix_r1c0 : 0
matrix_r1c1 : 0
matrix_r1c2 : 0
matrix_r2c0 : 0
matrix_r2c1 : 0
matrix_r2c2 : 0
output_bias_0 : 0
output_bias_1 : 0
output_bias_2 : 0
}
```


#### RGBX8888_U8转GRAY

```
aipp_op {
aipp_mode: static
input_format : XRGB8888_U8
csc_switch : true
rbuv_swap_switch : false
ax_swap_switch : false
matrix_r0c0 : 76
matrix_r0c1 : 150
matrix_r0c2 : 30
matrix_r1c0 : 0
matrix_r1c1 : 0
matrix_r1c2 : 0
matrix_r2c0 : 0
matrix_r2c1 : 0
matrix_r2c2 : 0
output_bias_0 : 0
output_bias_1 : 0
output_bias_2 : 0
}
```


#### BGRX8888_U8转GRAY

```
aipp_op {
aipp_mode: static
input_format : XRGB8888_U8
csc_switch : true
rbuv_swap_switch : true
ax_swap_switch : false
matrix_r0c0 : 76
matrix_r0c1 : 150
matrix_r0c2 : 30
matrix_r1c0 : 0
matrix_r1c1 : 0
matrix_r1c2 : 0
matrix_r2c0 : 0
matrix_r2c1 : 0
matrix_r2c2 : 0
output_bias_0 : 0
output_bias_1 : 0
output_bias_2 : 0
}
```


#### YUV400_U8转GRAY

```
aipp_op {
aipp_mode: static
input_format : YUV400_U8
csc_switch : false
}
```


#### RGB888_U8转FP16 RGB

```
aipp_op {
aipp_mode: static
related_input_rank: 0
input_format : RGB888_U8
src_image_size_w : 640
src_image_size_h : 640
mean_chn_0 : 0
mean_chn_1 : 0
mean_chn_2 : 0
var_reci_chn_0 : 1.0
var_reci_chn_1 : 1.0
var_reci_chn_2 : 1.0
}
```
