8 #ifndef META_OCEAN_CV_FRAME_CONVERTER_Y_UV_12_H
9 #define META_OCEAN_CV_FRAME_CONVERTER_Y_UV_12_H
43 static inline void convertY_UV12ToY8(
const uint8_t* ySource,
const uint8_t* uvSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int uvSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
62 static inline void convertY_UV12LimitedRangeToBGR24FullRange(
const uint8_t* ySource,
const uint8_t* uvSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int uvSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
81 static inline void convertY_UV12LimitedRangeToRGB24FullRange(
const uint8_t* ySource,
const uint8_t* uvSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int uvSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
100 static inline void convertY_UV12FullRangeToBGR24FullRange(
const uint8_t* ySource,
const uint8_t* uvSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int uvSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
119 static inline void convertY_UV12FullRangeToRGB24FullRange(
const uint8_t* ySource,
const uint8_t* uvSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int uvSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
134 static inline void convertY_UV12ToYUV24(
const uint8_t* ySource,
const uint8_t* uvSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int uvSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
149 static inline void convertY_UV12ToYVU24(
const uint8_t* ySource,
const uint8_t* uvSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int uvSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
168 static inline void convertY_UV12ToY_U_V12(
const uint8_t* ySource,
const uint8_t* uvSource, 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 uvSourcePaddingElements,
const unsigned int yTargetPaddingElements,
const unsigned int uTargetPaddingElements,
const unsigned int vTargetPaddingElements,
Worker* worker =
nullptr);
171 inline void FrameConverterY_UV12::convertY_UV12ToY8(
const uint8_t* ySource,
const uint8_t* , uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int ,
const unsigned int targetPaddingElements,
Worker* worker)
173 ocean_assert(ySource !=
nullptr && target !=
nullptr);
174 ocean_assert(width >= 1u && height >= 1u);
176 FrameChannels::transformGeneric<uint8_t, 1u>(ySource, target, width, height, flag, ySourcePaddingElements, targetPaddingElements, worker);
181 ocean_assert(ySource !=
nullptr && uvSource !=
nullptr && target !=
nullptr);
183 ocean_assert(width >= 2u && width % 2u == 0u);
184 ocean_assert(height >= 2u && height % 2u == 0u);
186 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
207 const int options[3 + 12] =
210 int(ySourcePaddingElements), int(uvSourcePaddingElements), int(targetPaddingElements),
213 75, 75, 75, 128, -25, 0, 0, -52, 102,
219 const void* sources[2] =
235 const int options[3 + 12] =
238 int(ySourcePaddingElements), int(uvSourcePaddingElements), int(targetPaddingElements),
241 1192, 1192, 1192, 2066, -400, 0, 0, -833, 1634,
247 const void* sources[2] =
253 FrameConverter::convertArbitraryPixelFormat(sources, (
void**)(&target), width, height, flag, 1u, FrameConverter::convertOneRow1PlaneAnd2ChannelsZippedDownsampled2x2ToZipped3Channels8BitPerChannelPrecision10Bit, options, worker);
260 ocean_assert(ySource !=
nullptr && uvSource !=
nullptr && target !=
nullptr);
262 ocean_assert(width >= 2u && width % 2u == 0u);
263 ocean_assert(height >= 2u && height % 2u == 0u);
265 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
286 const int options[3 + 12] =
289 int(ySourcePaddingElements), int(uvSourcePaddingElements), int(targetPaddingElements),
292 75, 75, 75, 0, -25, 128, 102, -52, 0,
298 const void* sources[2] =
314 const int options[3 + 12] =
317 int(ySourcePaddingElements), int(uvSourcePaddingElements), int(targetPaddingElements),
320 1192, 1192, 1192, 0, -400, 2066, 1634, -833, 0,
326 const void* sources[2] =
332 FrameConverter::convertArbitraryPixelFormat(sources, (
void**)(&target), width, height, flag, 1u, FrameConverter::convertOneRow1PlaneAnd2ChannelsZippedDownsampled2x2ToZipped3Channels8BitPerChannelPrecision10Bit, options, worker);
340 ocean_assert(ySource !=
nullptr && uvSource !=
nullptr && target !=
nullptr);
342 ocean_assert(width >= 2u && width % 2u == 0u);
343 ocean_assert(height >= 2u && height % 2u == 0u);
345 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
365 const int options[3 + 12] =
368 int(ySourcePaddingElements), int(uvSourcePaddingElements), int(targetPaddingElements),
371 64, 64, 64, 113, -22, 0, 0, -46, 90,
377 const void* sources[2] =
388 ocean_assert(ySource !=
nullptr && uvSource !=
nullptr && target !=
nullptr);
390 ocean_assert(width >= 2u && width % 2u == 0u);
391 ocean_assert(height >= 2u && height % 2u == 0u);
393 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
413 const int options[3 + 12] =
416 int(ySourcePaddingElements), int(uvSourcePaddingElements), int(targetPaddingElements),
419 64, 64, 64, 0, -22, 113, 90, -46, 0,
425 const void* sources[2] =
434 inline void FrameConverterY_UV12::convertY_UV12ToYUV24(
const uint8_t* ySource,
const uint8_t* uvSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int uvSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker)
436 ocean_assert(ySource !=
nullptr && uvSource !=
nullptr && target !=
nullptr);
438 ocean_assert(width >= 2u && width % 2u == 0u);
439 ocean_assert(height >= 2u && height % 2u == 0u);
441 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
446 const unsigned int options[3] = {ySourcePaddingElements, uvSourcePaddingElements, targetPaddingElements};
448 const void* sources[2] =
454 FrameConverter::convertArbitraryPixelFormat(sources, (
void**)(&target), width, height, flag, 1u, FrameConverter::mapOneRow_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel<0u, 1u, 2u>, options, worker);
457 inline void FrameConverterY_UV12::convertY_UV12ToYVU24(
const uint8_t* ySource,
const uint8_t* uvSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int uvSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker)
459 ocean_assert(ySource !=
nullptr && uvSource !=
nullptr && target !=
nullptr);
461 ocean_assert(width >= 2u && width % 2u == 0u);
462 ocean_assert(height >= 2u && height % 2u == 0u);
464 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
469 const unsigned int options[3] = {ySourcePaddingElements, uvSourcePaddingElements, targetPaddingElements};
471 const void* sources[2] =
477 FrameConverter::convertArbitraryPixelFormat(sources, (
void**)(&target), width, height, flag, 1u, FrameConverter::mapOneRow_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel<0u, 2u, 1u>, options, worker);
480 inline void FrameConverterY_UV12::convertY_UV12ToY_U_V12(
const uint8_t* ySource,
const uint8_t* uvSource, 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 uvSourcePaddingElements,
const unsigned int yTargetPaddingElements,
const unsigned int uTargetPaddingElements,
const unsigned int vTargetPaddingElements,
Worker* worker)
482 ocean_assert(ySource !=
nullptr && uvSource !=
nullptr && yTarget !=
nullptr && yTarget !=
nullptr && vTarget !=
nullptr);
484 ocean_assert(width >= 2u && width % 2u == 0u);
485 ocean_assert(height >= 2u && height % 2u == 0u);
487 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
493 FrameChannels::transformGeneric<uint8_t, 1u>(ySource, yTarget, width, height, flag, ySourcePaddingElements, yTargetPaddingElements, worker);
497 const unsigned int options[3] = {uvSourcePaddingElements, uTargetPaddingElements, vTargetPaddingElements};
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:3234
This class provides functions to convert frames with Y_UV12 pixel format.
Definition: FrameConverterY_UV12.h:27
static void convertY_UV12LimitedRangeToRGB24FullRange(const uint8_t *ySource, const uint8_t *uvSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int uvSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_UV12 frame to a 24 bit RGB frame into a second image buffer.
Definition: FrameConverterY_UV12.h:258
static void convertY_UV12FullRangeToBGR24FullRange(const uint8_t *ySource, const uint8_t *uvSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int uvSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a full range Y_UV12 frame to a full range 24 bit RGB frame into a second image buffer.
Definition: FrameConverterY_UV12.h:338
static void convertY_UV12ToYVU24(const uint8_t *ySource, const uint8_t *uvSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int uvSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_UV12 frame to a 24 bit YVU frame into a second image buffer.
Definition: FrameConverterY_UV12.h:457
static void convertY_UV12LimitedRangeToBGR24FullRange(const uint8_t *ySource, const uint8_t *uvSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int uvSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_UV12 frame to a 24 bit BGR frame into a second image buffer.
Definition: FrameConverterY_UV12.h:179
static void convertY_UV12ToY8(const uint8_t *ySource, const uint8_t *uvSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int uvSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_UV12 frame to an 8 bit gray scale frame into a second image buffer.
Definition: FrameConverterY_UV12.h:171
static void convertY_UV12FullRangeToRGB24FullRange(const uint8_t *ySource, const uint8_t *uvSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int uvSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a full range Y_UV12 frame to a full range 24 bit RGB frame into a second image buffer.
Definition: FrameConverterY_UV12.h:386
static void convertY_UV12ToYUV24(const uint8_t *ySource, const uint8_t *uvSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int uvSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_UV12 frame to a 24 bit YUV frame into a second image buffer.
Definition: FrameConverterY_UV12.h:434
static void convertY_UV12ToY_U_V12(const uint8_t *ySource, const uint8_t *uvSource, 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 uvSourcePaddingElements, const unsigned int yTargetPaddingElements, const unsigned int uTargetPaddingElements, const unsigned int vTargetPaddingElements, Worker *worker=nullptr)
Converts a Y_UV12 frame to a Y_U_V12 frame into a second image buffer.
Definition: FrameConverterY_UV12.h:480
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