hbVPRemap
The visual operator hbVPRemap needs to prepare hbVPRemapParam to get hbVPMapWrap for executing the remap task before doing the creation of the task.
Note
- The underlying gdc only supports bilinear interpolation, and does not need to configure borderType padValue parameter;
- Since the implementation principle of gdc is different from that of dsp, the accuracy of the image output by gdc and dsp from the same map will be different;
- GDC has the following requirements for map:
- Map coordinates must be positive numbers;
- Try to keep the sampling points in the same row with a smooth transition. If the transition between two points changes sharply, the accuracy of the spline will not be enough to handle it;
- Four sampling points cannot form a triangle;
- If the sampling accuracy is insufficient, it may cause aliasing, distortion, etc. In this case, it is recommended to use subpixel coordinates.
-
Member
Note
Note that the data layout in map (i.e. the memory data under the physical address of phyAddr) is x_0, y_0, x_1, y_1, ..., and the memory length should be 2 * mapWidth * mapHeight * sizeof(dataType), please refer to the sample for detailed usage.
- When the task is deployed on a GDC, srcWidth and mapWidth are in the range [96, 3840], and srcHeight and mapHeight are in the range [96, 2160] and satisfy: mapWidth <= srcWidth, mapHeight <= srcHeight. Since GDC has data alignment restrictions, mapWidth needs to be 16 aligned, which means that when srcWidth does not meet 16 alignment, the mapWidth will be less than srcWidth. The stride of the input and output is aligned to 16 in the width direction, that is, the stride range of the input and output is [96,3840]. When allocating memory, please use the height and stride size as the criteria.
- When the task is deployed on a DSP, srcWidth and dstWidth range [32, 4096] and srcHeight and dstHeight range [16, 2160].
hbVPRemap the operator's argument description handle, which contains the description information necessary to run on different Backend, can be reused.
Creates the mapWrap parameter of the Remap.
- Parameter
- [out]
mapWrapCreated parameter that are used in the interface, the parameter must point to nullptr. - [in]
paramThe remap parameter, which is used to create a uniform mapWrap parameter. - [in]
backendSelect the backend hardware, different hardware backend need to prepare different hardware resources for the map.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
Note
- hbVPCreateMapWrap is used to create map resources for remap. Since different backends require different hardware resources to be prepared, it is necessary to specify the backend here to determine which resource the map applies to.
- Interface support hardware resources for GDC, DSP. When specifying DSP deployment resources, backend needs to be set according to the hardware configuration of the development board. For example, on a single-core DSP development board, backend can be: HB_UCP_DSP_CORE_ANY, HB_UCP_DSP_CORE_0.
- Supports specifying both dsp and gdc backends at the same time, creating two hardware map resources respectively, such as: backend=HB_UCP_GDC_CORE_0|HB_UCP_DSP_CORE_ANY (specifies the hardware resources to create two kinds of backends, GDC and DSP, and the parameter needs to satisfy the constraints on the sizes of GDC and DSP at the same time, HB_UCP_CORE_ANY cannot be ORed with other backends).
Release the mapWrap parameter of the Remap.
- Parameter
- [in]
mapWrapThe mapWrap parameter to be released.
- [in]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
The API for calling the Remap.
- Parameter
- [out]
taskHandleTask handles are responsible for the interaction of the operator with the UCP architecture. - [out]
dstImgThe output picture, type and format are the same as the input picture, the size is the same as the map. - [in]
srcImgInput picture, type support U8C1, format dsp hardware support Y and nv12, gdc support nv12. - [in]
mapWrapPoint to the map parameter.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
