NVIDIA DeepStream SDK API Reference

9.1 Release
sources/gst-plugins/gst-nvdspreprocess/nvdspreprocess_lib/nvdspreprocess_conversion.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
33 #ifndef __NVDSPREPROCESS_CONVERSION_H__
34 #define __NVDSPREPROCESS_CONVERSION_H__
35 
36 #include <cuda_fp16.h>
37 
58 void
60  float *outBuffer,
61  unsigned char *inBuffer,
62  unsigned int width,
63  unsigned int height,
64  unsigned int pitch,
65  float scaleFactor,
66  float *meanDataBuffer,
67  cudaStream_t stream);
68 
89 void
91  float *outBuffer,
92  unsigned char *inBuffer,
93  unsigned int width,
94  unsigned int height,
95  unsigned int pitch,
96  float scaleFactor,
97  float *meanDataBuffer,
98  cudaStream_t stream);
99 
120 void
122  float *outBuffer,
123  unsigned char *inBuffer,
124  unsigned int width,
125  unsigned int height,
126  unsigned int pitch,
127  float scaleFactor,
128  float *meanDataBuffer,
129  cudaStream_t stream);
130 
151 void
153  half *outBuffer,
154  unsigned char *inBuffer,
155  unsigned int width,
156  unsigned int height,
157  unsigned int pitch,
158  float scaleFactor,
159  float *meanDataBuffer,
160  cudaStream_t stream);
161 
182 void
184  float *outBuffer,
185  unsigned char *inBuffer,
186  unsigned int width,
187  unsigned int height,
188  unsigned int pitch,
189  float scaleFactor,
190  float *meanDataBuffer,
191  cudaStream_t stream);
192 
213 void
215  float *outBuffer,
216  unsigned char *inBuffer,
217  unsigned int width,
218  unsigned int height,
219  unsigned int pitch,
220  float scaleFactor,
221  float *meanDataBuffer,
222  cudaStream_t stream);
223 
244 void
246  float *outBuffer,
247  unsigned char *inBuffer,
248  unsigned int width,
249  unsigned int height,
250  unsigned int pitch,
251  float scaleFactor,
252  float *meanDataBuffer,
253  cudaStream_t stream);
254 
275 void
277  half *outBuffer,
278  unsigned char *inBuffer,
279  unsigned int width,
280  unsigned int height,
281  unsigned int pitch,
282  float scaleFactor,
283  float *meanDataBuffer,
284  cudaStream_t stream);
285 
306 void
308  float *outBuffer,
309  unsigned char *inBuffer,
310  unsigned int width,
311  unsigned int height,
312  unsigned int pitch,
313  float scaleFactor,
314  float *meanDataBuffer,
315  cudaStream_t stream);
316 
337 void
339  float *outBuffer,
340  unsigned char *inBuffer,
341  unsigned int width,
342  unsigned int height,
343  unsigned int pitch,
344  float scaleFactor,
345  float *meanDataBuffer,
346  cudaStream_t stream);
347 
366 void
368  float *outBuffer,
369  unsigned char *inBuffer,
370  unsigned int width,
371  unsigned int height,
372  unsigned int pitch,
373  float scaleFactor,
374  float *meanDataBuffer,
375  cudaStream_t stream);
376 
380 void
382  half *outBuffer,
383  unsigned char *inBuffer,
384  unsigned int width,
385  unsigned int height,
386  unsigned int pitch,
387  float scaleFactor,
388  float *meanDataBuffer,
389  cudaStream_t stream);
390 
391 void
393  float *outBuffer,
394  float *inBuffer,
395  unsigned int width,
396  unsigned int height,
397  unsigned int pitch,
398  float scaleFactor,
399  float *meanDataBuffer,
400  cudaStream_t stream);
401 
407  half *outBuffer,
408  unsigned char *inBuffer,
409  unsigned int width,
410  unsigned int height,
411  unsigned int pitch,
412  float scaleFactor,
413  float *meanDataBuffer,
414  cudaStream_t stream);
415 
420 typedef void (* NvDsPreProcessConvertFcn)(
421  float *outBuffer,
422  unsigned char *inBuffer,
423  unsigned int width,
424  unsigned int height,
425  unsigned int pitch,
426  float scaleFactor,
427  float *meanDataBuffer,
428  cudaStream_t stream);
429 
430 #endif /* __NVDSPREPROCESS_CONVERSION_H__ */
NvDsPreProcessConvert_C4ToP3Half
void NvDsPreProcessConvert_C4ToP3Half(half *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel half ...
NvDsPreProcessConvert_C3ToL3RFloat
void NvDsPreProcessConvert_C3ToL3RFloat(float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float...
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: sources/includes/nvbufsurftransform.h:35
NvDsPreProcessConvertFcn
void(* NvDsPreProcessConvertFcn)(float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Function pointer type to which any of the NvDsPreProcessConvert functions can be assigned.
Definition: sources/gst-plugins/gst-nvdspreprocess/nvdspreprocess_lib/nvdspreprocess_conversion.h:420
NvDsPreProcessConvert_C4ToL3RFloat
void NvDsPreProcessConvert_C4ToL3RFloat(float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Converts an input packed 4 channel buffer of width x height resolution into an linear 3-channel float...
NvDsPreProcessConvert_C4ToP3Float
void NvDsPreProcessConvert_C4ToP3Float(float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float...
NvDsPreProcessConvert_C4ToP3RFloat
void NvDsPreProcessConvert_C4ToP3RFloat(float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Converts an input packed 4 channel buffer of width x height resolution into an planar 3-channel float...
NvDsPreProcessConvert_FtFTensor
void NvDsPreProcessConvert_FtFTensor(float *outBuffer, float *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
NvDsPreProcessConvert_C4ToL3Float
void NvDsPreProcessConvert_C4ToL3Float(float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float...
NvDsPreProcessConvert_C3ToL3Float
void NvDsPreProcessConvert_C3ToL3Float(float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float...
NvDsPreProcessConvert_C3ToP3Float
void NvDsPreProcessConvert_C3ToP3Float(float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float...
NvDsPreProcessConvert_C3ToP3RFloat
void NvDsPreProcessConvert_C3ToP3RFloat(float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float...
NvDsPreProcessConvert_C1ToP1Float
void NvDsPreProcessConvert_C1ToP1Float(float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Converts an 1 channel UINT8 input of width x height resolution into an 1 channel float buffer of widt...
NvDsPreProcessConvertFcnHalf
void(* NvDsPreProcessConvertFcnHalf)(half *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Function pointer type to which any of the NvDsPreProcessConvert functions can be assigned.
Definition: sources/gst-plugins/gst-nvdspreprocess/nvdspreprocess_lib/nvdspreprocess_conversion.h:406
NvDsPreProcessConvert_C4ToP3RHalf
void NvDsPreProcessConvert_C4ToP3RHalf(half *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Converts an input packed 4 channel buffer of width x height resolution into an planar 3-channel float...
NvDsPreProcessConvert_C1ToP1Half
void NvDsPreProcessConvert_C1ToP1Half(half *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
Same as NvDsPreProcessConvert_C1ToP1Float but writes planar half (FP16) output.