cuda_kernels.h
2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#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>
typedef enum
{
ITU_601 = 1,
ITU_709 = 2
} FF_ColorSpace;
namespace cuda_common
{
cudaError_t setColorSpace(FF_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);
cudaError_t ResizeImage(float* d_srcRGB, int src_width, int src_height, float* d_dstRGB, int dst_width, int dst_height);
cudaError_t RGB2YUV(float* d_srcRGB, int src_width, int src_height,
unsigned char* Y, size_t yPitch, int yWidth, int yHeight,
unsigned char* U, size_t uPitch, int uWidth, int uHeight,
unsigned char* V, size_t vPitch, int vWidth, int vHeight);
cudaError_t RGB2YUV(unsigned char* d_srcRGB, int src_width, int src_height,
unsigned char* Y, size_t yPitch, int yWidth, int yHeight,
unsigned char* U, size_t uPitch, int uWidth, int uHeight,
unsigned char* V, size_t vPitch, int vWidth, int vHeight);
cudaError_t PartMemCopy(unsigned char* d_srcRGB, int src_width, int src_height, unsigned char* d_dstRGB, int left, int top, int right, int bottom);
// cudaError_t PartMemResize(float* d_srcRGB, int src_width, int src_height, float* d_dstRGB, int left, int top, int right, int bottom);
cudaError_t PartMemResizeBatch(unsigned char* d_srcRGB, int srcimg_width, int srcimg_height, unsigned char** d_dstRGB, int count,
int* left, int* top, int* right, int* bottom, int *dst_w, int *dst_h,
float submeanb, float submeang, float submeanr,
float varianceb, float varianceg, float variancer);
cudaError_t DrawImage(float* d_srcRGB, int src_width, int src_height, int left, int top, int right, int bottom);
cudaError_t DrawImage(unsigned char* d_srcRGB, int src_width, int src_height, int left, int top, int right, int bottom);
cudaError_t DrawLine(float* d_srcRGB, int src_width, int src_height, int begin_x, int begin_y, int end_x, int end_y);
}
int jpegNPP(const char *szOutputFile, float* d_srcRGB, int img_width, int img_height);
int jpegNPP(const char *szOutputFile, unsigned char* d_srcRGB, int img_width, int img_height);
int jpegNPP(const char *szOutputFile, float* d_srcRGB);
int jpegNPP(const char *szOutputFile, unsigned char* d_srcRGB);
int initTable();
int initTable(int flag, int width, int height);
int releaseJpegNPP();