hbVPImage

typedef struct hbVPImage {
  uint8_t imageFormat;
  uint8_t imageType;
  int32_t width;
  int32_t height;
  int32_t stride;
  void *dataVirAddr;
  uint64_t dataPhyAddr;
  void *uvVirAddr;
  uint64_t uvPhyAddr;
  int32_t uvStride;
} hbVPImage;

Picture Structure. Only BPU memory is supported.

Picture channel description: take HB_VP_IMAGE_FORMAT_RGB as an example, when the number of channels is 3, the imageType is HB_VP_IMAGE_TYPE_U8C3. When the number of channels is 4, the data exists an extra memory due to alignment requirements, at this time it is necessary to specify the imageType as HB_VP_IMAGE_TYPE_U8C4 (RRR* GGG* BBB*).

  • Member

    Member NameDescription
    imageFormatPicture format.
    imageTypePicture type.
    widthThe pixel width of the picture.
    heightThe pixel height of the picture.
    strideThe pixel offset of the picture, expressed as a number of bytes.
    dataVirAddrThe logical address of the picture on the arm side.
    dataPhyAddrThe physical address of the picture.
    uvVirAddrThe uv data logical address when the picture format is NV12.
    uvPhyAddrThe uv data physical address when the picture format is NV12.
    uvStrideThe offset of the uv data when the picture format is NV12, expressed as the number of bytes.

Offset description: stride is in the range [bytes_per_pixel * width, bytes_per_pixel * MAX_IMAGE_WIDTH] and satisfies the bytes_per_pixel alignment. The bytes_per_pixel indicate the number of bytes per pixel, the size of which depends on the picture format imageType, width indicates the pixel width of the picture, MAX_IMAGE_WIDTH indicates the maximum width of the picture pixels. When the picture format is NV12, uvStride ranges from [2*uv_width, MAX_IMAGE_WIDTH] and must be even. When using pyramid and gdc hardware, the values ​​of stride and uvStride should be greater than or equal to the width and meet the 16-byte alignment requirement.

When the image format is NV12, if it is 8-bit, the imageType should be set to HB_VP_IMAGE_TYPE_U8C1. If it is 10-bit or 12-bit, the imageType should be set to HB_VP_IMAGE_TYPE_U16C1, indicating that the channel data is aligned to 16-bit storage. Specifically, if the imageFormat is set to HB_VP_IMAGE_FORMAT_NV12_Y10C8_MSB or HB_VP_IMAGE_FORMAT_NV12_Y12C8_MSB, it means only the Y component has a pixel width of 10-bit or 12-bit and is aligned to 16-bit storage, while the UV components still have an 8-bit pixel width. When the image is in multi-plane formats such as RGB_P, BGR_P, or YUV444_P, the imageType should be set according to the actual data type of the elements to the corresponding single-channel type. For example, for 3-channel multi-plane data in S16 format, choose HB_VP_IMAGE_TYPE_S16C1.