NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
NvMedia2DLdcWarpMapParameters Struct Reference

Detailed Description

Holds the NvMedia definition of an LDC Warp Map.

Warp Map stores the mappings of each control point from destination image to input image.

When NvMedia2DCapabilities::usesLdcRegionConfig is true: The coordinates of control points in a destination image are defined by regionParams. If warp map region N has controlPointXSpacingLog2[N] = 0 it is considered to have "full columns", and with controlPointYSpacingLog2[N] = 0 "full rows". Otherwise, the region has "sparse columns/rows".

The warp map processing always operates on "tiles" of size NvMedia2DCapabilities::tileWidth x NvMedia2DCapabilities::tileHeight pixels. When determining the number of control points in warp map region N, regionWidth[N] is rounded up to the next multiple of tile width and regionHeight[N] to the next multiple of tile height.

In a warp map region with full columns/rows, the number of columns/rows of control points equals the tile size rounded up width/height of the region.

In a warp map region with sparse columns/rows,

  • First control point column/row is at position 0 within the region.
  • There's always an odd number of columns/rows of control points.
  • The position of the last control point column/row is always outside the tile size rounded up width/height of the region.

For example, if region width is 192 and control point interval is 64, it will result in 5 columns of control points with X-coordinates 0, 64, 128, 192 and 256.

The code below shows how to calculate the exact number of control points for a single region:

...
w = RoundUp(regionInfo.regionWidth[i], caps.tileWidth);
dx = 1 << regionInfo.controlPointXSpacingLog2[i];
numColumns = RoundUp(w, 2 * dx) / dx + (dx == 1 ? 0 : 1);
h = RoundUp(regionInfo.regionHeight[i], caps.tileHeight);
dy = 1 << regionInfo.controlPointYSpacingLog2[i];
numRows = RoundUp(h, 2 * dy) / dy + (dy == 1 ? 0 : 1);

Where RoundUp() rounds the first argument up to the nearest multiple of the second argument.

When NvMedia2DCapabilities::usesLdcRegionConfig is false: The warp map operates as a simple rectangular grid where regionParams is ignored. The control points are evenly distributed across the output surface dimensions with the grid size determined by maxWarpMapWidth × maxWarpMapHeight from NvMedia2DLdcWarpMapAttributes.


Usage considerations

  • Maturity: GA
See also
NvMedia2DCapabilities
NvMedia2DLdcRegionParameters
NvMedia2DFillLdcWarpMap()
NvMedia2DSetSrcLdcTransformMatrix()

Definition at line 952 of file nvmedia_2d.h.

Collaboration diagram for NvMedia2DLdcWarpMapParameters:

Data Fields

NvMedia2DLdcRegionParameters regionParams
 Specifies the regions paramters. More...
 
uint32_t numControlPoints
 Number of control points in the controlPoints array. More...
 
const NvMedia2DLdcControlPoint * controlPoints
 Array of control points across all the regions stored in a row-major order. More...
 

Field Documentation

◆ controlPoints

const NvMedia2DLdcControlPoint* NvMedia2DLdcWarpMapParameters::controlPoints

Array of control points across all the regions stored in a row-major order.

Definition at line 971 of file nvmedia_2d.h.

◆ numControlPoints

uint32_t NvMedia2DLdcWarpMapParameters::numControlPoints

Number of control points in the controlPoints array.

When NvMedia2DCapabilities::usesLdcRegionConfig is true, must equal the number of control points specified by regionParams. When NvMedia2DCapabilities::usesLdcRegionConfig is false, must equal maxWarpMapWidth * maxWarpMapHeight from the warp map attributes.

Definition at line 967 of file nvmedia_2d.h.

◆ regionParams

NvMedia2DLdcRegionParameters NvMedia2DLdcWarpMapParameters::regionParams

Specifies the regions paramters.

Ignored when NvMedia2DCapabilities::usesLdcRegionConfig is false.

Definition at line 958 of file nvmedia_2d.h.


The documentation for this struct was generated from the following file:
NvMedia2DCapabilities
Capabilities of the NvMedia2D context.
Definition: nvmedia_2d.h:460
NvMedia2DLdcRegionParameters::regionWidth
uint32_t regionWidth[NVMEDIA_2D_MAX_LDC_REGIONS_X]
Holds the width of regions.
Definition: nvmedia_2d.h:830
NvMedia2DCapabilities::tileWidth
uint32_t tileWidth
Width of the tiles the HW processes the surfaces in.
Definition: nvmedia_2d.h:484
NvMedia2DLdcRegionParameters::regionHeight
uint32_t regionHeight[NVMEDIA_2D_MAX_LDC_REGIONS_Y]
Holds the height of regions.
Definition: nvmedia_2d.h:833
NvMedia2DLdcRegionParameters::controlPointYSpacingLog2
uint32_t controlPointYSpacingLog2[NVMEDIA_2D_MAX_LDC_REGIONS_Y]
Holds the vertical interval between the control points in each region in log2 space.
Definition: nvmedia_2d.h:841
NvMedia2DLdcRegionParameters::controlPointXSpacingLog2
uint32_t controlPointXSpacingLog2[NVMEDIA_2D_MAX_LDC_REGIONS_X]
Holds the horizontal interval between the control points in each region in log2 space.
Definition: nvmedia_2d.h:837
NvMedia2DCapabilities::tileHeight
uint32_t tileHeight
Height of the tiles the HW processes the surfaces in.
Definition: nvmedia_2d.h:487
NvMedia2DLdcRegionParameters
Holds the NvMedia LDC region configuration.
Definition: nvmedia_2d.h:819