However, after calling vpiWarpMapAllocData(), map.numHorizPoints and map.numVertPoints are not equal to dst_width and dst_height, but are rounded up to the nearest multiple of 64 and 16 respectively. Looking through the documentation, I can’t find a restriction on resolution to be a multiple. I only see restrictions on the minimum width and height. Is it required that width and height be multiples of 64 and 16? I’m running JetPack 4.6 and vpi 1.1. Also, I would expect vpiWarpMapAllocData() to generate an error instead of succeeding with rounded values. I’m also curious what happens when vpiSubmitRemap is called and the output image dimensions don’t match the width/height of the warp. Is that behavior defined? It also doesn’t seem to generate an error.
I ended up working around this by allocating extra memory for the output image (so it could be treated as having the rounded up width and height when using vpi remap), and then ignoring the extra rows on the bottom and columns on the side in later processing. I’m wondering if this is fixed in later JetPack versions? The vpi 2.1 release notes under bug fixes says:
Just for your reference.
The restrictions info can be found in JetPack5.0.2.
/opt/nvidia/vpi2/include/vpi/WarpGrid.h
#define VPI_WARPGRID_MIN_REGION_WIDTH 64 /**< Minimum warp grid region width. */
#define VPI_WARPGRID_MIN_REGION_HEIGHT 16 /**< Minimum warp grid region height. */
...
* ### Restrictions
*
* * numHorizRegions cannot exceed \ref VPI_WARPGRID_MAX_HORIZ_REGIONS_COUNT.
* * numVertRegions cannot exceed \ref VPI_WARPGRID_MAX_VERT_REGIONS_COUNT.
* * Intervals must be power-of-two.
* * Alignment restrictions:
* + `regionWidth[0]` to `regionWidth[numHorizRegions-2]` must be
* aligned to \ref VPI_WARPGRID_MIN_REGION_WIDTH and at least \ref VPI_WARPGRID_MIN_REGION_WIDTH.
* + `regionWidth[numHorizRegions-1]` must be at least \ref VPI_WARPGRID_MIN_REGION_WIDTH.
* + `regionHeight[0]` to `regionHeight[numVertRegions-2]` must be
* aligned to \ref VPI_WARPGRID_MIN_REGION_HEIGHT and at least \ref VPI_WARPGRID_MIN_REGION_HEIGHT.
* + `regionHeight[numVertRegions-1]` must be at least \ref VPI_WARPGRID_MIN_REGION_HEIGHT.
*
*/