Function: dvpp_vpc_convert_color_async

Applicability

Product

Supported

Atlas 350 Accelerator Card

x

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas training product

x

Atlas inference product

Atlas 200I/500 A2 inference product

Description

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)
    

Parameters

Parameter

Description

dvpp_channel_desc

Int, pointer address of the channel description. The value must be the same as that of dvpp_channel_desc specified when the acl.media.dvpp_create_channel API is called to create a channel.

input_dvpp_pic_desc

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

output_dvpp_pic_desc

Int, pointer address of the output image information.

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

    You must specify the width, height, width stride, height stride, buffer address, buffer 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, the VPC uses the width and height of the input image as those of the output image. In addition, the VPC calculates the width stride and height stride based on the alignment requirements. The alignment requirements vary according to 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. The alignment requirements vary according to the image format. For details, see Restrictions on Image Formats, Width and Height Alignment, and Buffers.

stream

Int, stream object.

Return Value

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.