hbVPPyrDown

typedef struct {
  int8_t levels;
  hbVPInterpolationType interpolation;
} hbVPPymParam;

Pym configuration parameter structure.

  • Member

    Member NameDescription
    levelsSelect the number of pyramid activation layers.
    interpolationSelects a pyramid interpolation method that supports the GAUSSIAN and LINEAR types in hbVPInterpolationType.
int32_t hbVPPyrDown(hbUCPTaskHandle_t *taskHandle,
                    hbVPImage *dstImgs,
                    hbVPImage const *srcImg
                    hbVPPymParam const *pymCfg);
Note

When using a bilinear pyramid, the size of the input image must be within the range of [64, 4096], and the size of the output image of each layer must be within the range of [32, 4096]. When using bilinear pyramids to process 10-bit and 12-bit images, it's important to note that the task only supports running on J6B's HB_UCP_PYRAMID_CORE_0. Here, 10-bit and 12-bit refer only to the pixel width of the y-channel; the uv-channel remains 8 bits. Furthermore, the 10-bit and 12-bit y-data needs to be stored in 16-bit MSB format, meaning one pixel occupies two bytes of space. The stride of the input and output images must be aligned 16 bytes along the width direction, satisfying the range [ALIGNED_16(width) * bytes_per_pixel, 4096 * bytes_per_pixel], where bytes_per_pixel is the number of bytes per pixel. Specifically, it is set as stride = ALIGN_UP(width, 16u) * bytes_per_pixel. Since the UV channels only support 8-bit calculations, when calculating uvStride, bytes_per_pixel = 1 in the above constraints and calculation method.

The API for calling the PyrDown.

  • Parameter
    • [out] taskHandle Task handles are responsible for the interaction of the operator with the UCP architecture.
    • [out] dstImgs Outputs an array of pictures, with the type and format of each layer consistent with the input pictures, and the width and height of each layer being half of the previous picture,respectively. The rounding strategies are: upward rounding for Gaussian pyramids and downward rounding for bilinear pyramids.
    • [in] srcImg Input picture, gaussian pyramids support type U8C1 and format Y and nv12; bilinear pyramids support type U8C1 and U16C1 and format nv12, nv12_y10c8_msb and nv12_y12c8_msb.
    • [in] pymCfg Input pyramid configuration structures, pyramid supports 1 to 5 levels of computation. Specifically, the J6B platform only supports 1 to 3 layers of computing.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.