| | |
| | | #include "logger.h"
|
| | | #include <libyuv.h>
|
| | | #include <PbFaceList.pb.h>
|
| | | #define SUBSAMPLE(v, a) ((((v) + (a) - 1)) / (a))
|
| | |
|
| | | struct PL_ColorConv_Internal
|
| | | {
|
| | | uint8_t* buffer;
|
| | |
| | | in->buffer = new uint8_t[dstSize];
|
| | | in->buffSizeMax = dstSize;
|
| | | in->buffSize = dstSize;
|
| | | LOG_INFO << "image_scale alloc buffer size=" << dstSize << std::endl;
|
| | | LOG_INFO << "image_to_rgb565 alloc buffer size=" << dstSize << std::endl;
|
| | | }
|
| | |
|
| | | if (srcType == MB_Frame::MBFT_YUV420)
|
| | |
| | | }
|
| | | else if (srcType == MB_Frame::MBFT_NV12)
|
| | | {
|
| | | const uint8_t * srcBuffer = (uint8_t *)in->tempFrame.buffer;
|
| | | const uint8_t *src_y = srcBuffer;
|
| | | const uint8_t *src_uv = src_y + (srcHeight * srcWidth);
|
| | | uint8_t *dst = (uint8_t *) (in->buffer);
|
| | | const uint8_t* srcBuffer = (uint8_t*)in->tempFrame.buffer;
|
| | | const uint8_t* src_y = srcBuffer;
|
| | | const uint8_t* src_uv = src_y + (srcHeight * srcWidth);
|
| | | uint8_t* dst = (uint8_t*)(in->buffer);
|
| | | libyuv::NV12ToRGB565(src_y, srcWidth,
|
| | | src_uv, srcWidth,
|
| | | dst, srcWidth * 2,
|