Apollo
11.0
自动驾驶开放平台
yuv2rgb.h
浏览该文件的文档.
1
/******************************************************************************
2
* Copyright 2023 The Apollo Authors. All Rights Reserved.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*****************************************************************************/
16
17
#ifndef __YUV2RGB_H__
18
#define __YUV2RGB_H__
19
20
#include <cuda_runtime.h>
21
22
#include "
cyber/common/log.h
"
23
24
namespace
apollo
{
25
namespace
drivers {
26
namespace
camera {
27
28
class
CudaConvertHandler
{
29
public
:
30
CudaConvertHandler
(
unsigned
int
width,
unsigned
int
height);
31
32
CudaConvertHandler
() {}
33
34
~CudaConvertHandler
();
35
36
bool
Init
();
37
38
void
Process
(
unsigned
char
* src,
unsigned
char
* dst,
bool
zero_copy=
false
);
39
40
bool
Destory
();
41
42
private
:
43
unsigned
int
width_;
44
unsigned
int
height_;
45
46
unsigned
int
process_unit_len_ = 4;
47
unsigned
int
width_factor_ = 2;
48
unsigned
int
block_width_ = 12;
49
unsigned
int
block_height_ = 10;
50
51
dim3 block_size_;
52
dim3 grid_size_;
53
54
unsigned
char
* d_src_ =
nullptr
;
55
56
size_t
plane_size_;
57
58
cudaStream_t stream_;
59
};
60
68
void
cuda_convert_yuv_to_rgb
(
unsigned
char
* src,
unsigned
char
* dst,
unsigned
int
width,
unsigned
int
height);
69
70
}
// namespace camera
71
}
// namespace drivers
72
}
// namespace apollo
73
74
#endif
apollo::drivers::camera::CudaConvertHandler
Definition
yuv2rgb.h:28
apollo::drivers::camera::CudaConvertHandler::~CudaConvertHandler
~CudaConvertHandler()
apollo::drivers::camera::CudaConvertHandler::Destory
bool Destory()
apollo::drivers::camera::CudaConvertHandler::Init
bool Init()
apollo::drivers::camera::CudaConvertHandler::CudaConvertHandler
CudaConvertHandler()
Definition
yuv2rgb.h:32
apollo::drivers::camera::CudaConvertHandler::CudaConvertHandler
CudaConvertHandler(unsigned int width, unsigned int height)
apollo::drivers::camera::CudaConvertHandler::Process
void Process(unsigned char *src, unsigned char *dst, bool zero_copy=false)
log.h
apollo::drivers::camera::cuda_convert_yuv_to_rgb
void cuda_convert_yuv_to_rgb(unsigned char *src, unsigned char *dst, unsigned int width, unsigned int height)
floating conversion of YUV to RGB implemented with cuda
apollo
class register implement
Definition
arena_queue.h:37
modules
drivers
camera
format
yuv2rgb.h