Functions and Restrictions

Function Description

Video Decoder (VDEC) decodes videos. After internal VPC processing, VDEC outputs images in specified formats. For details, see Restrictions on Stream/Image Formats, Width and Height Alignment, and Buffers.

Resolution Restrictions

Input stream resolution range

Model

Resolution Range

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas inference products

Atlas training products

128 × 128 to 4096 × 4096

Atlas 200I/500 A2 inference products

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

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

Output image resolution range

Model

Resolution Range

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas inference products

Atlas training products

10 × 6 to 4096 × 4096

Atlas 200I/500 A2 inference products

The maximum resolution of the output image is 8192 × 8192. When the width of the input stream is less than or equal to 4096, the minimum resolution of the output image is 10 × 6. Otherwise, the minimum resolution of the output image is 128 × 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 acldvppMalloc/acldvppFree or aclrtMalloc/aclrtFree to allocate or free the buffer. The buffer size is the size of space occupied by actual input streams.

    The buffer allocated by calling acldvppMalloc is dedicated for processing media data. However, the address space of the dedicated buffer is limited. If buffer planning or resources are limited, you are advised to call aclrtMalloc for allocation when using the VDEC function.

  • Output buffer

    Call acldvppMalloc or acldvppFree to allocate or free the buffer. For details about the buffer size, see the formulas in the table below.

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)

During VDEC video decoding, the output image format, width and height alignment requirements, and buffer size requirements vary with the product model, as shown in the table below. For details about the definition of the output image format, see acldvppPixelFormat. For details about the concepts such as width stride and height stride, see Terminology.

Table 1 Restrictions on the stream/image format, width and height alignment, and buffer size for Atlas A3 training products / Atlas A3 inference products , Atlas A2 training products / Atlas A2 inference products , and Atlas 200I/500 A2 inference products

Output Image Format

Output Width and Height Alignment

Output Width Stride, Height Stride, and Buffer Size

YUV420SP NV12 8-bit

YUV420SP NV21 8-bit

Width: Must be a multiple of 2.

Height: Must be a multiple of 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 × Height stride × 3/2

RGB888

BGR888

No alignment requirement.

Width stride = Width × 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 × Height stride

Table 2 Restrictions on stream/image formats, width and height alignment, and buffers for Atlas training products

Output Image Format

Output Width and Height Alignment

Output Width Stride, Height Stride, and Buffer Size

YUV420SP NV12 8-bit

YUV420SP NV21 8-bit

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 × Height stride × 3/2

Table 3 Restrictions on stream/image formats, width and height alignment, and buffers for Atlas inference products

Output Image Format

Output Width and Height Alignment

Output Width Stride, Height Stride, and Buffer Size

YUV420SP NV12 8-bit

YUV420SP NV21 8-bit

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 × Height stride × 3/2

RGB888

BGR888

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 × Height stride

Other Restrictions

  • VDEC decodes a stream fed in frame mode.
  • Bad frames or frame loss in the streams may cause VDEC frame loss.
  • VDEC decodes only H.264 8-bit streams coded in interlaced mode.