VDEC Functions and Restrictions

The Atlas training product does not support the VDEC function described in this section.

Description

Video Decoder (VDEC) decodes videos.

Resolution Restrictions

  • Input resolution range:

    Version

    Resolution Range

    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 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

    Maximum resolution of the output image: 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.
    • When the width of the input stream is greater than 4096, the minimum resolution of the output image is 128 x 128 pixels.

Buffer Allocation and Release APIs

The size of the input buffer is the size of the input stream. For details about the size of the output buffer, see the formula in Table 1.

Version

Buffer Allocation APIs

Atlas inference product

During VDEC video decoding, call acl.himpi.dvpp_malloc\acl.himpi.dvpp_free to allocate or free the input and output buffers on the device. The buffer lifetime is managed by the user.

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas A3 training product / Atlas A3 inference product

During VDEC video decoding, the following two types of buffer allocation APIs are supported:

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

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

  • Input stream format
    • 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)
  • Output image requirements:
    Table 1 Restrictions on the stream/image format, width and height alignment, and buffer size

    Output Format

    Output Width and Height

    Output Width Stride, Height Stride, and Buffer Size

    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

    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. The minimum value is 32 and the maximum value is 16384.

    Height stride: Round up the height to the nearest multiple of 2. The minimum value is 6 and the maximum value is 16384.

    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

    Width: Must be a multiple of 2.

    Height: Must be a multiple of 2.

    RGB888

    No alignment requirement.

    Width stride: Round up the width to the nearest multiple of 16 and multiply the result by 3. The minimum value is 48 and the maximum value is 16384.

    Height stride: No alignment requirement. The minimum value is 6 and the maximum value is 16384.

    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 minimum value is 6 and the maximum value is 16384.

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

    BGR888

    No alignment requirement.

    RGB888 Planar

    The Atlas A2 training product / Atlas A2 inference product supports this format.

    The Atlas A3 training product / Atlas A3 inference product supports this format.

    No alignment requirement.

    -

    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

    BGR888 Planar

    The Atlas A2 training product / Atlas A2 inference product supports this format.

    The Atlas A3 training product / Atlas A3 inference product supports this format.

    No alignment requirement.

    -

    For details about the definition of the output image format, see hi_pixel_format. For details about the concepts such as width stride and height stride, see Terminology.

Other Restrictions

  • For Atlas A2 training product / Atlas A2 inference product , if the output image format is YUV420SP NV12 10-bit or YUV420SP NV21 10-bit, image scaling and CSC are not supported when the VDEC function is used.
  • VDEC decodes streams input by frame.
  • If there are bad frames or frame loss in the stream, VDEC will mark the frames as a decoding failure and report an exception.
  • VDEC decodes only the H.264 8-bit streams encoded in interlaced mode.
  • The combined use of stream feeding in frame mode and output in the decoding sequence enables both fast decoding and output. However, this is not applicable to streams containing B-frames.