JPEGE Functions and Restrictions
The
Description
JPEG Encoder (JPEGE) encodes YUV images into JPEG images, for example, .jpg images.
Resolution Restrictions
- Input image resolution range
Version
Resolution Range
Atlas inference product Atlas A2 training product /Atlas A2 inference product Atlas A3 training product /Atlas A3 inference product 32 x 32 to 8192 x 8192
Atlas 200I/500 A2 inference product 32 x 32 to 16384 x 16384
- Output resolution range:
JPEGE only encodes images and does not change the image resolution. Therefore, the resolution of the output image is the same as that of the input image.
Restrictions on Buffer Allocation and Freeing 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 |
Input Buffer Allocation/Freeing API |
Input Buffer Allocation/Freeing API |
|---|---|---|
|
|
During JPEGE image encoding, call acl.himpi.dvpp_malloc/acl.himpi.dvpp_free to allocate or free the input buffer on the device. The buffer lifetime is managed by the user. |
The following two methods are supported:
|
|
|
During JPEGE image encoding, the following two types of buffer allocation/freeing 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. |
The following two methods are supported:
|
Restrictions on Image Formats, Width and Height Alignment, and Buffers
For details about the definition of the input image format, see hi_pixel_format. For details about the concepts such as width stride and height stride, see Terminology.
|
Input Format |
Input Width and Height |
Input Width Stride, Height Stride, and Buffer Size |
Output Format |
|---|---|---|---|
|
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 or any multiple of 16, for example, 128 (which offers better performance). The height stride does not need to be configured. Buffer size (in bytes) = Width stride x Height x 3/2 |
Output format: JPEG, for example, *.jpg Only Huffman coding is supported. Arithmetic coding and progressive coding are not supported. |
|
YUV420SP NV21 8bit |
|||
|
YUV422Packed YUYV 8bit |
Width: Must be a multiple of 2. Height: No alignment requirement. |
Width stride: Double the width and then round up the result to the nearest multiple of 16. The height stride does not need to be configured. Buffer size (in bytes) = Width stride x Height |
|
|
YUV422Packed UYVY 8bit |
|||
|
YUV422Packed YVYU 8bit |
|||
|
YUV422Packed VYUY 8bit |