VDEC Functions and Restrictions
The
Function Usage
Video Decoder (VDEC) decodes videos.
Resolution Restrictions
- Input resolution range:
Version
Resolution Range
Atlas inference products Atlas A2 training products /Atlas A2 inference products Atlas A3 training products /Atlas A3 inference products 128 x 128 to 4096 x 4096
Atlas 200I/500 A2 inference products 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 products Atlas A2 training products /Atlas A2 inference products Atlas A3 training products /Atlas A3 inference products 10 x 6 to 4096 x 4096
Atlas 200I/500 A2 inference products 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 refers to the actual size occupied by input streams. For details about the size of the output buffer, see the formula in Table 1.
Version |
Buffer Allocation APIs |
|---|---|
During VDEC video decoding, call acl.himpi.dvpp_malloc\acl.himpi.dvpp_free to allocate or release the input and output buffer on the device. The buffer life cycle is managed by users. |
|
During VDEC video decoding, the following two types of buffer allocation APIs are supported:
Note: acl.himpi.dvpp_malloc allocates a dedicated buffer for processing media data. However, the address space of the dedicated buffer is limited. If buffer planning is cared or buffer resources are limited, you are advised to allocate buffer by calling acl.rt.malloc. |
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 products Output Width Stride, Height Stride, and Buffer Size
Atlas 200I/500 A2 inference products Atlas A2 training products /Atlas A2 inference products Atlas A3 training products /Atlas A3 inference products 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 products /Atlas A2 inference products supports this format.The
Atlas A3 training products /Atlas A3 inference products 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 products /Atlas A2 inference products supports this format.The
Atlas A3 training products /Atlas A3 inference products 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 products /Atlas A2 inference products , 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 no applicable to streams containing B-frames.