NVIDIA DRIVE OS Linux SDK API Reference

5.1.6.0 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-2019, 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_core.h"
25 #include "nvmedia_image.h"
26 #include "nvmedia_surface.h"
27 
40 #define NVMEDIA_LDC_VERSION_MAJOR 2
41 
42 #define NVMEDIA_LDC_VERSION_MINOR 0
43 
47 typedef struct NvMediaLDC NvMediaLDC;
48 
50 #define NVMEDIA_LDC_MAX_HOR_REGION 4u
51 
53 #define NVMEDIA_LDC_MAX_VER_REGION 4u
54 
56 #define NVMEDIA_LDC_MIN_REGION_WIDTH 64u
57 
59 #define NVMEDIA_LDC_MIN_REGION_HEIGHT 16u
60 
64 typedef enum {
67 
70 
74 
78 
82 typedef enum {
85 
89 
92 
96 
100 typedef enum {
103 
108 
113 
118 
124 
128 typedef struct {
130  float_t fx;
131 
133  float_t fy;
134 
136  float_t cx;
137 
139  float_t cy;
141 
171 typedef struct {
173  float_t k1;
174 
176  float_t k2;
177 
179  float_t k3;
180 
182  float_t k4;
183 
185  float_t k5;
186 
188  float_t k6;
189 
191  float_t p1;
192 
194  float_t p2;
196 
200 typedef struct {
203 
206 
209 
215  float_t R[3][3];
216 
220  float_t T[3];
221 
225 
302 typedef struct {
305  uint8_t numHorRegion;
306 
309  uint8_t numVerRegion;
310 
312  uint16_t horRegionWidth[NVMEDIA_LDC_MAX_HOR_REGION];
313 
315  uint16_t verRegionHeight[NVMEDIA_LDC_MAX_VER_REGION];
316 
319  uint16_t log2horSpace[NVMEDIA_LDC_MAX_HOR_REGION];
320 
323  uint16_t log2verSpace[NVMEDIA_LDC_MAX_VER_REGION];
325 
334 typedef struct {
337  uint16_t width;
338 
341  uint16_t height;
342 
348  void *mapPtr;
349 
354 
358 typedef struct {
361 
364 
370 
380  float_t ptMatrix[3][3];
381 
384 
387  float_t maskY;
388 
391  float_t maskU;
392 
395  float_t maskV;
396 
399 
406 
410 typedef struct {
413 
416 
418  uint16_t rangeSigmaLuma;
419 
422 
426  float_t sadMultiplier;
427 
431  float_t sadWeightLuma;
432 
435 
440 
444  float_t alphaScaleIIR;
445 
449  float_t alphaMaxLuma;
450 
454  float_t alphaMinLuma;
455 
459  float_t alphaMaxChroma;
460 
464  float_t alphaMinChroma;
465 
469  float_t betaX1;
470 
474  float_t betaX2;
475 
479  float_t minBeta;
480 
484  float_t maxBeta;
486 
490 typedef struct {
493  float_t noiseReduction;
498 
502 typedef struct {
505 
511 
517 
523 
527 
531 typedef enum {
534 
539 
547 typedef struct {
549  uint16_t numHorPoints;
550 
552  uint16_t numVerPoints;
553 
555  uint16_t mapStride;
556 
565  void *mapPtr;
566 
572 
576 typedef enum {
579 
582 
585 
589 
593 typedef struct {
601 
611  NvMediaVersion *version
612 );
613 
648  const NvMediaDevice *device,
649  NvMediaLDC **pldc,
650  const uint16_t srcWidth,
651  const uint16_t srcHeight,
652  const NvMediaRect *srcRect,
653  const uint16_t dstWidth,
654  const uint16_t dstHeight,
655  const NvMediaRect *dstRect,
656  const NvMediaLDCInitParams *initParams);
657 
678  NvMediaLDC *ldc
679 );
680 
704  NvMediaLDC *ldc,
705  const NvMediaLDCSparseWarpMap *map);
706 
727  NvMediaLDC *ldc);
728 
752  const NvMediaLDC *ldc,
753  const NvMediaTNR3Params *tnr3Params);
754 
827  const NvMediaLDC *ldc,
828  NvMediaImage *prevSurface,
829  NvMediaImage *curSurface,
830  NvMediaImage *outputSurface,
831  NvMediaImage *xSobel,
832  NvMediaImage *downSample,
833  const NvMediaLDCCtrlParams *ldcCtrlParams
834 );
835 
838 /*
839  * \defgroup history_nvmedia_ldc History
840  * Provides change history for the NvMedia LDC API.
841  *
842  * \section history_nvmedia_ldc Version History
843  *
844  * <b> Version 1.0 </b> May 1, 2017
845  * - Initial release.
846  *
847  * <b> Version 1.1 </b> March 16, 2018
848  * - Add support of TNR2
849  *
850  * <b> version 1.2 </b> September 4, 2018
851  * - New member variable srcSurfaceType is added to NvMediaLDCInitParams.
852  *
853  * <b> version 1.3 </b> December 26, 2018
854  * - Adding unsigned tag to macro constants to fix MISRA 10.4 violation.
855  * - Fixing MISRA 21.1 violations
856  *
857  * <b> version 1.4 </b> January 2, 2019
858  * - Added deprecated warning message for \ref NvMediaLDCCreate.
859  * - Added API \ref NvMediaLDCCreateNew
860  *
861  * <b> version 1.5 </b> March 6, 2019
862  * - Fixing MISRA 8.13 violations.
863  *
864  * <b> Version 1.6 </b> March 12, 2019
865  * - Added required header includes nvmedia_core.h and nvmedia_surface.h
866  *
867  * <b> version 2.0 </b> March 29, 2019
868  * - Deprecated NvMediaLDCCreate API.
869  */
870 
871 #ifdef __cplusplus
872 }
873 #endif
874 
875 #endif // NvMedia_LDC_H
Holds a handle representing image objects.
Definition: nvmedia_image.h:69
float_t maskY
Holds the Y channel value of the default color.
Definition: nvmedia_ldc.h:387
#define NvMediaSurfaceType
Defines the set of NvMedia surface types.
Specifies producing gradient Sobel and disable downsample output.
Definition: nvmedia_ldc.h:584
float_t alphaMinLuma
Holds the min luma value in Alpha Clip Calculation.
Definition: nvmedia_ldc.h:454
NvMediaGeoTransMode
Defines geometric transform operation modes.
Definition: nvmedia_ldc.h:82
float_t k1
Holds the radial distortion coefficient.
Definition: nvmedia_ldc.h:173
Holds the NvMedia LDC region configuration.
Definition: nvmedia_ldc.h:302
Specifies S15.5 fixed floating format.
Definition: nvmedia_ldc.h:537
uint16_t numHorPoints
Holds the number of control points in each row.
Definition: nvmedia_ldc.h:549
uint32_t NvMediaBool
A boolean value, holding NVMEDIA_TRUE or NVMEDIA_FALSE.
Definition: nvmedia_core.h:80
Holds distortion coefficients for the lens model.
Definition: nvmedia_ldc.h:171
float_t k4
Holds the radial distortion coefficient.
Definition: nvmedia_ldc.h:182
float_t alphaIncreaseCap
Holds the temporal alpha restrict increase capablility.
Definition: nvmedia_ldc.h:439
NvMediaLensDistortion distCoeffs
Holds the distortion coefficients.
Definition: nvmedia_ldc.h:205
NvMediaLDCRegionConfig regionConfig
Specifies the region configure paramters.
Definition: nvmedia_ldc.h:383
NvMediaCamIntriParams K
Holds the camera intrinsic matrix.
Definition: nvmedia_ldc.h:208
NvMediaLDCMode
Defines the NvMedia LDC operating modes.
Definition: nvmedia_ldc.h:64
float_t alphaMaxChroma
Holds the max chroma value in Alpha Clip Calculation.
Definition: nvmedia_ldc.h:459
NVIDIA Media Interface: Surface Handling
NvMediaStatus NvMediaLDCCreateNew(const NvMediaDevice *device, 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.
float_t p2
Holds the tangential distortion coefficient.
Definition: nvmedia_ldc.h:194
float_t minBeta
Holds parameter MinBeta threshold in Beta Calculation.
Definition: nvmedia_ldc.h:479
NVIDIA Media Interface: Image Processing
NvMediaLDCBitMaskMap bitMaskMap
Holds the bit mask map information when bitMaskEnable is NV_TRUE.
Definition: nvmedia_ldc.h:404
float_t maxBeta
Holds parameter MaxBeta threshold in Beta Calculation.
Definition: nvmedia_ldc.h:484
Holds runtime control parameters for NvMediaLDCProcess().
Definition: nvmedia_ldc.h:593
Specifies temporal noise reduction version 3 mode.
Definition: nvmedia_ldc.h:69
float_t p1
Holds the tangential distortion coefficient.
Definition: nvmedia_ldc.h:191
NvMediaStatus NvMediaLDCGetVersion(NvMediaVersion *version)
Returns the version information of NvMedia LDC.
NvMediaStatus NvMediaLDCFeedSparseWarpMap(NvMediaLDC *ldc, const NvMediaLDCSparseWarpMap *map)
Feeds a sparse warp map to NvMedia LDC.
Specifies taking a sparse warp map from client via NvMediaLDCFeedSparseWarpMap(). ...
Definition: nvmedia_ldc.h:88
NvMediaLDCSobelMode
Defines the xSobel working modes.
Definition: nvmedia_ldc.h:576
NvMediaNoiseReductionAlgorithm
Noise Reduction Algorithm.
NvMediaNoiseReductionAlgorithm noiseReductionAlgorithm
Holds the noise reduction algorithm.
Definition: nvmedia_ldc.h:496
Specifies a fisheye model: r = fsin(theta), where theta is the angle from the optical axis...
Definition: nvmedia_ldc.h:122
Holds NvMedia version information.
Definition: nvmedia_core.h:226
Holds the NvMedia LDC initialization paramters.
Definition: nvmedia_ldc.h:502
Specifies a polynomial distortion model.
Definition: nvmedia_ldc.h:102
float_t k3
Holds the radial distortion coefficient.
Definition: nvmedia_ldc.h:179
struct NvMediaDevice NvMediaDevice
An opaque handle representing an NvMediaDevice object.
Definition: nvmedia_core.h:337
NVIDIA Media Interface: Common Types for Video/Image Encode/Decode
float_t alphaMinChroma
Holds the min chroma value in Alpha Clip Calculation.
Definition: nvmedia_ldc.h:464
uint16_t numVerPoints
Holds the number of control points in each column.
Definition: nvmedia_ldc.h:552
NvMediaStatus NvMediaLDCUpdateTNR3Params(const NvMediaLDC *ldc, const NvMediaTNR3Params *tnr3Params)
Updates TNR3 parameters after a call to NvMediaLDCCreateNew().
float_t betaX2
Holds parameter BetaX2 in Beta Calculation.
Definition: nvmedia_ldc.h:474
float_t cx
Holds the optical center in the X axis, in pixels.
Definition: nvmedia_ldc.h:136
Holds geometric transform initialization paramters.
Definition: nvmedia_ldc.h:358
Specifies producing luma Sobel and luma downsample output.
Definition: nvmedia_ldc.h:581
NVIDIA Media Interface: Core
NvMediaCameraModel cameraModel
Holds the camera model parameters.
Definition: nvmedia_ldc.h:369
float_t maskV
Holds the V channel value of the default color.
Definition: nvmedia_ldc.h:395
NvMediaStatus
Defines all possible error codes.
Definition: nvmedia_core.h:169
NvMediaSurfaceType srcSurfaceType
Holds source format type for LDC or TNR operation.
Definition: nvmedia_ldc.h:525
uint16_t spatialSigmaLuma
Holds the sigma of the luma for spatial filter.
Definition: nvmedia_ldc.h:412
Specifies performing an affine transform.
Definition: nvmedia_ldc.h:91
NvMediaGeoTransMode geoTransMode
Holds the geometric transform mode.
Definition: nvmedia_ldc.h:360
float_t alphaMaxLuma
Holds the max luma value in Alpha Clip Calculation.
Definition: nvmedia_ldc.h:449
uint16_t spatialSigmaChroma
Holds the sigma of the chroma for spatial filter.
Definition: nvmedia_ldc.h:415
Holds the NvMedia mask map surface.
Definition: nvmedia_ldc.h:334
NvMediaStatus NvMediaLDCProcess(const NvMediaLDC *ldc, NvMediaImage *prevSurface, NvMediaImage *curSurface, NvMediaImage *outputSurface, NvMediaImage *xSobel, NvMediaImage *downSample, const NvMediaLDCCtrlParams *ldcCtrlParams)
Performs a specified LDC operation.
Holds NvMedia camera intrinsic parameters.
Definition: nvmedia_ldc.h:128
Holds a rectangular region of a surface.
Definition: nvmedia_core.h:133
uint16_t width
Holds the width in bytes of the mask map surface, which must be equal to the width of the destination...
Definition: nvmedia_ldc.h:337
float_t cy
Holds the optical center in the Y axis, in pixels.
Definition: nvmedia_ldc.h:139
NvMediaFilterQuality
Defines filter quality levels.
float_t sadWeightLuma
Holds the weight of luma when calculating SAD.
Definition: nvmedia_ldc.h:431
Specifies producing gradient Sobel and gradient downsample output.
Definition: nvmedia_ldc.h:587
Specifies geometric transform mode.
Definition: nvmedia_ldc.h:66
struct NvMediaLDC NvMediaLDC
Defines the NvMedia LDC handle as an opaque struct.
Definition: nvmedia_ldc.h:47
Specifies performing a perspective transform.
Definition: nvmedia_ldc.h:94
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:341
float_t alphaScaleIIR
Holds the alpha scale IIR for strength.
Definition: nvmedia_ldc.h:444
NvMediaTNR3Params tnr3Params
Holds TNR3 initialization parameters.
Definition: nvmedia_ldc.h:516
float_t sadMultiplier
Holds the SAD multiplier parameter.
Definition: nvmedia_ldc.h:426
float_t k6
Holds the radial distortion coefficient.
Definition: nvmedia_ldc.h:188
Specifies temporal noise reduction version 2 mode.
Definition: nvmedia_ldc.h:76
NvMediaStatus NvMediaLDCMappingGen(NvMediaLDC *ldc)
Generates a sparse warp mapping based on NvMediaCameraModel.
Specifies a fisheye model: r = f*theta, where theta is the angle from the optical axis...
Definition: nvmedia_ldc.h:112
Specifies generating a sparse warp map for geometric transform.
Definition: nvmedia_ldc.h:84
Specifies both geometric transform mode and temporal noise reduction version 3 mode.
Definition: nvmedia_ldc.h:73
Holds the TNR3 initialization paramters.
Definition: nvmedia_ldc.h:410
NvMediaLDCMode ldcMode
Holds the LDC mode.
Definition: nvmedia_ldc.h:504
void * mapPtr
Holds the mapping value for each of the control points.
Definition: nvmedia_ldc.h:565
Specifies disabling both Sobel and downsample output.
Definition: nvmedia_ldc.h:578
Specifies standard float_t format.
Definition: nvmedia_ldc.h:533
float_t k5
Holds the radial distortion coefficient.
Definition: nvmedia_ldc.h:185
Holds the NvMedia LDC defintion of a sparse warp map.
Definition: nvmedia_ldc.h:547
NvMediaCamIntriParams targetK
Holds the target camera intrinsic matrix.
Definition: nvmedia_ldc.h:223
uint8_t numHorRegion
Holds the number of horizontal regions.
Definition: nvmedia_ldc.h:305
float_t betaX1
Holds parameter BetaX1 in Beta Calculation.
Definition: nvmedia_ldc.h:469
NvMediaLensModel model
Holds the camera model.
Definition: nvmedia_ldc.h:202
float_t k2
Holds the radial distortion coefficient.
Definition: nvmedia_ldc.h:176
NvMediaLensModel
Defines supported lens models.
Definition: nvmedia_ldc.h:100
uint16_t mapStride
Holds the number of control points in one stride.
Definition: nvmedia_ldc.h:555
float_t noiseReduction
Holds the noise reduction strength.
Definition: nvmedia_ldc.h:493
NvMediaLDCDataFormat dataFormat
Holds the data format used in the buffer which mapPtr points to.
Definition: nvmedia_ldc.h:570
void * mapPtr
Holds the value for the mask map surface.
Definition: nvmedia_ldc.h:348
NvMediaFilterQuality filter
Holds the filter quality.
Definition: nvmedia_ldc.h:363
Specifies a fisheye model: r = 2fsin(theta/2), where theta is the angle from the optical axis...
Definition: nvmedia_ldc.h:117
Specifies a fisheye model: r = 2ftan(theta/2), where theta is the angle from the optical axis...
Definition: nvmedia_ldc.h:107
NvMediaBool maskedPixelFillColor
Holds a flag indicating whether to fill the masked pixel with the specified color.
Definition: nvmedia_ldc.h:352
float_t fy
Holds the camera focal length in the Y axis, in pixels.
Definition: nvmedia_ldc.h:133
#define NVMEDIA_LDC_MAX_HOR_REGION
Maximum number of horizontal regions.
Definition: nvmedia_ldc.h:50
NvMediaLDCSobelMode xSobelMode
Holds the xSobel working mode.
Definition: nvmedia_ldc.h:599
NvMediaBool alphaSmoothEnable
Holds a flag which enables or disables the spatial alpha smooth.
Definition: nvmedia_ldc.h:434
NvMediaBool bitMaskEnable
Indicates whether bit mask map is enabled.
Definition: nvmedia_ldc.h:398
#define NVMEDIA_LDC_MAX_VER_REGION
Maximum number of vertical regions.
Definition: nvmedia_ldc.h:53
Holds the TNR2 initialization paramters.
Definition: nvmedia_ldc.h:490
uint16_t rangeSigmaChroma
Holds the sigma of the chroma for range filter.
Definition: nvmedia_ldc.h:421
uint8_t numVerRegion
Holds the number of vertical regions.
Definition: nvmedia_ldc.h:309
NvMediaStatus NvMediaLDCDestroy(NvMediaLDC *ldc)
Destroys an NvMedia LDC handle that was created by a call to NvMediaLDCCreateNew().
NvMediaTNR2Params tnr2Params
Holds TNR2 initialization paramters.
Definition: nvmedia_ldc.h:522
Holds NvMedia LDC camera parameter info.
Definition: nvmedia_ldc.h:200
uint16_t rangeSigmaLuma
Holds the sigma of the luma for range filter.
Definition: nvmedia_ldc.h:418
float_t maskU
Holds the U channel value of the default color.
Definition: nvmedia_ldc.h:391
float_t fx
Holds the camera focal length in the X axis, in pixels.
Definition: nvmedia_ldc.h:130
NvMediaLDCDataFormat
Defines the NvMedia LDC Data Format.
Definition: nvmedia_ldc.h:531
NvMediaGeoTransParams geoTransParams
Holds geometric transform initialization paramters.
Definition: nvmedia_ldc.h:510