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
24namespace apollo {
25namespace drivers {
26namespace camera {
27
29public:
30 CudaConvertHandler(unsigned int width, unsigned int height);
31
33
35
36 bool Init();
37
38 void Process(unsigned char* src, unsigned char* dst, bool zero_copy=false);
39
40 bool Destory();
41
42private:
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
68void 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
CudaConvertHandler(unsigned int width, unsigned int height)
void Process(unsigned char *src, unsigned char *dst, bool zero_copy=false)
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
class register implement
Definition arena_queue.h:37