NVIDIA DRIVE OS Linux API Reference

5.1.0.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvmedia_ldc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. All
3  * information contained herein is proprietary and confidential to NVIDIA
4  * Corporation. Any use, reproduction, or disclosure without the written
5  * permission of NVIDIA Corporation is prohibited.
6  *
7  */
8 
16 #ifndef _NVMEDIA_LDC_H
17 #define _NVMEDIA_LDC_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #include "nvmedia_common.h"
24 #include "nvmedia_image.h"
25 
38 #define NVMEDIA_LDC_VERSION_MAJOR 1
39 
40 #define NVMEDIA_LDC_VERSION_MINOR 2
41 
45 typedef struct NvMediaLDC NvMediaLDC;
46 
48 #define NVMEDIA_LDC_MAX_HOR_REGION 4
49 
51 #define NVMEDIA_LDC_MAX_VER_REGION 4
52 
54 #define NVMEDIA_LDC_MIN_REGION_WIDTH 64
55 
57 #define NVMEDIA_LDC_MIN_REGION_HEIGHT 16
58 
62 typedef enum {
65 
68 
71 
75 
79 typedef enum {
82 
86 
89 
93 
97 typedef enum {
100 
104 
108 
112 
117 
121 typedef struct {
123  float_t fx;
124 
126  float_t fy;
127 
129  float_t cx;
130 
132  float_t cy;
134 
166 typedef struct {
168  float_t k1;
169 
171  float_t k2;
172 
174  float_t k3;
175 
177  float_t k4;
178 
180  float_t k5;
181 
183  float_t k6;
184 
186  float_t p1;
187 
189  float_t p2;
191 
195 typedef struct {
198 
201 
204 
210  float_t R[3][3];
211 
215  float_t T[3];
216 
220 
294 typedef struct {
297  uint8_t numHorRegion;
298 
301  uint8_t numVerRegion;
302 
304  uint16_t horRegionWidth[NVMEDIA_LDC_MAX_HOR_REGION];
305 
307  uint16_t verRegionHeight[NVMEDIA_LDC_MAX_VER_REGION];
308 
311  uint16_t log2horSpace[NVMEDIA_LDC_MAX_HOR_REGION];
312 
315  uint16_t log2verSpace[NVMEDIA_LDC_MAX_VER_REGION];
317 
324 typedef struct {
327  uint16_t width;
328 
331  uint16_t height;
332 
338  void *mapPtr;
339 
343 
347 typedef struct {
351 
354 
359 
369  float_t ptMatrix[3][3];
370 
374 
376  float_t maskY;
377 
379  float_t maskU;
380 
382  float_t maskV;
383 
386 
393 
397 typedef struct {
400 
403 
405  uint16_t rangeSigmaLuma;
406 
409 
413  float_t sadMultiplier;
414 
418  float_t sadWeightLuma;
419 
422 
427 
431  float_t alphaScaleIIR;
432 
436  float_t alphaMaxLuma;
437 
441  float_t alphaMinLuma;
442 
446  float_t alphaMaxChroma;
447 
451  float_t alphaMinChroma;
452 
456  float_t betaX1;
457 
461  float_t betaX2;
462 
466  float_t minBeta;
467 
471  float_t maxBeta;
473 
477 typedef struct {
479  float_t noiseReduction;
483 
487 typedef struct {
490 
496 
502 
508 
514 
518 typedef enum {
521 
526 
534 typedef struct {
536  uint16_t numHorPoints;
537 
539  uint16_t numVerPoints;
540 
542  uint16_t mapStride;
543 
550  void *mapPtr;
551 
557 
561 typedef enum {
564 
567 
570 
574 
578 typedef struct {
586 
599  NvMediaVersion *version
600 );
601 
627  NvMediaLDC **pldc,
628  const uint16_t srcWidth,
629  const uint16_t srcHeight,
630  const NvMediaRect *srcRect,
631  const uint16_t dstWidth,
632  const uint16_t dstHeight,
633  const NvMediaRect *dstRect,
634  const NvMediaLDCInitParams *initParams);
635 
649  NvMediaLDC *ldc
650 );
651 
669  NvMediaLDC *ldc,
670  const NvMediaLDCSparseWarpMap *map);
671 
686  NvMediaLDC *ldc);
687 
706  NvMediaLDC *ldc,
707  const NvMediaTNR3Params *tnr3Params);
708 
785  NvMediaLDC *ldc,
786  NvMediaImage *prevSurface,
787  NvMediaImage *curSurface,
788  NvMediaImage *outputSurface,
789  NvMediaImage *xSobel,
790  NvMediaImage *downSample,
791  const NvMediaLDCCtrlParams *ldcCtrlParams
792 );
793 
796 /*
797  * \defgroup history_nvmedia_ldc History
798  * Provides change history for the NvMedia LDC API.
799  *
800  * \section history_nvmedia_ldc Version History
801  *
802  * <b> Version 1.0 </b> May 1, 2017
803  * - Initial release.
804  *
805  * <b> Version 1.1 </b> March 16, 2018
806  * - Add support of TNR2
807  *
808  * <b> version 1.2 </b> September 4, 2018
809  * - New member variable srcSurfaceType is added to NvMediaLDCInitParams.
810  */
811 
812 #ifdef __cplusplus
813 }
814 #endif
815 
816 #endif // _NvMedia_LDC_H
A handle representing image objects.
Definition: nvmedia_image.h:75
float_t maskY
Holds the Y channel value of the default color.
Definition: nvmedia_ldc.h:376
#define NvMediaSurfaceType
Defines the set of NvMedia surface types.
NvMediaStatus NvMediaLDCUpdateTNR3Params(NvMediaLDC *ldc, const NvMediaTNR3Params *tnr3Params)
Updates TNR3 parameters after NvMediaLDCCreate().
Specifies to produce gradient sobel and disable downsample output.
Definition: nvmedia_ldc.h:569
float_t alphaMinLuma
Specifies the min luma value in Alpha Clip Calculation.
Definition: nvmedia_ldc.h:441
NvMediaGeoTransMode
Defines geometric transform operate modes.
Definition: nvmedia_ldc.h:79
float_t k1
Specifies radial distortion coefficient.
Definition: nvmedia_ldc.h:168
Holds the NvMedia LDC region configuration.
Definition: nvmedia_ldc.h:294
S15.5 is the fixed floating format where the data is stored only in the most significant 20 bits of 3...
Definition: nvmedia_ldc.h:524
uint16_t numHorPoints
Specifies the number of control points in each row.
Definition: nvmedia_ldc.h:536
uint32_t NvMediaBool
A boolean value, holding NVMEDIA_TRUE or NVMEDIA_FALSE.
Definition: nvmedia_core.h:79
Holds distortion coefficients for the lens model.
Definition: nvmedia_ldc.h:166
float_t k4
Specifies radial distortion coefficient.
Definition: nvmedia_ldc.h:177
float_t alphaIncreaseCap
Specifies the temporal alpha restrict increase capablility.
Definition: nvmedia_ldc.h:426
NvMediaLensDistortion distCoeffs
Specifies the distortion coefficients.
Definition: nvmedia_ldc.h:200
NvMediaLDCRegionConfig regionConfig
Specifies the region configure paramters.
Definition: nvmedia_ldc.h:373
NvMediaCamIntriParams K
Specifies the camera intrinsic matrix.
Definition: nvmedia_ldc.h:203
NvMediaLDCMode
Defines the NvMedia LDC operating modes.
Definition: nvmedia_ldc.h:62
float_t alphaMaxChroma
Specifies the max chroma value in Alpha Clip Calculation.
Definition: nvmedia_ldc.h:446
float_t p2
Specifies tangential distortion coefficient.
Definition: nvmedia_ldc.h:189
float_t minBeta
Specifies parameter MinBeta threshold in Beta Calculation.
Definition: nvmedia_ldc.h:466
NVIDIA Media Interface: Image Processing
NvMediaLDCBitMaskMap bitMaskMap
Holds the bit mask map information when bitMaskEnable is NV_TRUE.
Definition: nvmedia_ldc.h:391
float_t maxBeta
Specifies parameter MaxBeta threshold in Beta Calculation.
Definition: nvmedia_ldc.h:471
Holds runtime control parameters for NvMediaLDCProcess().
Definition: nvmedia_ldc.h:578
Specifies to do temporal noise reduction version 3.
Definition: nvmedia_ldc.h:67
float_t p1
Specifies tangential distortion coefficient.
Definition: nvmedia_ldc.h:186
NvMediaStatus NvMediaLDCGetVersion(NvMediaVersion *version)
Returns the version information of NvMedia LDC.
NvMediaStatus NvMediaLDCFeedSparseWarpMap(NvMediaLDC *ldc, const NvMediaLDCSparseWarpMap *map)
Feeds sparse warp map to NvMedia LDC.
Specifies to take sparse warp map from client via NvMediaLDCFeedSparseWarpMap().
Definition: nvmedia_ldc.h:85
NvMediaLDCSobelMode
Defines the xSobel working modes.
Definition: nvmedia_ldc.h:561
NvMediaNoiseReductionAlgorithm
Noise Reduction Algorithm.
NvMediaNoiseReductionAlgorithm noiseReductionAlgorithm
Specifies the noise reduction algorithm.
Definition: nvmedia_ldc.h:481
Fisheye model: r = fsin(theta), where theta is the angle from the optical axis, f is the focal length...
Definition: nvmedia_ldc.h:115
Holds NvMedia Version information.
Definition: nvmedia_core.h:252
Holds the NvMedia LDC initialization paramters.
Definition: nvmedia_ldc.h:487
Polynomial distortion model.
Definition: nvmedia_ldc.h:99
float_t k3
Specifies radial distortion coefficient.
Definition: nvmedia_ldc.h:174
NVIDIA Media Interface: Common Types for Video/Image Encode/Decode
float_t alphaMinChroma
Specifies the min chroma value in Alpha Clip Calculation.
Definition: nvmedia_ldc.h:451
uint16_t numVerPoints
Specifies the number of control points in each column.
Definition: nvmedia_ldc.h:539
float_t betaX2
Specifies parameter BetaX2 in Beta Calculation.
Definition: nvmedia_ldc.h:461
float_t cx
Specifies the optical center in X axis, measured in pixel unit.
Definition: nvmedia_ldc.h:129
Holds geometric transform initialization paramters.
Definition: nvmedia_ldc.h:347
Specifies to produce luma sobel and luma downsample output.
Definition: nvmedia_ldc.h:566
NvMediaCameraModel cameraModel
Specifies the camera model parameters.
Definition: nvmedia_ldc.h:358
float_t maskV
Holds the V channel value of the default color.
Definition: nvmedia_ldc.h:382
NvMediaStatus
The set of all possible error codes.
Definition: nvmedia_core.h:199
NvMediaSurfaceType srcSurfaceType
Specifies source format type for LDC or TNR operation.
Definition: nvmedia_ldc.h:512
uint16_t spatialSigmaLuma
Specifies the sigma of the luma for spatial filter.
Definition: nvmedia_ldc.h:399
Specifies to do affine transform.
Definition: nvmedia_ldc.h:88
NvMediaGeoTransMode geoTransMode
Specifies the geometric transform mode.
Definition: nvmedia_ldc.h:350
float_t alphaMaxLuma
Specifies the max luma value in Alpha Clip Calculation.
Definition: nvmedia_ldc.h:436
uint16_t spatialSigmaChroma
Specifies the sigma of the chroma for spatial filter.
Definition: nvmedia_ldc.h:402
Holds the NvMedia mask map surface.
Definition: nvmedia_ldc.h:324
Holds NvMedia camera intrinsic parameters.
Definition: nvmedia_ldc.h:121
Holds a rectangular region of a surface.
Definition: nvmedia_core.h:146
uint16_t width
Holds the width in bytes of the mask map surface, which must be equal to the width of destination rec...
Definition: nvmedia_ldc.h:327
float_t cy
Specifies the optical center in Y axis, measured in pixel unit.
Definition: nvmedia_ldc.h:132
NvMediaFilterQuality
Defines filter quality levels.
float_t sadWeightLuma
Specifies the weight of luma when calculating SAD.
Definition: nvmedia_ldc.h:418
Specifies to produce gradient sobel and gradient downsample output.
Definition: nvmedia_ldc.h:572
Specifies to do geometric transform.
Definition: nvmedia_ldc.h:64
struct NvMediaLDC NvMediaLDC
Defines the NvMedia LDC handle as an opaque struct.
Definition: nvmedia_ldc.h:45
Specifies to do perspective transform.
Definition: nvmedia_ldc.h:91
NvMediaStatus NvMediaLDCCreate(NvMediaLDC **pldc, const uint16_t srcWidth, const uint16_t srcHeight, const NvMediaRect *srcRect, const uint16_t dstWidth, const uint16_t dstHeight, const NvMediaRect *dstRect, const NvMediaLDCInitParams *initParams)
Creates an NvMedia LDC handle.
uint16_t height
Holds the height in bytes of the mask map surface, which must be equal to the height of the destinati...
Definition: nvmedia_ldc.h:331
float_t alphaScaleIIR
Specifies the alpha scale IIR for strength.
Definition: nvmedia_ldc.h:431
NvMediaTNR3Params tnr3Params
Specifies TNR3 initialization paramters.
Definition: nvmedia_ldc.h:501
float_t sadMultiplier
Specifies the SAD multiplier parameter.
Definition: nvmedia_ldc.h:413
float_t k6
Specifies radial distortion coefficient.
Definition: nvmedia_ldc.h:183
Specifies to do temporal noise reduction version 2.
Definition: nvmedia_ldc.h:73
NvMediaStatus NvMediaLDCMappingGen(NvMediaLDC *ldc)
Generates sparse warp mapping based on NvMediaCameraModel.
Fisheye model: r = f*theta, where theta is the angle from the optical axis, f is the focal length and...
Definition: nvmedia_ldc.h:107
Specifies to generate sparse warp map for geometric transform.
Definition: nvmedia_ldc.h:81
NvMediaStatus NvMediaLDCProcess(NvMediaLDC *ldc, NvMediaImage *prevSurface, NvMediaImage *curSurface, NvMediaImage *outputSurface, NvMediaImage *xSobel, NvMediaImage *downSample, const NvMediaLDCCtrlParams *ldcCtrlParams)
Performs the specified LDC operation.
Specifies to do both geometric transform and temporal noise reduction version 3.
Definition: nvmedia_ldc.h:70
Holds the TNR3 initialization paramters.
Definition: nvmedia_ldc.h:397
NvMediaLDCMode ldcMode
Specifies the LDC mode.
Definition: nvmedia_ldc.h:489
void * mapPtr
Holds the mapping value for each of the control points.
Definition: nvmedia_ldc.h:550
Specifies to disable both sobel and downsample output.
Definition: nvmedia_ldc.h:563
standard float_t format
Definition: nvmedia_ldc.h:520
float_t k5
Specifies radial distortion coefficient.
Definition: nvmedia_ldc.h:180
Holds the NvMedia LDC defintion of Sparse warp map.
Definition: nvmedia_ldc.h:534
NvMediaCamIntriParams targetK
Specifies the target camera intrinsic matrix.
Definition: nvmedia_ldc.h:218
uint8_t numHorRegion
Specifies the number of horizontal regions.
Definition: nvmedia_ldc.h:297
float_t betaX1
Specifies parameter BetaX1 in Beta Calculation.
Definition: nvmedia_ldc.h:456
NvMediaLensModel model
Specifies the camera model.
Definition: nvmedia_ldc.h:197
float_t k2
Specifies radial distortion coefficient.
Definition: nvmedia_ldc.h:171
NvMediaLensModel
Defines supported lens models.
Definition: nvmedia_ldc.h:97
uint16_t mapStride
Specifies the number of control points in one stride.
Definition: nvmedia_ldc.h:542
float_t noiseReduction
Specifies the noise reduction strength.
Definition: nvmedia_ldc.h:479
NvMediaLDCDataFormat dataFormat
Specifies the data format used in the buffer pointed by mapPtr.
Definition: nvmedia_ldc.h:555
void * mapPtr
Holds the value for mask map surface.
Definition: nvmedia_ldc.h:338
NvMediaFilterQuality filter
Specifies the filter quality.
Definition: nvmedia_ldc.h:353
Fisheye model: r = 2fsin(theta/2), where theta is the angle from the optical axis, f is the focal length and r is the distance of a pixel from the image center.
Definition: nvmedia_ldc.h:111
Fisheye model: r = 2ftan(theta/2), where theta is the angle from the optical axis, f is the focal length and r is the distance of a pixel from the image center.
Definition: nvmedia_ldc.h:103
NvMediaBool maskedPixelFillColor
Holds a flag indicating whether to fill the masked pixel with the specified color.
Definition: nvmedia_ldc.h:341
float_t fy
Specifies the camera focal length in Y axis, measured in pixel unit.
Definition: nvmedia_ldc.h:126
#define NVMEDIA_LDC_MAX_HOR_REGION
Defines the maximum number of horizontal regions.
Definition: nvmedia_ldc.h:48
NvMediaLDCSobelMode xSobelMode
Specifies the xSobel working mode.
Definition: nvmedia_ldc.h:584
NvMediaBool alphaSmoothEnable
flag whether to enable the spatial alpha smooth
Definition: nvmedia_ldc.h:421
NvMediaBool bitMaskEnable
Indicates whether bit mask map is enabled.
Definition: nvmedia_ldc.h:385
#define NVMEDIA_LDC_MAX_VER_REGION
Defines the aximum number of vertical regions.
Definition: nvmedia_ldc.h:51
Holds the TNR2 initialization paramters.
Definition: nvmedia_ldc.h:477
uint16_t rangeSigmaChroma
Specifies the sigma of the chroma for range filter.
Definition: nvmedia_ldc.h:408
uint8_t numVerRegion
Specifies the number of vertical regions.
Definition: nvmedia_ldc.h:301
NvMediaStatus NvMediaLDCDestroy(NvMediaLDC *ldc)
Destroys the NvMedia LDC handle that was created by NvMediaLDCCreate().
NvMediaTNR2Params tnr2Params
Specifies TNR2 initialization paramters.
Definition: nvmedia_ldc.h:507
Holds NvMedia LDC camera parameter info.
Definition: nvmedia_ldc.h:195
uint16_t rangeSigmaLuma
Specifies the sigma of the luma for range filter.
Definition: nvmedia_ldc.h:405
float_t maskU
Holds the U channel value of the default color.
Definition: nvmedia_ldc.h:379
float_t fx
Specifies the camera focal length in X axis, measured in pixel unit.
Definition: nvmedia_ldc.h:123
NvMediaLDCDataFormat
Defines the NvMedia LDC Data Format.
Definition: nvmedia_ldc.h:518
NvMediaGeoTransParams geoTransParams
Specifies geometric transform initialization paramters.
Definition: nvmedia_ldc.h:495