Restrictions
The concepts of 8K and non-8K in this section are described as follows:
- Non-8K: Width × Height is in the range of (10 × 6, 4096 × 4096].
- 8K: The width or height is in the range of (4096, 8192].
Resolution Restrictions
- Input resolution range:
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:
Model
Resolution Range
Atlas inference products Atlas training products 10 × 6 to 4096 × 4096
Atlas A3 training products /Atlas A3 inference products Atlas A2 training products /Atlas A2 inference products Atlas 200I/500 A2 inference products 10 × 6 to 4096 × 8192
Restrictions on Image Formats, Width and Height Alignment, and Buffers
During image processing by VPC, acldvppMalloc and acldvppFree 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 image formats and width and height alignment, see Table 1 and Table 2. For details about the input image formats supported in the 8K scenario, see Table 3.
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 with different versions:
Atlas A3 training products /Atlas A3 inference products : The width stride ranges from 10 to 16384 (4096 × 4). For a 4096-pixel ARGB image, one pixel occupies four bytes, and a line of pixels occupies 4096 × 4. The height stride ranges from 6 to 16384.Atlas A2 training products /Atlas A2 inference products : The width stride ranges from 10 to 16384 (4096 × 4). For a 4096-pixel ARGB image, one pixel occupies four bytes, and a line of pixels occupies 4096 × 4. The height stride ranges from 6 to 16384.Atlas 200I/500 A2 inference products : The width stride ranges from 10 to 16384 (4096 × 4). For a 4096-pixel ARGB image, one pixel occupies four bytes, and a line of pixels occupies 4096 × 4. The height stride ranges from 6 to 16384.Atlas inference products : The width stride ranges from 32 to 16384 (4096 × 4). For a 4096-pixel ARGB image, one pixel occupies four bytes, and a line of pixels occupies 4096 × 4. The height stride ranges from 6 to 16384.Atlas training products : The width stride ranges from 32 to 16384 (4096 × 4). For a 4096-pixel ARGB image, one pixel occupies four bytes, and a line of pixels occupies 4096 × 4. The height stride ranges from 6 to 16384.
|
Model |
Input Format |
Input Width and Height |
Input Width Stride, Height Stride, and Buffer Size |
Input Width Stride, Height Stride, and Buffer Size |
Input Width Stride, Height Stride, and Buffer Size |
|---|---|---|---|---|---|
|
General format, supported by all models |
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 × Height stride × 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 × 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 × 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 × Height stride × 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 × Height stride × 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 × Height stride × 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 × Height stride × 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 × Height stride × 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 × Height stride × 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 × Height stride × 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 × Height stride × 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 × Height stride × 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 × 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 × Height stride |
Width stride = Width × 2 Height stride: No alignment requirement. The value is the same as height. Buffer size (in bytes) = Width stride × 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 × 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 × Height stride |
Width stride = Width × 3 Height stride: No alignment requirement. The value is the same as height. Buffer size (in bytes) = Width stride × 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 × 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 × Height stride |
Width stride = Width × 4 Height stride: No alignment requirement. The value is the same as height. Buffer size (in bytes) = Width stride × Height stride |
|
|
ABGR8888 |
|||||
|
RGBA8888 |
|||||
|
BGRA8888 |
|||||
|
Only the following models support this format: |
YUV440SP 8-bit |
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 × Height stride × 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 × Height stride × 2 |
|
YVU440SP 8-bit |
|||||
|
Only the following models support this format: |
YVU420 Planar |
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. Height stride: No alignment requirement. The value is the same as height. Buffer size (in bytes) = Width stride × Height stride × 3/2 |
|
YUV420 Planar |
|||||
|
YVU422 Planar |
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 × Height stride × 2 |
|||
|
YUV422 Planar |
|||||
|
YVU444 Planar |
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 × Height stride × 3 |
|||
|
YUV444 Planar |
|||||
|
YVU444 Packed 8-bit |
No alignment requirement. |
Width stride: No alignment requirement. Width stride = Width × 3. Height stride: No alignment requirement. The value is the same as height. Buffer size (in bytes) = Width stride × Height stride |
|||
|
YUV440 Planar |
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 × Height stride × 2 |
|||
|
YVU440Planar |
|||||
|
RGB888 Planar |
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 × Height stride × 3 |
|||
|
BGR888 Planar |
|||||
|
Only the following models support this format: |
YUV400 FP32 |
No alignment requirement. |
- |
- |
Width stride: No alignment requirement. Width stride = Width × 3. Height stride: No alignment requirement. The value is the same as height. Buffer size (in bytes) = Width stride × Height stride |
|
RGB888 FP32 |
|||||
|
BGR888 FP32 |
|||||
|
RGB888 Planar FP32 BGR888 Planar FP32 |
No alignment requirement. |
Width stride: Has no alignment requirements but must be the same as width. Height stride: Has no alignment requirements but must be the same as height. Buffer size (in bytes) = Width stride × Height stride × 3 |
|
Version |
Output Format |
Output Width and Height |
Output Width Stride, Height Stride, and Buffer Size |
Output Width Stride, Height Stride, and Buffer Size |
Output Width Stride, Height Stride, and Buffer Size |
|---|---|---|---|---|---|
|
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 × Height stride × 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 × Height stride × 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 × Height stride × 3/2 |
|
YUV420SP NV21 8-bit |
|||||
|
Only the following versions support this format: |
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 × Height stride |
Width stride: Has no alignment requirements but must be the same as width. Height stride: Has no alignment requirements but must be the same as height. Buffer size (in bytes) = Width stride × 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 × Height stride × 2 |
Width stride: Has no alignment requirements but must be the same as width. Height stride: Has no alignment requirements but must be the same as height. Buffer size (in bytes) = Width stride × Height stride × 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 × Height stride |
Width stride: Multiply the width by 3. Height stride: Has no alignment requirements but must be the same as height. Buffer size (in bytes) = Width stride × 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 × Height stride |
Width stride: Multiply the width by 4. Height stride: Has no alignment requirements but must be the same as height. Buffer size (in bytes) = Width stride × Height stride |
||
|
ABGR8888 |
|||||
|
RGBA8888 |
|||||
|
BGRA8888 |
|||||
|
Only the following versions support this format: |
YVU444 Packed |
No alignment requirement. |
- |
- |
Width stride: Multiply the width by 3. Height stride: Has no alignment requirements but must be the same as height. Buffer size (in bytes) = Width stride × Height stride |
|
RGB888 Planar BGR888 Planar |
No alignment requirement. |
- |
- |
Width stride: Has no alignment requirements but must be the same as width. Height stride: Has no alignment requirements but must be the same as height. Buffer size (in bytes) = Width stride × Height stride × 3 |
|
|
Only the following versions support this format: |
YUV400 FP32 RGB888 FP32 BGR888 FP32 |
No alignment requirement. |
- |
- |
Width stride: No alignment requirement. Width stride = Width × 3. Height stride: No alignment requirement. The value is the same as height. Buffer size (in bytes) = Width stride × Height stride |
|
RGB888 Planar FP32 BGR888 Planar FP32 |
No alignment requirement. |
Width stride: Has no alignment requirements but must be the same as width. Height stride: Has no alignment requirements but must be the same as height. Buffer size (in bytes) = Width stride × Height stride × 3 |
In the 8K scenario, the input image formats supported by each model are different, as listed in the following table.
|
Model |
Supported Input Image Formats |
|---|---|
|
|
YUV420SP NV12 8-bit, YUV420SP NV21 8-bit |
|
|
|
Restrictions on Image Cropping and Pasting
|
Product Version |
Restrictions on Image Cropping and Pasting |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
The root cause is that during the computation, 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.