Manages CUDA texture objects for batched input frames.
Definition at line 56 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
Public Member Functions | |
| FrameInputTexture () | |
| Construct an uninitialized input-texture manager. More... | |
| ~FrameInputTexture () | |
| Release resources owned by the FrameInputTexture instance. More... | |
| void | initialize (const int debugVerboseLevel, const int maxStreamNum, const int maxBufSurfAddrSize, const NvMotDataTypes::Size srcImgSize, const uint srcImgPitch, const NvBufSurfaceColorFormat colorFormatType) |
| Initialize input texture state and allocate frame memory. More... | |
| bool | create_batch (const std::map< NvMOTStreamId, NvMOTFrame * > &nvFramesInBatch) |
| Cache a batch of source frames and create their texture objects. More... | |
| void | createTexObjInBatch () |
| Create texture objects for BGRA or grayscale frames in the current batch. More... | |
| void | createTexObjInBatch_NV12 () |
| Create texture objects for NV12 frames in the current batch. More... | |
| void | destroyTextureObjects () |
| Destroy all texture objects for the current batch. More... | |
| void | cleanUpTextureObjects (int cleanUpNum) |
| Remove the requested number of cached BGRA or grayscale texture objects. More... | |
| void | cleanUpTextureObjects_NV12 (int cleanUpNum) |
| Remove the requested number of cached NV12 texture objects. More... | |
| cudaTextureObject_t * | getTexturePointer (NvMOTStreamId streamId) |
| Get the BGRA or grayscale texture-object pointer for a stream. More... | |
| TextureObjects * | getTexturePointer_NV12 (NvMOTStreamId streamId) |
| Get the NV12 texture-object pair for a stream. More... | |
| int | getWidthIn () |
| Get the input image width in pixels. More... | |
| int | getHeightIn () |
| Get the input image height in pixels. More... | |
| int | getChannelsIn () |
| Get the number of input image channels. More... | |
| NvBufSurfaceColorFormat | getColorFormat () const |
| Get the input surface color format. More... | |
| FrameInputTexture () | |
| Construct an uninitialized input-texture manager. More... | |
| ~FrameInputTexture () | |
| Release resources owned by the FrameInputTexture instance. More... | |
| void | initialize (const int debugVerboseLevel, const int maxStreamNum, const int maxBufSurfAddrSize, const NvMotDataTypes::Size srcImgSize, const uint srcImgPitch, const NvBufSurfaceColorFormat colorFormatType) |
| Initialize input texture state and allocate frame memory. More... | |
| bool | create_batch (const std::map< NvMOTStreamId, NvMOTFrame * > &nvFramesInBatch) |
| Cache a batch of source frames and create their texture objects. More... | |
| void | createTexObjInBatch () |
| Create texture objects for BGRA or grayscale frames in the current batch. More... | |
| void | createTexObjInBatch_NV12 () |
| Create texture objects for NV12 frames in the current batch. More... | |
| void | destroyTextureObjects () |
| Destroy all texture objects for the current batch. More... | |
| void | cleanUpTextureObjects (int cleanUpNum) |
| Remove the requested number of cached BGRA or grayscale texture objects. More... | |
| void | cleanUpTextureObjects_NV12 (int cleanUpNum) |
| Remove the requested number of cached NV12 texture objects. More... | |
| cudaTextureObject_t * | getTexturePointer (NvMOTStreamId streamId) |
| Get the BGRA or grayscale texture-object pointer for a stream. More... | |
| TextureObjects * | getTexturePointer_NV12 (NvMOTStreamId streamId) |
| Get the NV12 texture-object pair for a stream. More... | |
| int | getWidthIn () |
| Get the input image width in pixels. More... | |
| int | getHeightIn () |
| Get the input image height in pixels. More... | |
| int | getChannelsIn () |
| Get the number of input image channels. More... | |
| NvBufSurfaceColorFormat | getColorFormat () const |
| Get the input surface color format. More... | |
Protected Member Functions | |
| void | initialize4Input (uint numFramesInBatch, const NvMotDataTypes::Size frameSize, const uint srcImgPitch, const uint frameChannels) |
| Set the input image layout and allocate batch memory. More... | |
| void | initializeTextureDescriptors () |
| Initialize CUDA resource and texture descriptors. More... | |
| void | allocateInputMemoriesBatch (const uint numFramesInBatch, const int nx, const int ny, const uint pitch_in) |
| Allocate device and host memory for a batch of input images. More... | |
| void | deAllocateInputMemoriesBatch () |
| Release device and host memory for the input images. More... | |
| void | uploadDeviceData2DeviceMemories (const std::map< NvMOTStreamId, NvMOTFrame * > &nvFramesInBatch) |
| Upload a batch of source frames to pitch-linear CUDA memory. More... | |
| void | initialize4Input (uint numFramesInBatch, const NvMotDataTypes::Size frameSize, const uint srcImgPitch, const uint frameChannels) |
| Set the input image layout and allocate batch memory. More... | |
| void | initializeTextureDescriptors () |
| Initialize CUDA resource and texture descriptors. More... | |
| void | allocateInputMemoriesBatch (const uint numFramesInBatch, const int nx, const int ny, const uint pitch_in) |
| Allocate device and host memory for a batch of input images. More... | |
| void | deAllocateInputMemoriesBatch () |
| Release device and host memory for the input images. More... | |
| void | uploadDeviceData2DeviceMemories (const std::map< NvMOTStreamId, NvMOTFrame * > &nvFramesInBatch) |
| Upload a batch of source frames to pitch-linear CUDA memory. More... | |
Protected Attributes | |
| bool | m_isInit |
| Indicates whether input texture state is initialized. More... | |
| std::map< NvMOTStreamId, NvMOTFrame * > | m_srcNvFrames |
| Input source frames keyed by stream ID. More... | |
| std::map< NvMOTStreamId, cudaTextureObject_t * > | m_pTex |
| BGRA or grayscale texture pointers keyed by stream ID. More... | |
| std::map< NvMOTStreamId, TextureObjects * > | m_pTex_NV12 |
| NV12 texture-object pairs keyed by stream ID. More... | |
| std::map< const NvBufSurfaceParams *, cudaTextureObject_t > | m_texInputAddrMap |
| BGRA or grayscale texture objects keyed by surface address. More... | |
| std::map< const NvBufSurfaceParams *, TextureObjects > | m_texInputAddrMap_NV12 |
| NV12 texture-object pairs keyed by surface address. More... | |
| cudaResourceDesc | m_resDesc_luma |
| CUDA resource descriptor for NV12 luma data. More... | |
| cudaResourceDesc | m_resDesc_chroma |
| CUDA resource descriptor for NV12 chroma data. More... | |
| cudaResourceDesc | m_resDesc |
| CUDA resource descriptor for RGBA data. More... | |
| cudaTextureDesc | m_texDesc |
| CUDA texture descriptor shared by input formats. More... | |
| int | m_maxTexAddrSize |
| Maximum number of cached texture addresses. More... | |
| uint | m_numFramesInBatchMax |
| Maximum number of frames processed in a batch. More... | |
| int | m_width_in |
| int | m_height_in |
| int | m_pitch_in |
| int | m_channels_in |
| Width, height, pitch, and channel count of the source image. More... | |
| NvBufSurfaceColorFormat | m_colorFormatType |
| Color format of the source surface. More... | |
| int | m_integrated_gpu |
| Indicates whether execution uses an integrated GPU. More... | |
| int | m_deviceId |
| GPU device identifier. More... | |
| int | m_debugVerboseLevel |
| Debug verbosity level. More... | |
| FrameInputTexture::FrameInputTexture | ( | ) |
Construct an uninitialized input-texture manager.
| FrameInputTexture::~FrameInputTexture | ( | ) |
Release resources owned by the FrameInputTexture instance.
| FrameInputTexture::FrameInputTexture | ( | ) |
Construct an uninitialized input-texture manager.
| FrameInputTexture::~FrameInputTexture | ( | ) |
Release resources owned by the FrameInputTexture instance.
|
protected |
Allocate device and host memory for a batch of input images.
| [in] | numFramesInBatch | Number of frames in the batch. |
| [in] | nx | Input image width in pixels. |
| [in] | ny | Input image height in pixels. |
| [in] | pitch_in | Input image pitch in bytes. |
|
protected |
Allocate device and host memory for a batch of input images.
| [in] | numFramesInBatch | Number of frames in the batch. |
| [in] | nx | Input image width in pixels. |
| [in] | ny | Input image height in pixels. |
| [in] | pitch_in | Input image pitch in bytes. |
| void FrameInputTexture::cleanUpTextureObjects | ( | int | cleanUpNum | ) |
Remove the requested number of cached BGRA or grayscale texture objects.
| [in] | cleanUpNum | Number of cached texture objects to remove. |
| void FrameInputTexture::cleanUpTextureObjects | ( | int | cleanUpNum | ) |
Remove the requested number of cached BGRA or grayscale texture objects.
| [in] | cleanUpNum | Number of cached texture objects to remove. |
| void FrameInputTexture::cleanUpTextureObjects_NV12 | ( | int | cleanUpNum | ) |
Remove the requested number of cached NV12 texture objects.
| [in] | cleanUpNum | Number of cached texture objects to remove. |
| void FrameInputTexture::cleanUpTextureObjects_NV12 | ( | int | cleanUpNum | ) |
Remove the requested number of cached NV12 texture objects.
| [in] | cleanUpNum | Number of cached texture objects to remove. |
| bool FrameInputTexture::create_batch | ( | const std::map< NvMOTStreamId, NvMOTFrame * > & | nvFramesInBatch | ) |
Cache a batch of source frames and create their texture objects.
| [in] | nvFramesInBatch | Source frames keyed by stream ID. |
| bool FrameInputTexture::create_batch | ( | const std::map< NvMOTStreamId, NvMOTFrame * > & | nvFramesInBatch | ) |
Cache a batch of source frames and create their texture objects.
| [in] | nvFramesInBatch | Source frames keyed by stream ID. |
| void FrameInputTexture::createTexObjInBatch | ( | ) |
Create texture objects for BGRA or grayscale frames in the current batch.
| void FrameInputTexture::createTexObjInBatch | ( | ) |
Create texture objects for BGRA or grayscale frames in the current batch.
| void FrameInputTexture::createTexObjInBatch_NV12 | ( | ) |
Create texture objects for NV12 frames in the current batch.
| void FrameInputTexture::createTexObjInBatch_NV12 | ( | ) |
Create texture objects for NV12 frames in the current batch.
|
protected |
Release device and host memory for the input images.
|
protected |
Release device and host memory for the input images.
| void FrameInputTexture::destroyTextureObjects | ( | ) |
Destroy all texture objects for the current batch.
| void FrameInputTexture::destroyTextureObjects | ( | ) |
Destroy all texture objects for the current batch.
|
inline |
Get the number of input image channels.
Definition at line 128 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
References m_channels_in.
|
inline |
Get the number of input image channels.
Definition at line 128 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
References m_channels_in.
|
inline |
Get the input surface color format.
Definition at line 131 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
References m_colorFormatType.
|
inline |
Get the input surface color format.
Definition at line 131 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
References m_colorFormatType.
|
inline |
Get the input image height in pixels.
Definition at line 125 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
References m_height_in.
|
inline |
Get the input image height in pixels.
Definition at line 125 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
References m_height_in.
| cudaTextureObject_t* FrameInputTexture::getTexturePointer | ( | NvMOTStreamId | streamId | ) |
Get the BGRA or grayscale texture-object pointer for a stream.
| [in] | streamId | Video stream identifier. |
| cudaTextureObject_t* FrameInputTexture::getTexturePointer | ( | NvMOTStreamId | streamId | ) |
Get the BGRA or grayscale texture-object pointer for a stream.
| [in] | streamId | Video stream identifier. |
| TextureObjects* FrameInputTexture::getTexturePointer_NV12 | ( | NvMOTStreamId | streamId | ) |
Get the NV12 texture-object pair for a stream.
| [in] | streamId | Video stream identifier. |
| TextureObjects* FrameInputTexture::getTexturePointer_NV12 | ( | NvMOTStreamId | streamId | ) |
Get the NV12 texture-object pair for a stream.
| [in] | streamId | Video stream identifier. |
|
inline |
Get the input image width in pixels.
Definition at line 122 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
References m_width_in.
|
inline |
Get the input image width in pixels.
Definition at line 122 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
References m_width_in.
| void FrameInputTexture::initialize | ( | const int | debugVerboseLevel, |
| const int | maxStreamNum, | ||
| const int | maxBufSurfAddrSize, | ||
| const NvMotDataTypes::Size | srcImgSize, | ||
| const uint | srcImgPitch, | ||
| const NvBufSurfaceColorFormat | colorFormatType | ||
| ) |
Initialize input texture state and allocate frame memory.
| [in] | debugVerboseLevel | Debug verbosity level. |
| [in] | maxStreamNum | Maximum number of input streams. |
| [in] | maxBufSurfAddrSize | Maximum number of cached surface-buffer addresses. |
| [in] | srcImgSize | Input image dimensions. |
| [in] | srcImgPitch | Input image pitch in bytes. |
| [in] | colorFormatType | Input surface color format. |
| void FrameInputTexture::initialize | ( | const int | debugVerboseLevel, |
| const int | maxStreamNum, | ||
| const int | maxBufSurfAddrSize, | ||
| const NvMotDataTypes::Size | srcImgSize, | ||
| const uint | srcImgPitch, | ||
| const NvBufSurfaceColorFormat | colorFormatType | ||
| ) |
Initialize input texture state and allocate frame memory.
| [in] | debugVerboseLevel | Debug verbosity level. |
| [in] | maxStreamNum | Maximum number of input streams. |
| [in] | maxBufSurfAddrSize | Maximum number of cached surface-buffer addresses. |
| [in] | srcImgSize | Input image dimensions. |
| [in] | srcImgPitch | Input image pitch in bytes. |
| [in] | colorFormatType | Input surface color format. |
|
protected |
Set the input image layout and allocate batch memory.
| [in] | numFramesInBatch | Number of frames in the batch. |
| [in] | frameSize | Input frame dimensions. |
| [in] | srcImgPitch | Input image pitch in bytes. |
| [in] | frameChannels | Number of input image channels. |
|
protected |
Set the input image layout and allocate batch memory.
| [in] | numFramesInBatch | Number of frames in the batch. |
| [in] | frameSize | Input frame dimensions. |
| [in] | srcImgPitch | Input image pitch in bytes. |
| [in] | frameChannels | Number of input image channels. |
|
protected |
Initialize CUDA resource and texture descriptors.
|
protected |
Initialize CUDA resource and texture descriptors.
|
protected |
Upload a batch of source frames to pitch-linear CUDA memory.
| [in] | nvFramesInBatch | Source frames keyed by stream ID. |
|
protected |
Upload a batch of source frames to pitch-linear CUDA memory.
| [in] | nvFramesInBatch | Source frames keyed by stream ID. |
|
protected |
Width, height, pitch, and channel count of the source image.
Definition at line 200 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
Referenced by getChannelsIn().
|
protected |
Color format of the source surface.
Definition at line 201 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
Referenced by getColorFormat().
|
protected |
Debug verbosity level.
Definition at line 206 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
GPU device identifier.
Definition at line 205 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
Definition at line 200 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
Referenced by getHeightIn().
|
protected |
Indicates whether execution uses an integrated GPU.
Definition at line 204 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
Indicates whether input texture state is initialized.
Definition at line 170 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
Maximum number of cached texture addresses.
Definition at line 182 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
Maximum number of frames processed in a batch.
Definition at line 183 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
Definition at line 200 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
BGRA or grayscale texture pointers keyed by stream ID.
Definition at line 174 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
NV12 texture-object pairs keyed by stream ID.
Definition at line 175 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
CUDA resource descriptor for RGBA data.
Definition at line 180 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
CUDA resource descriptor for NV12 chroma data.
Definition at line 179 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
CUDA resource descriptor for NV12 luma data.
Definition at line 178 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
Input source frames keyed by stream ID.
Definition at line 173 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
CUDA texture descriptor shared by input formats.
Definition at line 181 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
BGRA or grayscale texture objects keyed by surface address.
Definition at line 176 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
NV12 texture-object pairs keyed by surface address.
Definition at line 177 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
|
protected |
Definition at line 200 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/FrameTransform.hpp.
Referenced by getWidthIn().