Blame view

FFNvDecoder/cuda_kernels.h 1.12 KB
a359bb4f   Hu Chunming   调通可正常运行 -- 初版
1
2
3
4
5
6
7
8
9
10
11
12
  #pragma once
  #include "cuda_runtime.h"
  #include "device_launch_parameters.h"
  
  #include <stdio.h>
  #include <stdlib.h>
  
  #include <string.h>
  #include <math.h>
  
  #include <cuda.h>
  
07639e75   Hu Chunming   实现狗狗姿态检测
13
14
15
16
  typedef unsigned char   uint8;
  typedef unsigned int    uint32;
  typedef int             int32;
  
a359bb4f   Hu Chunming   调通可正常运行 -- 初版
17
18
19
20
21
22
23
24
25
26
27
28
  typedef enum
  {
  	ITU601 = 1,
  	ITU709 = 2
  } e_ColorSpace;
  
  namespace cuda_common
  {
  	cudaError_t setColorSpace(e_ColorSpace CSC, float hue);
  
  	cudaError_t NV12ToRGBnot(CUdeviceptr d_srcNV12, size_t nSourcePitch, unsigned char* d_dstRGB, int width, int height);
  	cudaError_t CUDAToBGR(CUdeviceptr dataY, CUdeviceptr dataUV, size_t pitchY, size_t pitchUV, unsigned char* d_dstRGB, int width, int height);
07639e75   Hu Chunming   实现狗狗姿态检测
29
30
31
32
33
34
35
  
  	//int resizeAndNorm(void * p, int in_w, int in_h, float *d, int w, int h, bool keepration, bool keepcenter, cudaStream_t stream);
  	//int resizeAndNorm(void * p, int in_w, int in_h, float *d, int w, int h, bool keepration, bool keepcenter);
  	cudaError_t resizeAndNorm(unsigned char* d_srcRGB, int src_width, int src_height, float* d_dstRGB, int dst_width, int dst_height);
  
  	int copy2square(void * p, void *d, int w, int h, int max_side_length, cudaStream_t stream);
  
a359bb4f   Hu Chunming   调通可正常运行 -- 初版
36
  }