Functions and Restrictions

Description

The video decoder (VDEC) decodes videos. After VPC processing, the VDEC outputs images in a specified format. For details, see Restrictions on Stream/Image Formats, Width and Height Alignment, and Buffers.

Resolution Restrictions

  • Input resolution range:

    Version

    Resolution Range

    Atlas training product

    Atlas inference product

    Atlas A2 training product / Atlas A2 inference product

    Atlas A3 training product / Atlas A3 inference product

    128 x 128 to 4096 x 4096

    Atlas 200I/500 A2 inference product

    H.264 input streams: 128 x 128 to 8192 x 8192

    H.265 input streams: 128 x 128 to 5400 x 8192

  • Output resolution range:

    Version

    Resolution Range

    Atlas training product

    Atlas inference product

    Atlas A2 training product / Atlas A2 inference product

    Atlas A3 training product / Atlas A3 inference product

    10 x 6 to 4096 x 4096

    Atlas 200I/500 A2 inference product

    The maximum resolution of the output image is 8192 x 8192. When the width of the input stream is less than or equal to 4096, the minimum resolution of the output image is 10 x 6. Otherwise, the minimum resolution of the output image is 128 x 128.

Restrictions on Stream/Image Formats, Width and Height Alignment, and Buffers

In terms of the VDEC function, the input/output buffer lifetime is managed by the user.

  • Input buffer

    Call acl.media.dvpp_malloc/acl.media.dvpp_free or acl.rt.malloc/acl.rt.free to allocate or free the buffer. The buffer size is the size of space occupied by actual input streams.

    The memory allocated by calling the acl.media.dvpp_malloc API is the dedicated memory for media data processing. However, the address space of the dedicated memory is limited. If the memory planning is concerned or the memory resources are limited, you are advised to call the acl.rt.malloc API to allocate memory when using the VDEC function.

  • Output buffer

    Call the acl.media.dvpp_malloc API to allocate the output buffer on the device, and call the acl.media.dvpp_free API to free the output buffer. For details about the buffer size, see the formula in the following table.

For details about the output image format, see acldvppPixelFormat. For details about the width stride and height stride, see Terminology.

During VDEC video decoding, the input streams support the following formats:
  • H.264 BP/MP/HP level 5.1 YUV420 streams (Annex-B raw video streams only)
  • H.265 8-/10-bit level 5.1 YUV420 streams (Annex-B raw video streams only)

The following table describes the requirements on the output image format and alignment of width and height during VDEC video decoding.

Table 1 Restrictions on the stream/image format, width and height alignment, and buffer size

Version

Output Format

Output Width and Height

Output Width Stride, Height Stride, and Buffer Size

Atlas training product

Atlas inference product

Output Width Stride, Height Stride, and Buffer Size

Atlas 200I/500 A2 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas A3 training product / Atlas A3 inference product

General format, supported by all versions

YUV420SP NV12 8bit

Width: Must be a multiple of 2.

Height: Must be a multiple of 2.

Width stride: Round up the width to the nearest multiple of 16. If the configured width of the output image is less than 16, the minimum width stride must be at least 32.

Height stride: Round up the height to the nearest multiple of 2.

Buffer size (in bytes) ≥ Width stride x Height stride x 3/2

Width stride: No alignment requirement. The value is the same as width and ranges from 10 to 24576.

Height stride: No alignment requirement. The value is the same as height and ranges from 6 to 24576.

Buffer size (in bytes) ≥ Width stride x Height stride x 3/2

YUV420SP NV21 8bit

Only the following versions support this format:

Atlas inference product

Atlas 200I/500 A2 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas A3 training product / Atlas A3 inference product

RGB888

No alignment requirement.

Width stride: Round up the width to the nearest multiple of 16 and multiply the result by 3.

Height stride: No alignment requirement.

Buffer size (in bytes) ≥ Width stride x Height stride

Width stride = Width x 3. The value ranges from 30 to 24576.

Height stride: No alignment requirement. The value range from 6 to 24576.

Buffer size (in bytes) ≥ Width stride x Height stride

BGR888

Other Restrictions

  • VDEC decodes input streams frame by frame.
  • Bad frames or frame loss in the streams may cause VDEC frame loss.
  • VDEC decodes only the H.264 8-bit streams encoded in interlaced mode.