Ocean
Loading...
Searching...
No Matches
FrameConverterY_VU12.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_CV_FRAME_CONVERTER_Y_VU_12_H
9#define META_OCEAN_CV_FRAME_CONVERTER_Y_VU_12_H
10
11#include "ocean/cv/CV.h"
14
15namespace Ocean
16{
17
18namespace CV
19{
20
21/**
22 * This class provides functions to convert frames with Y_VU12 pixel format.
23 * @ingroup cv
24 */
25class OCEAN_CV_EXPORT FrameConverterY_VU12 : public FrameConverter
26{
27 public:
28
29 /**
30 * Converts a Y_VU12_LIMITED_RANGE frame to a Y8_LIMITED_RANGE frame into a second image buffer.
31 * @param ySource The y source frame buffer, with (width + yPaddingElements) * height elements, must be valid
32 * @param vuSource The vu source frame buffer, with (2 * width/2 + vuPaddingElements) * height/2 elements, can be invalid, as this parameter is not used
33 * @param target The target frame buffer, with (width + targetPaddingElements) * height elements, must be valid
34 * @param width The width of the frame in pixel, with range [2, infinity), must be a multiple of 2
35 * @param height The height of the frame in pixel, with range [2, infinity), must be a multiple of 2
36 * @param flag Determining the type of conversion
37 * @param ySourcePaddingElements The number of padding elements at the end of each y-source row, in (uint8_t) elements, with range [0, infinity)
38 * @param vuSourcePaddingElements The number of padding elements at the end of each vu-source row, in (uint8_t) elements, with range [0, infinity), actually this parameter is not used
39 * @param targetPaddingElements The number of padding elements at the end of each target row, in (uint8_t) elements, with range [0, infinity)
40 * @param worker Optional worker object to distribute the computational to several CPU cores
41 */
42 static inline void convertY_VU12LimitedRangeToY8LimitedRange(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker = nullptr);
43
44 /**
45 * Converts a Y_VU12_LIMITED_RANGE frame to a Y8_FULL_RANGE frame into a second image buffer.
46 * @param ySource The y source frame buffer, with (width + yPaddingElements) * height elements, must be valid
47 * @param vuSource The vu source frame buffer, with (2 * width/2 + vuPaddingElements) * height/2 elements, can be invalid, as this parameter is not used
48 * @param target The target frame buffer, with (width + targetPaddingElements) * height elements, must be valid
49 * @param width The width of the frame in pixel, with range [2, infinity), must be a multiple of 2
50 * @param height The height of the frame in pixel, with range [2, infinity), must be a multiple of 2
51 * @param flag Determining the type of conversion
52 * @param ySourcePaddingElements The number of padding elements at the end of each y-source row, in (uint8_t) elements, with range [0, infinity)
53 * @param vuSourcePaddingElements The number of padding elements at the end of each vu-source row, in (uint8_t) elements, with range [0, infinity), actually this parameter is not used
54 * @param targetPaddingElements The number of padding elements at the end of each target row, in (uint8_t) elements, with range [0, infinity)
55 * @param worker Optional worker object to distribute the computational to several CPU cores
56 */
57 static inline void convertY_VU12LimitedRangeToY8FullRange(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker = nullptr);
58
59 /**
60 * Converts a Y_VU12_FULL_RANGE frame to a Y8_FULL_RANGE frame into a second image buffer.
61 * @param ySource The y source frame buffer, with (width + yPaddingElements) * height elements, must be valid
62 * @param vuSource The vu source frame buffer, with (2 * width/2 + vuPaddingElements) * height/2 elements, can be invalid, as this parameter is not used
63 * @param target The target frame buffer, with (width + targetPaddingElements) * height elements, must be valid
64 * @param width The width of the frame in pixel, with range [2, infinity), must be a multiple of 2
65 * @param height The height of the frame in pixel, with range [2, infinity), must be a multiple of 2
66 * @param flag Determining the type of conversion
67 * @param ySourcePaddingElements The number of padding elements at the end of each y-source row, in (uint8_t) elements, with range [0, infinity)
68 * @param vuSourcePaddingElements The number of padding elements at the end of each vu-source row, in (uint8_t) elements, with range [0, infinity), actually this parameter is not used
69 * @param targetPaddingElements The number of padding elements at the end of each target row, in (uint8_t) elements, with range [0, infinity)
70 * @param worker Optional worker object to distribute the computational to several CPU cores
71 */
72 static inline void convertY_VU12FullRangeToY8FullRange(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker = nullptr);
73
74 /**
75 * Converts a Y_VU12_FULL_RANGE frame to a Y8_LIMITED_RANGE frame into a second image buffer.
76 * @param ySource The y source frame buffer, with (width + yPaddingElements) * height elements, must be valid
77 * @param vuSource The vu source frame buffer, with (2 * width/2 + vuPaddingElements) * height/2 elements, can be invalid, as this parameter is not used
78 * @param target The target frame buffer, with (width + targetPaddingElements) * height elements, must be valid
79 * @param width The width of the frame in pixel, with range [2, infinity), must be a multiple of 2
80 * @param height The height of the frame in pixel, with range [2, infinity), must be a multiple of 2
81 * @param flag Determining the type of conversion
82 * @param ySourcePaddingElements The number of padding elements at the end of each y-source row, in (uint8_t) elements, with range [0, infinity)
83 * @param vuSourcePaddingElements The number of padding elements at the end of each vu-source row, in (uint8_t) elements, with range [0, infinity), actually this parameter is not used
84 * @param targetPaddingElements The number of padding elements at the end of each target row, in (uint8_t) elements, with range [0, infinity)
85 * @param worker Optional worker object to distribute the computational to several CPU cores
86 */
87 static inline void convertY_VU12FullRangeToY8LimitedRange(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker = nullptr);
88
89 /**
90 * Converts a Y_VU12_LIMITED_RANGE frame to a BGR24 frame into a second image buffer.
91 * <pre>
92 * YVU input value range: [16, 235]x[16, 240]x[16, 240]
93 * BGR output value range: [ 0, 255]x[ 0, 255]x[ 0, 255]
94 * </pre>
95 * Note: In case the given source memory contains y and uv data without any padding elements, 'vuSource' is given by 'uvSource = ySource + width * height'.
96 * @param ySource The y source frame buffer, with (width + yPaddingElements) * height elements, must be valid
97 * @param vuSource The vu source frame buffer, with (2 * width/2 + vvuPaddingElements) * height/2 elements, must be valid
98 * @param target The target frame buffer, with (3 * width + targetPaddingElements) * height elements, must be valid
99 * @param width The width of the frame in pixel, with range [2, infinity), must be a multiple of 2
100 * @param height The height of the frame in pixel, with range [2, infinity), must be a multiple of 2
101 * @param flag Determining the type of conversion
102 * @param ySourcePaddingElements The number of padding elements at the end of each y-source row, in (uint8_t) elements, with range [0, infinity)
103 * @param vuSourcePaddingElements The number of padding elements at the end of each vu-source row, in (uint8_t) elements, with range [0, infinity)
104 * @param targetPaddingElements The number of padding elements at the end of each target row, in (uint8_t) elements, with range [0, infinity)
105 * @param worker Optional worker object to distribute the computational to several CPU cores
106 */
107 static inline void convertY_VU12LimitedRangeToBGR24FullRange(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker = nullptr);
108
109 /**
110 * Converts a Y_VU12_FULL_RANGE frame to a BGRA32 frame into a second image buffer applying a transformation similar to BT.601.
111 * The actual transformation is close to the official BT.601 standard and used on Android for conversion from Y'UV420sp (NV21).<br>
112 * <pre>
113 * YVU input value range: [0, 255]x[0, 255]x[0, 255]
114 * BGRA output value range: [0, 255]x[0, 255]x[0, 255]x[0, 255]
115 * </pre>
116 * Note: In case the given source memory contains y and uv data without any padding elements, 'vuSource' is given by 'uvSource = ySource + width * height'.
117 * @param ySource The y source frame buffer, with (width + yPaddingElements) * height elements, must be valid
118 * @param vuSource The vu source frame buffer, with (2 * width/2 + vvuPaddingElements) * height/2 elements, must be valid
119 * @param target The target frame buffer, with (3 * width + targetPaddingElements) * height elements, must be valid
120 * @param width The width of the frame in pixel, with range [2, infinity), must be a multiple of 2
121 * @param height The height of the frame in pixel, with range [2, infinity), must be a multiple of 2
122 * @param flag Determining the type of conversion
123 * @param ySourcePaddingElements The number of padding elements at the end of each y-source row, in (uint8_t) elements, with range [0, infinity)
124 * @param vuSourcePaddingElements The number of padding elements at the end of each vu-source row, in (uint8_t) elements, with range [0, infinity)
125 * @param targetPaddingElements The number of padding elements at the end of each target row, in (uint8_t) elements, with range [0, infinity)
126 * @param alphaValue The value of the alpha channel to be set, with range [0, 255]
127 * @param worker Optional worker object to distribute the computational to several CPU cores
128 */
129 static inline void convertY_VU12FullRangeToBGRA32FullRangeAndroid(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, const uint8_t alphaValue = 0xFF, Worker* worker = nullptr);
130
131 /**
132 * Converts a Y_VU12_LIMITED_RANGE frame to a RGB24 frame into a second image buffer.
133 * <pre>
134 * YVU input value range: [16, 235]x[16, 240]x[16, 240]
135 * RGB output value range: [ 0, 255]x[ 0, 255]x[ 0, 255]
136 * </pre>
137 * Note: In case the given source memory contains y and uv data without any padding elements, 'vuSource' is given by 'uvSource = ySource + width * height'.
138 * @param ySource The y source frame buffer, with (width + yPaddingElements) * height elements, must be valid
139 * @param vuSource The vu source frame buffer, with (2 * width/2 + vvuPaddingElements) * height/2 elements, must be valid
140 * @param target The target frame buffer, with (3 * width + targetPaddingElements) * height elements, must be valid
141 * @param width The width of the frame in pixel, with range [2, infinity), must be a multiple of 2
142 * @param height The height of the frame in pixel, with range [2, infinity), must be a multiple of 2
143 * @param flag Determining the type of conversion
144 * @param ySourcePaddingElements The number of padding elements at the end of each y-source row, in (uint8_t) elements, with range [0, infinity)
145 * @param vuSourcePaddingElements The number of padding elements at the end of each vu-source row, in (uint8_t) elements, with range [0, infinity)
146 * @param targetPaddingElements The number of padding elements at the end of each target row, in (uint8_t) elements, with range [0, infinity)
147 * @param worker Optional worker object to distribute the computational to several CPU cores
148 */
149 static inline void convertY_VU12LimitedRangeToRGB24FullRange(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker = nullptr);
150
151 /**
152 * Converts a Y_VU12_FULL_RANGE frame to a RGB24 frame into a second image buffer.
153 * <pre>
154 * YVU input value range: [0, 255]x[0, 255]x[0, 255]
155 * RGB output value range: [0, 255]x[0, 255]x[0, 255]
156 * </pre>
157 * Note: In case the given source memory contains y and uv data without any padding elements, 'vuSource' is given by 'uvSource = ySource + width * height'.
158 * @param ySource The y source frame buffer, with (width + yPaddingElements) * height elements, must be valid
159 * @param vuSource The vu source frame buffer, with (2 * width/2 + vvuPaddingElements) * height/2 elements, must be valid
160 * @param target The target frame buffer, with (3 * width + targetPaddingElements) * height elements, must be valid
161 * @param width The width of the frame in pixel, with range [2, infinity), must be a multiple of 2
162 * @param height The height of the frame in pixel, with range [2, infinity), must be a multiple of 2
163 * @param flag Determining the type of conversion
164 * @param ySourcePaddingElements The number of padding elements at the end of each y-source row, in (uint8_t) elements, with range [0, infinity)
165 * @param vuSourcePaddingElements The number of padding elements at the end of each vu-source row, in (uint8_t) elements, with range [0, infinity)
166 * @param targetPaddingElements The number of padding elements at the end of each target row, in (uint8_t) elements, with range [0, infinity)
167 * @param worker Optional worker object to distribute the computational to several CPU cores
168 */
169 static inline void convertY_VU12FullRangeToRGB24FullRangePrecision6Bit(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker = nullptr);
170
171 /**
172 * Converts a Y_VU12 frame to an 24 bit YUV frame into a second image buffer.
173 * Note: In case the given source memory contains y and uv data without any padding elements, 'vuSource' is given by 'uvSource = ySource + width * height'.
174 * @param ySource The y source frame buffer, with (width + yPaddingElements) * height elements, must be valid
175 * @param vuSource The vu source frame buffer, with (2 * width/2 + vvuPaddingElements) * height/2 elements, must be valid
176 * @param target The target frame buffer, with (3 * width + targetPaddingElements) * height elements, must be valid
177 * @param width The width of the frame in pixel, with range [2, infinity), must be a multiple of 2
178 * @param height The height of the frame in pixel, with range [2, infinity), must be a multiple of 2
179 * @param flag Determining the type of conversion
180 * @param ySourcePaddingElements The number of padding elements at the end of each y-source row, in (uint8_t) elements, with range [0, infinity)
181 * @param vuSourcePaddingElements The number of padding elements at the end of each vu-source row, in (uint8_t) elements, with range [0, infinity)
182 * @param targetPaddingElements The number of padding elements at the end of each target row, in (uint8_t) elements, with range [0, infinity)
183 * @param worker Optional worker object to distribute the computational to several CPU cores
184 */
185 static inline void convertY_VU12ToYUV24(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker = nullptr);
186
187 /**
188 * Converts a Y_VU12 frame to an 24 bit YVU frame into a second image buffer.
189 * Note: In case the given source memory contains y and uv data without any padding elements, 'vuSource' is given by 'uvSource = ySource + width * height'.
190 * @param ySource The y source frame buffer, with (width + yPaddingElements) * height elements, must be valid
191 * @param vuSource The vu source frame buffer, with (2 * width/2 + vvuPaddingElements) * height/2 elements, must be valid
192 * @param target The target frame buffer, with (3 * width + targetPaddingElements) * height elements, must be valid
193 * @param width The width of the frame in pixel, with range [2, infinity), must be a multiple of 2
194 * @param height The height of the frame in pixel, with range [2, infinity), must be a multiple of 2
195 * @param flag Determining the type of conversion
196 * @param ySourcePaddingElements The number of padding elements at the end of each y-source row, in (uint8_t) elements, with range [0, infinity)
197 * @param vuSourcePaddingElements The number of padding elements at the end of each vu-source row, in (uint8_t) elements, with range [0, infinity)
198 * @param targetPaddingElements The number of padding elements at the end of each target row, in (uint8_t) elements, with range [0, infinity)
199 * @param worker Optional worker object to distribute the computational to several CPU cores
200 */
201 static inline void convertY_VU12ToYVU24(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker = nullptr);
202
203 /**
204 * Converts a Y_VU12 frame to a Y_UV12 frame into a second image buffer.
205 * @param ySource The y source frame buffer, with (width + yPaddingElements) * height elements, must be valid
206 * @param vuSource The vu source frame buffer, with (2 * width/2 + vuPaddingElements) * height/2 elements, must be valid
207 * @param yTarget The target frame buffer, with (width + yTargetPaddingElements) * height elements, must be valid
208 * @param uvTarget The target frame buffer, with (2 * width/2 + uvTargetPaddingElements) * height/2 elements, must be valid
209 * @param width The width of the frame in pixel, with range [2, infinity), must be a multiple of 2
210 * @param height The height of the frame in pixel, with range [2, infinity), must be a multiple of 2
211 * @param flag Determining the type of conversion
212 * @param ySourcePaddingElements The number of padding elements at the end of each y-source row, in (uint8_t) elements, with range [0, infinity)
213 * @param vuSourcePaddingElements The number of padding elements at the end of each vu-source row, in (uint8_t) elements, with range [0, infinity)
214 * @param yTargetPaddingElements The number of padding elements at the end of each y-target row, in (uint8_t) elements, with range [0, infinity)
215 * @param uvTargetPaddingElements The number of padding elements at the end of each uv-target row, in (uint8_t) elements, with range [0, infinity)
216 * @param worker Optional worker object to distribute the computational to several CPU cores
217 */
218 static inline void convertY_VU12ToY_UV12(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* yTarget, uint8_t* uvTarget, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int yTargetPaddingElements, const unsigned int uvTargetPaddingElements, Worker* worker = nullptr);
219
220 /**
221 * Converts a Y_VU12 frame to a Y_U_V12 frame into a second image buffer.
222 * @param ySource The y source frame buffer, with (width + yPaddingElements) * height elements, must be valid
223 * @param vuSource The vu source frame buffer, with (2 * width/2 + vuPaddingElements) * height/2 elements, must be valid
224 * @param yTarget The target frame buffer, with (width + yTargetPaddingElements) * height elements, must be valid
225 * @param uTarget The target frame buffer, with (width/2 + uTargetPaddingElements) * height/2 elements, must be valid
226 * @param vTarget The target frame buffer, with (width/2 + vTargetPaddingElements) * height/2 elements, must be valid
227 * @param width The width of the frame in pixel, with range [2, infinity), must be a multiple of 2
228 * @param height The height of the frame in pixel, with range [2, infinity), must be a multiple of 2
229 * @param flag Determining the type of conversion
230 * @param ySourcePaddingElements The number of padding elements at the end of each y-source row, in (uint8_t) elements, with range [0, infinity)
231 * @param vuSourcePaddingElements The number of padding elements at the end of each vu-source row, in (uint8_t) elements, with range [0, infinity)
232 * @param yTargetPaddingElements The number of padding elements at the end of each y-target row, in (uint8_t) elements, with range [0, infinity)
233 * @param uTargetPaddingElements The number of padding elements at the end of each u-target row, in (uint8_t) elements, with range [0, infinity)
234 * @param vTargetPaddingElements The number of padding elements at the end of each v-target row, in (uint8_t) elements, with range [0, infinity)
235 * @param worker Optional worker object to distribute the computational to several CPU cores
236 */
237 static inline void convertY_VU12ToY_U_V12(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* yTarget, uint8_t* uTarget, uint8_t* vTarget, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int yTargetPaddingElements, const unsigned int uTargetPaddingElements, const unsigned int vTargetPaddingElements, Worker* worker = nullptr);
238
239 protected:
240
241 /**
242 * Converts one row of an image with Y_UV12 pixel format to one row of an image with BGRA32 pixel format.
243 * This function needs one plane with the first channel and another plane/block of 2x2 sub-sampled pixels containing the second and third channels.<br>
244 * The layout of the options parameters is as follows:
245 * <pre>
246 * options[0] uint32_t: sourcePlanePaddingElements
247 * options[1] uint32_t: sourceZippedPaddingElements
248 * options[2] uint32_t: targetZippedPaddingElements
249 * options[3] uint32_t: alphaValue
250 * </pre>
251 * @param sources The pointer to the first and second memory block of the source image, must be valid
252 * @param targets The one pointer to the target image, must be valid
253 * @param multipleRowIndex The index of the multiple-row to be handled, with range [0, height / multipleRowsPerIteration - 1]
254 * @param width The width of the frame in pixel, with range [1, infinity)
255 * @param height The height of the frame in pixel, with range [multipleRowsPerIteration, infinity)
256 * @param conversionFlag The conversion to be applied
257 * @param options The 4 options parameters: 3 padding parameters, 1 alpha value parameter, must be valid
258 */
259 static void convertOneRowY_VU12FullRangeToBGRA32FullRangeAndroidPrecision6Bit(const void** sources, void** targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void* options);
260
261 /**
262 * Converts two rows of an image with Y_UV12 pixel format to two rows of an image with BGRA32 pixel format.
263 * This function needs one plane with the first channel and another plane/block of 2x2 sub-sampled pixels containing the second and third channels.<br>
264 * The layout of the options parameters is as follows:
265 * <pre>
266 * options[0] uint32_t: sourcePlanePaddingElements
267 * options[1] uint32_t: sourceZippedPaddingElements
268 * options[2] uint32_t: targetZippedPaddingElements
269 * options[3] uint32_t: alphaValue
270 * </pre>
271 * @param sources The pointer to the first and second memory block of the source image, must be valid
272 * @param targets The one pointer to the target image, must be valid
273 * @param multipleRowIndex The index of the multiple-row to be handled, with range [0, height / multipleRowsPerIteration - 1]
274 * @param width The width of the frame in pixel, with range [1, infinity)
275 * @param height The height of the frame in pixel, with range [multipleRowsPerIteration, infinity)
276 * @param conversionFlag The conversion to be applied
277 * @param options The 4 options parameters: 3 padding parameters, 1 alpha value parameter, must be valid
278 */
279 static void convertTwoRowsY_VU12FullRangeToBGRA32FullRangeAndroidPrecision6Bit(const void** sources, void** targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void* options);
280};
281
282inline void FrameConverterY_VU12::convertY_VU12LimitedRangeToY8LimitedRange(const uint8_t* ySource, const uint8_t* /* vuSource */, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int /* vuSourcePaddingElements */, const unsigned int targetPaddingElements, Worker* worker)
283{
284 ocean_assert(ySource != nullptr && target != nullptr);
285 ocean_assert(width >= 1u && height >= 1u);
286
287 FrameChannels::transformGeneric<uint8_t, 1u>(ySource, target, width, height, flag, ySourcePaddingElements, targetPaddingElements, worker);
288}
289
290inline void FrameConverterY_VU12::convertY_VU12LimitedRangeToY8FullRange(const uint8_t* ySource, const uint8_t* /* vuSource */, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int /* vuSourcePaddingElements */, const unsigned int targetPaddingElements, Worker* worker)
291{
292 ocean_assert(ySource != nullptr && target != nullptr);
293 ocean_assert(width >= 1u && height >= 1u);
294
295 FrameConverterY8::convertY8LimitedRangeToY8FullRange(ySource, target, width, height, flag, ySourcePaddingElements, targetPaddingElements, worker);
296}
297
298inline void FrameConverterY_VU12::convertY_VU12FullRangeToY8FullRange(const uint8_t* ySource, const uint8_t* /* vuSource */, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int /* vuSourcePaddingElements */, const unsigned int targetPaddingElements, Worker* worker)
299{
300 ocean_assert(ySource != nullptr && target != nullptr);
301 ocean_assert(width >= 1u && height >= 1u);
302
303 FrameChannels::transformGeneric<uint8_t, 1u>(ySource, target, width, height, flag, ySourcePaddingElements, targetPaddingElements, worker);
304}
305
306inline void FrameConverterY_VU12::convertY_VU12FullRangeToY8LimitedRange(const uint8_t* ySource, const uint8_t* /* vuSource */, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int /* vuSourcePaddingElements */, const unsigned int targetPaddingElements, Worker* worker)
307{
308 ocean_assert(ySource != nullptr && target != nullptr);
309 ocean_assert(width >= 1u && height >= 1u);
310
311 FrameConverterY8::convertY8FullRangeToY8LimitedRange(ySource, target, width, height, flag, ySourcePaddingElements, targetPaddingElements, worker);
312}
313
314inline void FrameConverterY_VU12::convertY_VU12LimitedRangeToBGR24FullRange(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker)
315{
316 ocean_assert(ySource != nullptr && vuSource != nullptr && target != nullptr);
317
318 ocean_assert(width >= 2u && width % 2u == 0u);
319 ocean_assert(height >= 2u && height % 2u == 0u);
320
321 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
322 {
323 return;
324 }
325
326 // YVU input value range: [16, 235]x[16, 240]x[16, 240]
327 // BGR output value range: [ 0, 255]x[ 0, 255]x[ 0, 255]
328
329 // precise color space conversion:
330 // | B | | 1.1639404296875 0.0 2.0179443359375 -276.919921875 | | Y |
331 // | G | = | 1.1639404296875 -0.81298828125 -0.3909912109375 135.486328125 | * | V |
332 // | R | | 1.1639404296875 1.595947265625 0.0 -222.904296875 | | U |
333 // | 1 |
334
335#if 1
336
337 // Approximation with 6 bit precision:
338 // | B | | 75 0 128 | | Y - 16 |
339 // 64 * | G | = | 75 -52 -25 | * | V - 128 |
340 // | R | | 75 102 0 | | U - 128 |
341
342 const int options[3 + 12] =
343 {
344 // padding parameters
345 int(ySourcePaddingElements), int(vuSourcePaddingElements), int(targetPaddingElements),
346
347 // multiplication parameters
348 75, 75, 75, 0, -52, 102, 128, -25, 0,
349
350 // bias/translation parameters
351 16, 128, 128
352 };
353
354 const void* sources[2] =
355 {
356 ySource,
357 vuSource
358 };
359
361
362#else
363
364 // Approximation with 10 bit precision:
365 // | B | | 1192 0 2066 -277 | | Y |
366 // | G | = | 1192 -833 -400 135 | * | V |
367 // | R | | 1192 1634 0 -223 | | U |
368 // | 1 |
369
370 const int options[3 + 12] =
371 {
372 // padding parameters
373 int(ySourcePaddingElements), int(vuSourcePaddingElements), int(targetPaddingElements),
374
375 // multiplication parameters (with denominator 1024)
376 1192, 1192, 1192, 0, -833, 1634, 2066, -400, 0,
377
378 // bias/translation parameters (with denominator 1)
379 -277, 135, -223
380 };
381
382 const void* sources[2] =
383 {
384 ySource,
385 vuSource
386 };
387
388 FrameConverter::convertArbitraryPixelFormat(sources, (void**)(&target), width, height, flag, 1u, FrameConverter::convertOneRow1PlaneAnd2ChannelsZippedDownsampled2x2ToZipped3Channels8BitPerChannelPrecision10Bit, options, worker);
389
390#endif
391
392}
393
394inline void FrameConverterY_VU12::convertY_VU12FullRangeToBGRA32FullRangeAndroid(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, const uint8_t alphaValue, Worker* worker)
395{
396 ocean_assert(ySource != nullptr && vuSource != nullptr && target != nullptr);
397
398 ocean_assert(width >= 2u && width % 2u == 0u);
399 ocean_assert(height >= 2u && height % 2u == 0u);
400
401 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
402 {
403 return;
404 }
405
406 const int options[3 + 1] =
407 {
408 // padding parameters
409 int(ySourcePaddingElements), int(vuSourcePaddingElements), int(targetPaddingElements),
410
411 // alpha value
412 int(alphaValue)
413 };
414
415 const void* sources[2] =
416 {
417 ySource,
418 vuSource
419 };
420
421#if 1
423#else
425#endif
426
427}
428
429inline void FrameConverterY_VU12::convertY_VU12LimitedRangeToRGB24FullRange(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker)
430{
431 ocean_assert(ySource != nullptr && vuSource != nullptr && target != nullptr);
432
433 ocean_assert(width >= 2u && width % 2u == 0u);
434 ocean_assert(height >= 2u && height % 2u == 0u);
435
436 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
437 {
438 return;
439 }
440
441 // YVU input value range: [16, 235]x[16, 240]x[16, 240]
442 // RGB output value range: [ 0, 255]x[ 0, 255]x[ 0, 255]
443
444 // precise color space conversion:
445 // | R | | 1.1639404296875 1.595947265625 0.0 -222.904296875 | | Y |
446 // | G | = | 1.1639404296875 -0.81298828125 -0.3909912109375 135.486328125 | * | V |
447 // | B | | 1.1639404296875 0.0 2.0179443359375 -276.919921875 | | U |
448 // | 1 |
449
450#if 1
451
452 // Approximation with 6 bit precision:
453 // | R | | 75 102 0 | | Y - 16 |
454 // 64 * | G | = | 75 -52 -25 | * | V - 128 |
455 // | B | | 75 0 128 | | U - 128 |
456
457 const int options[3 + 12] =
458 {
459 // padding parameters
460 int(ySourcePaddingElements), int(vuSourcePaddingElements), int(targetPaddingElements),
461
462 // multiplication parameters
463 75, 75, 75, 102, -52, 0, 0, -25, 128,
464
465 // bias/translation parameters
466 16, 128, 128
467 };
468
469 const void* sources[2] =
470 {
471 ySource,
472 vuSource
473 };
474
476
477#else
478
479 // Approximation with 10 bit precision:
480 // | R | | 1192 1634 0 -223 | | Y |
481 // | G | = | 1192 -833 -400 135 | * | U |
482 // | B | | 1192 0 2066 -277 | | V |
483 // | 1 |
484
485 const int options[3 + 12] =
486 {
487 // padding parameters
488 int(ySourcePaddingElements), int(vuSourcePaddingElements), int(targetPaddingElements),
489
490 // multiplication parameters (with denominator 1024)
491 1192, 1192, 1192, 1634, -833, 0, 0, -400, 2066,
492
493 // bias/translation parameters (with denominator 1)
494 -223, 135, -277
495 };
496
497 const void* sources[2] =
498 {
499 ySource,
500 vuSource
501 };
502
503 FrameConverter::convertArbitraryPixelFormat(sources, (void**)(&target), width, height, flag, 1u, FrameConverter::convertOneRow1PlaneAnd2ChannelsZippedDownsampled2x2ToZipped3Channels8BitPerChannelPrecision10Bit, options, worker);
504
505#endif
506
507}
508
509inline void FrameConverterY_VU12::convertY_VU12FullRangeToRGB24FullRangePrecision6Bit(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker)
510{
511 ocean_assert(ySource != nullptr && vuSource != nullptr && target != nullptr);
512
513 ocean_assert(width >= 2u && width % 2u == 0u);
514 ocean_assert(height >= 2u && height % 2u == 0u);
515
516 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
517 {
518 return;
519 }
520
521 /*
522 * | R | | 1.0 1.402 0.0 1.402 -179.456 | | Y |
523 * | G | = | 1.0 -0.71414 -0.34414 -0.71414 135.45984 | * | V |
524 * | B | | 1.0 0.0 1.772 0.0 -226.816 | | U |
525 * | 1 |
526 *
527 * Approximation with 6 bit precision:
528 * | R | | 64 90 0 | | Y |
529 * 64 * | G | = | 64 -46 -22 | * | V - 128 |
530 * | B | | 64 0 113 | | U - 128 |
531 */
532
533 const int options[3 + 12] =
534 {
535 // padding parameters
536 int(ySourcePaddingElements), int(vuSourcePaddingElements), int(targetPaddingElements),
537
538 // multiplication parameters
539 64, 64, 64, 90, -46, 0, 0, -22, 113,
540
541 // bias/translation parameters
542 0, 128, 128
543 };
544
545 const void* sources[2] =
546 {
547 ySource,
548 vuSource
549 };
550
552}
553
554inline void FrameConverterY_VU12::convertY_VU12ToYUV24(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker)
555{
556 ocean_assert(ySource != nullptr && vuSource != nullptr && target != nullptr);
557
558 ocean_assert(width >= 2u && width % 2u == 0u);
559 ocean_assert(height >= 2u && height % 2u == 0u);
560
561 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
562 {
563 return;
564 }
565
566 const unsigned int options[3] = {ySourcePaddingElements, vuSourcePaddingElements, targetPaddingElements};
567
568 const void* sources[2] =
569 {
570 ySource,
571 vuSource
572 };
573
574 FrameConverter::convertArbitraryPixelFormat(sources, (void**)(&target), width, height, flag, 2u, FrameConverter::mapTwoRows_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel<0u, 2u, 1u>, options, worker);
575}
576
577inline void FrameConverterY_VU12::convertY_VU12ToYVU24(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker)
578{
579 ocean_assert(ySource != nullptr && vuSource != nullptr && target != nullptr);
580
581 ocean_assert(width >= 2u && width % 2u == 0u);
582 ocean_assert(height >= 2u && height % 2u == 0u);
583
584 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
585 {
586 return;
587 }
588
589 const unsigned int options[3] = {ySourcePaddingElements, vuSourcePaddingElements, targetPaddingElements};
590
591 const void* sources[2] =
592 {
593 ySource,
594 vuSource
595 };
596
597 FrameConverter::convertArbitraryPixelFormat(sources, (void**)(&target), width, height, flag, 2u, FrameConverter::mapTwoRows_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel<0u, 1u, 2u>, options, worker);
598}
599
600inline void FrameConverterY_VU12::convertY_VU12ToY_UV12(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* yTarget, uint8_t* uvTarget, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int yTargetPaddingElements, const unsigned int uvTargetPaddingElements, Worker* worker)
601{
602 ocean_assert(ySource != nullptr && vuSource != nullptr && yTarget != nullptr && uvTarget != nullptr);
603
604 ocean_assert(width >= 2u && width % 2u == 0u);
605 ocean_assert(height >= 2u && height % 2u == 0u);
606
607 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
608 {
609 return;
610 }
611
612 // first, we handle the y-plane
613 FrameChannels::transformGeneric<uint8_t, 1u>(ySource, yTarget, width, height, flag, ySourcePaddingElements, yTargetPaddingElements, worker);
614
615 // now we handle the vu-plane
616
617 FrameChannels::reverseChannelOrder<uint8_t, 2u>(vuSource, uvTarget, width / 2u, height / 2u, flag, vuSourcePaddingElements, uvTargetPaddingElements, worker);
618}
619
620inline void FrameConverterY_VU12::convertY_VU12ToY_U_V12(const uint8_t* ySource, const uint8_t* vuSource, uint8_t* yTarget, uint8_t* uTarget, uint8_t* vTarget, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int yTargetPaddingElements, const unsigned int uTargetPaddingElements, const unsigned int vTargetPaddingElements, Worker* worker)
621{
622 ocean_assert(ySource != nullptr && vuSource != nullptr && yTarget != nullptr && uTarget != nullptr && vTarget != nullptr);
623
624 ocean_assert(width >= 2u && width % 2u == 0u);
625 ocean_assert(height >= 2u && height % 2u == 0u);
626
627 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
628 {
629 return;
630 }
631
632 // first, we handle the y-plane
633 FrameChannels::transformGeneric<uint8_t, 1u>(ySource, yTarget, width, height, flag, ySourcePaddingElements, yTargetPaddingElements, worker);
634
635 // now we handle the vu-plane
636
637 const unsigned int options[3] = {vuSourcePaddingElements, vTargetPaddingElements, uTargetPaddingElements};
638
639 void* targets[2] =
640 {
641 vTarget,
642 uTarget
643 };
644
645 FrameConverter::convertArbitraryPixelFormat((const void**)(&vuSource), targets, width / 2u, height / 2u, flag, 1u, FrameConverter::mapOneRow_1Plane2Channels_To_2Planes1Channel_8BitPerChannel, options, worker);
646}
647
648}
649
650}
651
652#endif // META_OCEAN_CV_FRAME_CONVERTER_Y_VU_12_H
This is the base class for all frame converter classes.
Definition FrameConverter.h:32
ConversionFlag
Definition of individual conversion flags.
Definition FrameConverter.h:39
static void convertTwoRows_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision6Bit(const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
Converts two rows of an image with e.g., a Y_UV12 pixel format to two rows of an image with e....
static void mapOneRow_1Plane2Channels_To_2Planes1Channel_8BitPerChannel(const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
Maps one row of a 1-plane, 2-channel image to two planes with 1 channels.
static void convertArbitraryPixelFormat(const void **sources, void **targets, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int multipleRowsPerIteration, const MultipleRowsConversionFunction multipleRowsConversionFunction, const void *options, Worker *worker)
Converts a frame with arbitrary pixel format (e.g., Y_UV12, Y_VU12, YUYV16, ...) to a frame with arbi...
Definition FrameConverter.h:3506
static void convertY8FullRangeToY8LimitedRange(const uint8_t *source, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y8 full range frame [0, 255] to a Y8 limited range frame [16, 235].
Definition FrameConverterY8.h:320
static void convertY8LimitedRangeToY8FullRange(const uint8_t *source, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y8 limited range frame [16, 235] to a Y8 full range frame [0, 255].
Definition FrameConverterY8.h:288
This class provides functions to convert frames with Y_VU12 pixel format.
Definition FrameConverterY_VU12.h:26
static void convertY_VU12LimitedRangeToBGR24FullRange(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12_LIMITED_RANGE frame to a BGR24 frame into a second image buffer.
Definition FrameConverterY_VU12.h:314
static void convertY_VU12FullRangeToY8LimitedRange(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12_FULL_RANGE frame to a Y8_LIMITED_RANGE frame into a second image buffer.
Definition FrameConverterY_VU12.h:306
static void convertY_VU12FullRangeToBGRA32FullRangeAndroid(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, const uint8_t alphaValue=0xFF, Worker *worker=nullptr)
Converts a Y_VU12_FULL_RANGE frame to a BGRA32 frame into a second image buffer applying a transforma...
Definition FrameConverterY_VU12.h:394
static void convertTwoRowsY_VU12FullRangeToBGRA32FullRangeAndroidPrecision6Bit(const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
Converts two rows of an image with Y_UV12 pixel format to two rows of an image with BGRA32 pixel form...
static void convertY_VU12FullRangeToY8FullRange(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12_FULL_RANGE frame to a Y8_FULL_RANGE frame into a second image buffer.
Definition FrameConverterY_VU12.h:298
static void convertY_VU12LimitedRangeToRGB24FullRange(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12_LIMITED_RANGE frame to a RGB24 frame into a second image buffer.
Definition FrameConverterY_VU12.h:429
static void convertY_VU12ToY_UV12(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *yTarget, uint8_t *uvTarget, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int yTargetPaddingElements, const unsigned int uvTargetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12 frame to a Y_UV12 frame into a second image buffer.
Definition FrameConverterY_VU12.h:600
static void convertY_VU12LimitedRangeToY8LimitedRange(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12_LIMITED_RANGE frame to a Y8_LIMITED_RANGE frame into a second image buffer.
Definition FrameConverterY_VU12.h:282
static void convertY_VU12ToY_U_V12(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *yTarget, uint8_t *uTarget, uint8_t *vTarget, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int yTargetPaddingElements, const unsigned int uTargetPaddingElements, const unsigned int vTargetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12 frame to a Y_U_V12 frame into a second image buffer.
Definition FrameConverterY_VU12.h:620
static void convertY_VU12ToYVU24(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12 frame to an 24 bit YVU frame into a second image buffer.
Definition FrameConverterY_VU12.h:577
static void convertY_VU12LimitedRangeToY8FullRange(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12_LIMITED_RANGE frame to a Y8_FULL_RANGE frame into a second image buffer.
Definition FrameConverterY_VU12.h:290
static void convertOneRowY_VU12FullRangeToBGRA32FullRangeAndroidPrecision6Bit(const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
Converts one row of an image with Y_UV12 pixel format to one row of an image with BGRA32 pixel format...
static void convertY_VU12ToYUV24(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12 frame to an 24 bit YUV frame into a second image buffer.
Definition FrameConverterY_VU12.h:554
static void convertY_VU12FullRangeToRGB24FullRangePrecision6Bit(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12_FULL_RANGE frame to a RGB24 frame into a second image buffer.
Definition FrameConverterY_VU12.h:509
This class implements a worker able to distribute function calls over different threads.
Definition Worker.h:33
The namespace covering the entire Ocean framework.
Definition Accessor.h:15