libyuv::NV12ToI420((const uint8_t *) data->yuvImage->get_device_data(0), data->yuvImage->image_width,
(const uint8_t *) data->yuvImage->get_device_data(1), data->yuvImage->image_width,
buffer.get(), data->yuvImage->image_width,
buffer.get() + ySize, data->yuvImage->image_width >> 1,
buffer.get() + ySize + ySize / 4, data->yuvImage->image_width >> 1,
data->yuvImage->image_width, data->yuvImage->image_height);
size_t jpegSize = 0;
uint8_t *bufferJpeg = tjAlloc(ySize * 3 / 2);
auto rjRet = tjCompressFromYUV(turboJpeg, buffer.get(), (int) drawImage->image_width, 4,(int) drawImage->image_height, TJSAMP_420, &bufferJpeg, &jpegSize, 80,0);
tjFree(bufferJpeg);
YUV420SP to JPEG
最新推荐文章于 2024-09-23 14:18:52 发布