hi_vdec_pic_info
Description
Defines a source video frame.
Prototype
typedef struct {
hi_u32 width;
hi_u32 height;
hi_u32 width_stride;
hi_u32 height_stride;
hi_pixel_format pixel_format;
hi_u64 vir_addr;
hi_u32 buffer_size;
hi_s16 offset_top;
hi_s16 offset_bottom;
hi_s16 offset_left;
hi_s16 offset_right;
}hi_vdec_pic_info;
Members
Member |
Description |
|---|---|
width |
Image width, used for video decoding. |
height |
Image height, used for video decoding. |
width_stride |
Image width stride. For details about the configuration restrictions on the width stride during video decoding, see VDEC Functions and Restrictions. Value range: [32, 16384] |
height_stride |
Image height stride. For details about the configuration restrictions on the height stride during video decoding, see VDEC Functions and Restrictions. Value range: [6, 16384] |
pixel_format |
Pixel format, used for image or video decoding. For the supported VDEC output formats, see VDEC Functions and Restrictions. For the supported JPEGD output formats, see JPEGD Functions and Restrictions. |
vir_addr |
Start address of the output data in the memory. In the interlaced scenario where two fields are transmitted every frame, one of every two transmitted fields has no decoding output. This is expected. The decoding output of an interlaced stream is stored in the output buffers of the odd fields. In this case, you need to free the buffers in time. |
buffer_size |
Size of the decoding output buffer. |
offset_top |
Top offset of the decoded region to the original image. This parameter is required when JPEG images are decoded based on the specified region, as shown in Figure 1. If JPEG images do not need to be decoded based on the specified region, initialize this parameter to 0. |
offset_bottom |
Bottom offset of the decoded region to the original image. This parameter is required when JPEG images are decoded based on the specified region, as shown in Figure 1. If JPEG images do not need to be decoded based on the specified region, initialize this parameter to 0. |
offset_left |
Left offset of the decoded region to the original image. This parameter is required when JPEG images are decoded based on the specified region, as shown in Figure 1. If JPEG images do not need to be decoded based on the specified region, initialize this parameter to 0. |
offset_right |
Right offset of the decoded region to the original image. This parameter is required when JPEG images are decoded based on the specified region, as shown in Figure 1. If JPEG images do not need to be decoded based on the specified region, initialize this parameter to 0. |
Considerations
The 10-bit data becomes 8-bit data after VPC image processing.
References
The following figure shows the function of decoding a JPEG image by region.
The restrictions on regional decoding are as follows:
- In JPEG image decoding by region, rotation and software decoding are not supported.
- The size of the region to be decoded cannot exceed that of the original image. The minimum size is 32 x 32, and the maximum size is 16384 x 16384.
- When the following image formats are used, restrictions on the offset values are as follows:
- HI_PIXEL_FORMAT_YUV_SEMIPLANAR_420 or HI_PIXEL_FORMAT_YVU_SEMIPLANAR_420 format: The values of offset_top and offset_left must be even numbers, and the values of (height - offset_bottom) and (width - offset_right) also must be even numbers.
- HI_PIXEL_FORMAT_YUV_SEMIPLANAR_422 or HI_PIXEL_FORMAT_YVU_SEMIPLANAR_422 format: The value of offset_left must be an even number, and the value of (width - offset_right) also must be an even number.
- HI_PIXEL_FORMAT_YUV_SEMIPLANAR_440 or HI_PIXEL_FORMAT_YVU_SEMIPLANAR_440 format: The value of offset_top must be an even number, and the value of (height - offset_bottom) also must be an even number.
