NVIDIA Tegra
NVIDIA DRIVE OS 5.1 Linux SDK

Developer Guide
5.1.15 Release


 
Image 2D (nvmimg_2d)
 
Command Line Options
Required Options
Other Options
Configuration File Parameters
General Configuration Parameters
The NvMedia Image 2D sample application nvmimg_2d demonstrates how to use the NvMedia Image 2D API to execute a single NvMedia2DBlitEx test case defined in .cfg format for NvMediaImage conversion.
The application requires you to provide command line input as well as a group of settings as defined in the configuration file.
Command Line Options
The command syntax is:
$ ./nvmimg_2d -cf <config filename> [switches]
Where:
The ‑cf switch specifies the pathname of a configuration file.
[switches] are zero or more optional command line switches, described in the table below.
To quit the application, enter q at the command line.
Required Options
The following table describes the required command line options.
OptionSwitch
Parameter
Description
Default
-cf
Config file name.
Specifies the configuration file including its full path.
N/A
Other Options
The following table describes the other command line options.
OptionSwitch
Parameter
Description
Default
-h
N/A
Displays guidance on using this application.
N/A
-v
Logging level
0 Errors
1 Warnings
2 Info
3 Debug
If the option is not provided, uses 0 Errors.
 
Configuration File Parameters
A sample application contains a default configuration file (.cfg).
The configuration file structure consists of parameters, default assigned values, and comments.
General Configuration Parameters
The following table describes the general configuration parameters.
Parameter
Description
Type
Range
inputfile
Input file name.
STRING
Max 1024 char
outputFile
Output file name.
STRING
Max 1024 char
crcMode
1: To generate CRC of the output.
2: To compare CRC with reference CRC.
UINT
1-2
crcFile
File to store CRC value when crcMode = 1 or
File contains Reference CRC when crcMode = 2.
STRING
Max 1024 char
validOperations
1: If the user wants to enable Filtering mode.
2: Reserved for future use.
4: If the user wants to enable Transformation mode.
8: If the user wants to enable color space conversion standard.
UINT
See description.
transformMode
Transformation Mode for Blit2D:
0: IDENTITY
1: ROTATE_90
2: ROTATE_180
3: ROTATE_270
4: FLIP_HORIZONTAL
5: INV_TRANSPOSE
6: FLIP_VERTICAL
7: TRANSPOSE
UINT
0-7
filterMode
Filtering mode for Blit2D:
1: FILTER_OFF
2: FILTER_LOW
3: FILTER_MEDIUM
4: FILTER_HIGH
UINT
1-4
colorStd
Color space conversion standard:
0: ITU BT.601
1: ITU BT.709
2: SMTE 240M
3: BT.601 Extended Range
UINT
0-4
srcWidth
Width of the source image.
UINT
64-16384
srcHeight
Height of the source image.
UINT
64-16384
srcCPUAccess
Source surface CPU access type:
1: Uncached (mapped) access type flag.
2: Cached (mapped) access type flag.
3: Unmapped access type flag.
UINT
1-3
srcAllocType
Source surface allocation type:
0: none
1: isochronous
UINT
0-1
srcScanType
Source surface scan type:
1: Progressive
UINT
1
srcColorStd
Source surface color standard:
1: sRGB
2: YCbCr Rec.601 (Studio Range)
3: YCbCr Rec.601 (Extended Range)
4: YCbCr Rec.709 (Studio Range)
5: YCbCr Rec.709 (Extended Range)
11: Sensor RGBA
UINT
1-11
srcSurfType
Source surface type:
1: YUV
2: RGBA
3: RAW
UINT
1-3
srcLayout
Source surface layout:
1: Block Linear
2: Pitch Linear
UINT
1-2
srcDataType
Source surface data type:
1: uint
2: int
UINT
1-2
srcMemory
Source surface memory type:
1: planar
2: Semi Planar
3: Packed
UINT
1-3
srcSubSamplingType
Source surface sub sampling type:
0: NVM_SURF_ATTR_SUB_SAMPLING_TYPE_NONE
1: NVM_SURF_ATTR_SUB_SAMPLING_TYPE_420
2: NVM_SURF_ATTR_SUB_SAMPLING_TYPE_422
3: NVM_SURF_ATTR_SUB_SAMPLING_TYPE_444
4: NVM_SURF_ATTR_SUB_SAMPLING_TYPE_422R
UINT
0-4
srcBitsPerComponent
Bits per component for source surface:
1: NVM_SURF_ATTR_BITS_PER_COMPONENT_8
2: NVM_SURF_ATTR_BITS_PER_COMPONENT_10
3: NVM_SURF_ATTR_BITS_PER_COMPONENT_12
5: NVM_SURF_ATTR_BITS_PER_COMPONENT_16
UINT
See description.
srcComponentOrder
Source surface component order:
1: NVM_SURF_ATTR_COMPONENT_ORDER_LUMA
2: NVM_SURF_ATTR_COMPONENT_ORDER_YUV
3: NVM_SURF_ATTR_COMPONENT_ORDER_YVU
4: NVM_SURF_ATTR_COMPONENT_ORDER_YUYV
5: NVM_SURF_ATTR_COMPONENT_ORDER_YVYU
6: NVM_SURF_ATTR_COMPONENT_ORDER_VYUY
10: NVM_SURF_ATTR_COMPONENT_ORDER_VUYX
18: NVM_SURF_ATTR_COMPONENT_ORDER_RGBA
20: NVM_SURF_ATTR_COMPONENT_ORDER_BGRA
UINT
See description.
srcRectx0
Left X-coordinate of source rectangle.
USHORT
[0, srcWidth]
srcRecty0
Top Y-coordinate of source rectangle.
USHORT
[0, srcHeight]
srcRectx1
Right X-coordinate of source rectangle.
USHORT
[0, srcWidth]
srcRecty1
Bottom Y-coordinate of source rectangle.
USHORT
[0, srcHeight]
dstWidth
Width of the destination image.
UINT
64-16384
dstHeight
Height of the destination image.
UINT
64-16384
dstCPUAccess
Destination surface CPU access type:
1: Uncached (mapped) access type flag
2: Cached (mapped) access type flag
3: Unmapped access type flag
UINT
1-3
dstAllocType
Destination surface allocation type:
0: none
1: isochronous
UINT
0-1
dstScanType
Destination surface scan type:
1: Progressive
UINT
1
dstColorStd
Destination surface color standard:
1: sRGB
2: YCbCr Rec.601 (Studio Range)
3: YCbCr Rec.601 (Extended Range)
4: YCbCr Rec.709 (Studio Range)
5: YCbCr Rec.709 (Extended Range)
11: Sensor RGBA
UINT
See description.
dstSurfType
Destination surface type:
1: YUV
2: RGBA
3: RAW
UINT
1-3
dstLayout
Destination surface layout:
1: Block Linear
2: Pitch Linear
UINT
1-2
dstDataType
Destination surface data type:
1: uint
2: int
UINT
1-2
dstMemory
Destination surface memory type:
1: Planar
2: Semi Planar
3: Packed
UINT
1-3
dstSubSamplingType
Destination surface sub sampling type:
0: NVM_SURF_ATTR_SUB_SAMPLING_TYPE_NONE
1: NVM_SURF_ATTR_SUB_SAMPLING_TYPE_420
2: NVM_SURF_ATTR_SUB_SAMPLING_TYPE_422
3: NVM_SURF_ATTR_SUB_SAMPLING_TYPE_444
4: NVM_SURF_ATTR_SUB_SAMPLING_TYPE_422R
UINT
0-4
dstBitsPerComponent
Bits per component for destination surface:
1: NVM_SURF_ATTR_BITS_PER_COMPONENT_8
2: NVM_SURF_ATTR_BITS_PER_COMPONENT_10
3: NVM_SURF_ATTR_BITS_PER_COMPONENT_12
5: NVM_SURF_ATTR_BITS_PER_COMPONENT_16
UINT
See description.
dstComponentOrder
Destination surface component order:
1: NVM_SURF_ATTR_COMPONENT_ORDER_LUMA
2: NVM_SURF_ATTR_COMPONENT_ORDER_YUV
3: NVM_SURF_ATTR_COMPONENT_ORDER_YVU
4: NVM_SURF_ATTR_COMPONENT_ORDER_YUYV
5: NVM_SURF_ATTR_COMPONENT_ORDER_YVYU
6: NVM_SURF_ATTR_COMPONENT_ORDER_VYUY
10: NVM_SURF_ATTR_COMPONENT_ORDER_VUYX
18: NVM_SURF_ATTR_COMPONENT_ORDER_RGBA
20: NVM_SURF_ATTR_COMPONENT_ORDER_BGRA
UINT
See description.
dstRectx0
Left X-coordinate of destination rectangle.
USHORT
[0, dstWidth]
dstRecty0
Top Y-coordinate of destination rectangle.
USHORT
[0, dstHeight]
dstRectx1
Right X-coordinate of destination rectangle.
USHORT
[0, dstWidth]
dstRecty1
Bottom Y-coordinate of destination rectangle.
USHORT
[0, dstHeight]