昇腾/GE AIPP色域转换配置
2026/9/10 1:54:10 网站建设 项目流程

色域转换配置说明

【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge

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几种典型场景下的色域转换配置。

[!NOTE]说明

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

色域转换概览

支持的色域转换配置列表如下所示:

  • YUV420SP_U8转YUV444
  • YUV420SP_U8转YVU444
  • YUV420SP_U8转RGB
  • YUV420SP_U8转BGR
  • YUV420SP_U8转GRAY
  • YVU420SP_U8转RGB
  • YVU420SP_U8转BGR
  • RGB888_U8转RGB
  • RGB888_U8转BGR
  • RGB888_U8转YUV444
  • RGB888_U8转YVU444
  • RGB888_U8转GRAY
  • BGR888_U8转GRAY
  • BGR888_U8转RGB
  • BGR888_U8转BGR
  • XRGB8888_U8转RGB
  • XRGB8888_U8转BGR
  • XRGB8888_U8转YUV444
  • XRGB8888_U8转YVU444
  • XRGB8888_U8转GRAY
  • XBGR8888_U8转GRAY
  • RGBX8888_U8转GRAY
  • BGRX8888_U8转GRAY
  • YUV400_U8转GRAY
  • RGB888_U8转FP16 RGB

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 }

【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询