Function: dvpp_vpc_convert_color_async

Applicability

Product

Supported (√/x)

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas training products

x

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

Converts the image format. The width and height of the output image must be the same as those of the input image. This API is asynchronous.

Prototype

  • C Prototype
    1
    aclError acldvppVpcConvertColorAsync(acldvppChannelDesc *channelDesc, acldvppPicDesc *inputDesc, acldvppPicDesc *outputDesc, aclrtStream stream)
    
  • Python Function
    1
    ret = acl.media.dvpp_vpc_convert_color_async(dvpp_channel_desc, input_dvpp_pic_desc, output_dvpp_pic_desc, stream)
    

Parameter Description

Parameter

Description

dvpp_channel_desc

Int, pointer address of the channel description. It must be the same as dvpp_channel_desc passed to the acl.media.dvpp_create_channel call.

input_dvpp_pic_desc

Int, pointer address of the input image information.
  • Call acl.media.dvpp_create_pic_desc to create an image description.
  • Call the acl.media.dvpp_set_pic_desc APIs to set the image description (including the memory address, memory size, image format, and image resolution).

output_dvpp_pic_desc

Int, pointer address of the output image information.

When it is used as an input, the user needs to:
  • Call acl.media.dvpp_create_pic_desc to create an image description.
  • Call the acl.media.dvpp_set_pic_desc APIs to set the image description (including the memory address, memory size, image format, and image resolution).

    Specify the width, height, width stride, height stride, memory address, memory size, and format of the output image.

    • The width and height of the output image must be the same as those of the input image. Otherwise, an error is reported.

      If the width or height of the output image is set to 0, VPC uses the width and height of the input image as the width and height of the output image respectively. In addition, VPC calculates the width stride and height stride based on the alignment requirements, which vary with the image format. For details, see Restrictions on Image Formats, Width and Height Alignment, and Buffers.

    • The width stride and height stride of the output image must meet the alignment requirements, which vary with the image format. For details, see Restrictions on Image Formats, Width and Height Alignment, and Buffers.

stream

Int, stream object.

Return Value Description

Return Value

Description

ret

Int, error code: 0 on success; else, failure.

Restrictions

Reference

For the API call example, see Sample Code for Format Conversion.