Restrictions

The concepts of 8K and non-8K in this section are described as follows:

  • Non-8K: Width x Height is in the range of [10 x 6, 4096 x 4096].
  • 8K: The width or height is in the range of (4096, 8192].

Resolution Restrictions

  • Input image resolution. Input images with the following resolutions are supported:

    10 * 6 ~ 8192 * 8192

    The APIs for implementing VPC functions have different resolution requirements. For details, see the API descriptions in VPC. When the input image format is YUV440SP or YUV440P, the maximum width of the image is 4096.

  • Output resolution range:

    Version

    Resolution Range

    Atlas training products

    Atlas inference products

    10 * 6 ~ 4096 * 4096

    Atlas A2 training products / Atlas A2 inference products

    Atlas 200I/500 A2 inference products

    Atlas A3 training products / Atlas A3 inference products

    10 * 6 ~ 4096 * 8192

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

During image processing by VPC, acl.media.dvpp_malloc and acl.media.dvpp_free are called to allocate and free the input and output buffers on the device. The buffer lifetime is managed by the user.

  • For details about the restrictions on the input image formats and width and height alignment, see Table 1.
  • For details about the restrictions on the output image formats and width and height alignment, see Table 2.

For the Atlas training products , in the 8K scenario, the input image format must be YUV420SP NV12 8-bit or YUV420SP NV21 8-bit.

For the Atlas inference products , in the 8K scenario, the following input image formats are supported:
  • YUV400 8-bit
  • YUV420SP NV12 8-bit, YUV420SP NV21 8-bit
  • YUV422SP 8-bit, YVU422SP 8-bit
  • YUV444SP 8-bit, YVU444SP 8-bit
  • YUV422P YUYV 8-bit, YUV422P UYVY 8-bit, YUV422P YVYU 8-bit, YUV422P VYUY 8-bit
For the Atlas A2 training products / Atlas A2 inference products , in the 8K scenario, the following input image formats are supported:
  • YUV400 8-bit
  • YUV420SP NV12 8-bit, YUV420SP NV21 8-bit
  • YUV422SP 8-bit, YVU422SP 8-bit
  • YUV444SP 8-bit, YVU444SP 8-bit
  • YUV422P YUYV 8-bit, YUV422P UYVY 8-bit, YUV422P YVYU 8-bit, YUV422P VYUY 8-bit
For the Atlas 200I/500 A2 inference products , in the 8K scenario, the following input image formats are supported:
  • YUV400 8-bit
  • YUV420SP NV12 8-bit, YUV420SP NV21 8-bit
  • YUV422SP 8-bit, YVU422SP 8-bit
  • YUV444SP 8-bit, YVU444SP 8-bit
  • YUV422P YUYV 8-bit, YUV422P UYVY 8-bit, YUV422P YVYU 8-bit, YUV422P VYUY 8-bit
For the Atlas A3 training products / Atlas A3 inference products , in the 8K scenario, the following input image formats are supported:
  • YUV400 8-bit
  • YUV420SP NV12 8-bit, YUV420SP NV21 8-bit
  • YUV422SP 8-bit, YVU422SP 8-bit
  • YUV444SP 8-bit, YVU444SP 8-bit
  • YUV422P YUYV 8-bit, YUV422P UYVY 8-bit, YUV422P YVYU 8-bit, YUV422P VYUY 8-bit

To implement VPC functions with related APIs:

  • For details about the definition of the image format, see acldvppPixelFormat. For details about the concepts such as width stride, height stride, and 8K see Terminology.
  • The minimum and maximum values of the width stride and height stride vary according to the version. For details, see the following:
    • Atlas inference products
      • The minimum width stride is 32, and the maximum width stride is 16384 (16384 = 4096 x 4, for the ARGB format, each pixel occupies 4 bytes).
      • The minimum height stride is 6 and the maximum height stride is 16384.
    • Atlas training products
      • The minimum width stride is 32, and the maximum width stride is 16384 (16384 = 4096 x 4, for the ARGB format, each pixel occupies 4 bytes).
      • The minimum height stride is 6 and the maximum height stride is 16384.
    • Atlas 200I/500 A2 inference products
      • The minimum width stride is 10, and the maximum width stride is 16384 (16384 = 4096 x 4, for the ARGB format, each pixel occupies 4 bytes).
      • The minimum height stride is 6 and the maximum height stride is 16384.
    • Atlas A2 training products / Atlas A2 inference products
      • The minimum width stride is 10, and the maximum width stride is 16384 (16384 = 4096 x 4, for the ARGB format, each pixel occupies 4 bytes).
      • The minimum height stride is 6 and the maximum height stride is 16384.
Table 1 Restrictions on the input image format, width and height alignment, and buffer size

Version

Input Format

Input Width and Height

Input Width Stride, Height Stride, and Buffer Size

Atlas training products

Input Width Stride, Height Stride, and Buffer Size

Atlas inference products

Input 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

General format, supported by all versions

YUV400 8-bit

No alignment requirement.

Width stride: Round up the width to the nearest multiple of 16.

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: Round up the width to the nearest multiple of 16.

Height stride: No alignment requirement. The value is the same as height.

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

Width stride: No alignment requirement. The value is the same as width.

Height stride: No alignment requirement. The value is the same as height.

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

YUV420SP NV12 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.

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: Round up the width to the nearest multiple of 16.

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.

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

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

YUV420SP NV21 8-bit

YUV422SP 8-bit

Width: Must be a multiple of 2.

Height: No alignment requirement.

Width stride: Round up the width to the nearest multiple of 16.

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

Buffer size (in bytes) = Width stride x Height stride x 2

Width stride: Round up the width to the nearest multiple of 16.

Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 2

Width stride: No alignment requirement. The value is the same as width.

Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 2

YVU422SP 8-bit

YUV444SP 8-bit

No alignment requirement.

Width stride: Round up the width to the nearest multiple of 16.

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

Buffer size (in bytes) = Width stride x Height stride x 3

Width stride: Round up the width to the nearest multiple of 16.

Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 3

Width stride: No alignment requirement. The value is the same as width.

Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 3

YVU444SP 8-bit

YUV422 Packed YUYV 8-bit

Width: Must be a multiple of 2.

Height: No alignment requirement.

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

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

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

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

Height stride: No alignment requirement. The value is the same as height.

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

Width stride = Width x 2

Height stride: No alignment requirement. The value is the same as height.

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

YUV422 Packed UYVY 8-bit

YUV422 Packed YVYU 8-bit

YUV422 Packed VYUY 8-bit

YUV444 Packed 8-bit

No alignment requirement.

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

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

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

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

Height stride: No alignment requirement. The value is the same as height.

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

Width stride = Width x 3

Height stride: No alignment requirement. The value is the same as height.

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

RGB888

BGR888

ARGB8888

No alignment requirement.

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

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

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

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

Height stride: No alignment requirement. The value is the same as height.

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

Width stride = Width x 4

Height stride: No alignment requirement. The value is the same as height.

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

ABGR8888

RGBA8888

BGRA8888

Only the following versions support this format:

Atlas inference products

Atlas 200I/500 A2 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas A3 training products / Atlas A3 inference products

YUV440SP 8bit

Width: No alignment requirement.

Height: Must be a multiple of 2.

-

Width stride: Round up the width to the nearest multiple of 16.

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

Buffer size (in bytes) = Width stride x Height stride x 2

Width stride: No alignment requirement. The value is the same as width.

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

Buffer size (in bytes) = Width stride x Height stride x 2

YVU440SP 8bit

Only the following versions support this format:

Atlas 200I/500 A2 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas A3 training products / Atlas A3 inference products

YVU420Planar

Width is 2-pixel aligned; height is 2-pixel aligned.

-

-

Width stride: No alignment requirement. The value is the same as width.

Height stride: No alignment requirement. The value is the same as height.

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

YUV420Planar

YVU422Planar

No alignment requirement.

Width stride: No alignment requirement. The value is the same as width.

Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 2

YUV422Planar

YVU444Planar

No alignment requirement.

Width stride: No alignment requirement. The value is the same as width.

Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 3

YUV444Planar

YVU444Packed 8bit

No alignment requirement.

Width stride: No alignment requirement. Width stride = Width x 3.

Height stride: No alignment requirement. The value is the same as height.

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

YUV440Planar

Width: No alignment requirement, but the width must be ≤ 4096.

Height: Must be a multiple of 2.

Width stride: No alignment requirement. The value is the same as width.

Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 2

YVU440Planar

RGB888Planar

No alignment requirement.

Width stride: No alignment requirement. The value is the same as width.

Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 3

BGR888Planar

Atlas A2 training products / Atlas A2 inference products

Atlas A3 training products / Atlas A3 inference products

YUV400 FP32

No alignment requirement.

-

-

Width stride: No alignment requirement. Width stride = Width x 3. Height stride: No alignment requirement. The value is the same as height.

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

RGB888 FP32

BGR888 FP32

RGB888Planar FP32

BGR888Planar FP32

No alignment requirement.

Width stride: No alignment requirement. The value is the same as width. Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 3

Table 2 Restrictions on the output 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 products

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

General format, supported by all versions

YUV420SP NV12 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.

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: Round up the width to the nearest multiple of 16.

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.

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

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

YUV420SP NV21 8-bit

Only the following versions support this format:

Atlas inference products

Atlas 200I/500 A2 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas A3 training products / Atlas A3 inference products

YUV400 8-bit

No alignment requirement.

-

Width stride: Round up the width to the nearest multiple of 16.

Height stride: No alignment requirement. The value is the same as height.

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

Width stride: No alignment requirement. The value is the same as width. Height stride: No alignment requirement. The value is the same as height.

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

YUV422SP 8-bit

Width: Must be a multiple of 2.

Height: No alignment requirement.

Width stride: Round up the width to the nearest multiple of 16.

Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 2

Width stride: No alignment requirement. The value is the same as width. Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 2

YVU422SP 8-bit

YUV444 Packed 8-bit

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. The value is the same as height.

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

Width stride = Width x 3. Height stride: No alignment requirement. The value is the same as height.

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

RGB888

BGR888

ARGB8888

No alignment requirement.

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

Height stride: No alignment requirement. The value is the same as height.

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

Width stride = Width x 4. Height stride: No alignment requirement. The value is the same as height.

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

ABGR8888

RGBA8888

BGRA8888

Only the following versions support this format:

Atlas 200I/500 A2 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas A3 training products / Atlas A3 inference products

YVU444 Packed

No alignment requirement.

-

-

Width stride = Width x 3. Height stride: No alignment requirement. The value is the same as height.

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

RGB888Planar

BGR888Planar

No alignment requirement.

-

-

Width stride: No alignment requirement. The value is the same as width. Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 3

Only the following versions support this format:

Atlas A2 training products / Atlas A2 inference products

Atlas A3 training products / Atlas A3 inference products

YUV400 FP32

RGB888 FP32

BGR888 FP32

No alignment requirement.

-

-

Width stride: No alignment requirement. Width stride = Width x 3. Height stride: No alignment requirement. The value is the same as height.

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

RGB888Planar FP32

BGR888Planar FP32

No alignment requirement.

Width stride: No alignment requirement. The value is the same as width. Height stride: No alignment requirement. The value is the same as height.

Buffer size (in bytes) = Width stride x Height stride x 3

Restrictions on Image Cropping and Pasting

Product Version

Restrictions on Image Cropping and Pasting

Atlas training products

  • The crop ROI must not be larger than the input image.
  • The paste ROI must not be larger than the output image. A maximum of 256 paste ROIs are supported.
  • The left offset of the paste ROI relative to the output image is 16-pixel aligned.
    • The paste ROI can be directly aligned on the leftmost side of the output image, that is, with zero left offset relative to the output image. Zero also meets the 16-pixel alignment requirement.
    • It is recommended that the paste ROI width be rounded up to the nearest multiple of 16. Otherwise, invalid extra data will be padded to meet the alignment requirement. As shown in Figure 4 and Figure 5, the green region indicates invalid data.
    • For resizing with the aspect ratio preserved, the left offset for pasting must be a multiple of 16. Therefore, the acl.media.dvpp_vpc_crop_resize_paste_async call may result in paste ROI deviation from the center of the output image. In this case, you can add the acl.media.dvpp_vpc_batch_crop_resize_make_border_async call to implementing the cropping, resizing, and padding functions together.
  • The restrictions on the odd and even numbers of the crop and paste ROIs are as follows:

    Only the output image is in YUV420SP format. The left offset and top offset of the paste ROI must be even numbers, and the right offset and bottom offset must be odd numbers.

  • For image resizing, the aspect ratio ranges of the paste and crop ROIs are [1/32, 16].
  • In inference scenarios, when the VPC output is used as the input of model inference, width x height of the valid paste ROI must be a multiple of 16 x 2. If this requirement is not met, the paste ROI may contain invalid data for padding. In this case, you need to use AIPP to crop the valid ROI and remove invalid data to ensure inference accuracy.

Atlas inference products

  • The crop ROI must not be larger than the input image.
  • The paste ROI must not be larger than the output image. A maximum of 256 paste ROIs are supported.
  • The left offset of the paste ROI relative to the output image is 16-pixel aligned.
    • The paste ROI can be directly aligned on the leftmost side of the output image, that is, with zero left offset relative to the output image. Zero also meets the 16-pixel alignment requirement.
    • It is recommended that the paste ROI width be rounded up to the nearest multiple of 16. Otherwise, invalid extra data will be padded to meet the alignment requirement. As shown in Figure 4 and Figure 5, the green region indicates invalid data.
    • For resizing with the aspect ratio preserved, the left offset for pasting must be a multiple of 16. Therefore, the acl.media.dvpp_vpc_crop_resize_paste_async call may result in paste ROI deviation from the center of the output image. In this case, you can add the acl.media.dvpp_vpc_batch_crop_resize_make_border_async call to implementing the cropping, resizing, and padding functions together.
  • The restrictions on the odd and even numbers of the crop and paste ROIs are as follows:

    If the output image is in YUV420SP format, the left offset and top offset of the paste ROI must be even numbers, and the right offset and bottom offset must be odd numbers.

    If the output image is in YUV422SP format, the left offset must be an even number and the right offset must be an odd number.

    For other formats, there are no such limits.

Atlas 200I/500 A2 inference products

  • The crop ROI must not be larger than the input image.
  • The paste ROI must not be larger than the output image. A maximum of 256 paste ROIs are supported.
  • The restrictions on the odd and even numbers of the crop and paste ROIs are as follows:

    The cropping start coordinates are not restricted to odd or even numbers.

    YUV420: The left offset and top offset of the paste ROI must be even numbers, and the right offset and bottom offset must be odd numbers.

    If the output image is in YUV422 format, the left offset must be an even number and the right offset an odd number.

Atlas A2 training products / Atlas A2 inference products

  • The crop ROI must not be larger than the input image.
  • The paste ROI must not be larger than the output image. A maximum of 256 paste ROIs are supported.
  • The restrictions on the odd and even numbers of the crop and paste ROIs are as follows:

    The cropping start coordinates are not restricted to odd or even numbers.

    YUV420: The left offset and top offset of the paste ROI must be even numbers, and the right offset and bottom offset must be odd numbers.

    If the output image is in YUV422 format, the left offset must be an even number and the right offset an odd number.

Atlas A3 training products / Atlas A3 inference products

  • The crop ROI must not be larger than the input image.
  • The paste ROI must not be larger than the output image. A maximum of 256 paste ROIs are supported.
  • The restrictions on the odd and even numbers of the crop and paste ROIs are as follows:

    The cropping start coordinates are not restricted to odd or even numbers.

    YUV420: The left offset and top offset of the paste ROI must be even numbers, and the right offset and bottom offset must be odd numbers.

    If the output image is in YUV422 format, the left offset must be an even number and the right offset an odd number.

Restrictions on Downsampling of YUV Images

VPC converts the input image format to YUV444 or RGB for internal processing based on the input or output image format. YUV444 or RGB output format has no restriction on the odd and even numbers of the width and height, while the YUV420SP or YUV422SP output format, which performs downsampling processing, has such restrictions due to the data format. Therefore, abnormal data may exist on the output image boarders.

Figure 1 Example of abnormal images

The root cause is that during the calculation, when the output image is at an odd start point, the image is correct for the YUV444 format. However, when the YUV420SP format is downsampled, the odd and even lines share the same UV. In this case, the Y of the start line and the UV of the previous line form a new pixel and abnormal data is generated.