mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
Add I422ToRGB565Matrix
The code already exists to use a specific matrix. This CL simply adds a function to use a generic YUV matrix for the conversion. Bug: b/241451603 Change-Id: I0eea7e96a891d045905a9c963b56c053097029ec Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3820903 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
parent
d53f1beecd
commit
a5a1102a60
@ -1907,6 +1907,20 @@ int I420ToRGB565Matrix(const uint8_t* src_y,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
// Convert I422 to RGB565 with specified color matrix.
|
||||
LIBYUV_API
|
||||
int I422ToRGB565Matrix(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
const uint8_t* src_u,
|
||||
int src_stride_u,
|
||||
const uint8_t* src_v,
|
||||
int src_stride_v,
|
||||
uint8_t* dst_rgb565,
|
||||
int dst_stride_rgb565,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
// Convert I420 to AR30 with matrix.
|
||||
LIBYUV_API
|
||||
int I420ToAR30Matrix(const uint8_t* src_y,
|
||||
|
||||
@ -5035,18 +5035,19 @@ int H420ToRGB565(const uint8_t* src_y,
|
||||
&kYuvH709Constants, width, height);
|
||||
}
|
||||
|
||||
// Convert I422 to RGB565.
|
||||
// Convert I422 to RGB565 with specified color matrix.
|
||||
LIBYUV_API
|
||||
int I422ToRGB565(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
const uint8_t* src_u,
|
||||
int src_stride_u,
|
||||
const uint8_t* src_v,
|
||||
int src_stride_v,
|
||||
uint8_t* dst_rgb565,
|
||||
int dst_stride_rgb565,
|
||||
int width,
|
||||
int height) {
|
||||
int I422ToRGB565Matrix(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
const uint8_t* src_u,
|
||||
int src_stride_u,
|
||||
const uint8_t* src_v,
|
||||
int src_stride_v,
|
||||
uint8_t* dst_rgb565,
|
||||
int dst_stride_rgb565,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width,
|
||||
int height) {
|
||||
int y;
|
||||
void (*I422ToRGB565Row)(const uint8_t* y_buf, const uint8_t* u_buf,
|
||||
const uint8_t* v_buf, uint8_t* rgb_buf,
|
||||
@ -5103,7 +5104,7 @@ int I422ToRGB565(const uint8_t* src_y,
|
||||
#endif
|
||||
|
||||
for (y = 0; y < height; ++y) {
|
||||
I422ToRGB565Row(src_y, src_u, src_v, dst_rgb565, &kYuvI601Constants, width);
|
||||
I422ToRGB565Row(src_y, src_u, src_v, dst_rgb565, yuvconstants, width);
|
||||
dst_rgb565 += dst_stride_rgb565;
|
||||
src_y += src_stride_y;
|
||||
src_u += src_stride_u;
|
||||
@ -5112,6 +5113,23 @@ int I422ToRGB565(const uint8_t* src_y,
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Convert I422 to RGB565.
|
||||
LIBYUV_API
|
||||
int I422ToRGB565(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
const uint8_t* src_u,
|
||||
int src_stride_u,
|
||||
const uint8_t* src_v,
|
||||
int src_stride_v,
|
||||
uint8_t* dst_rgb565,
|
||||
int dst_stride_rgb565,
|
||||
int width,
|
||||
int height) {
|
||||
return I422ToRGB565Matrix(src_y, src_stride_y, src_u, src_stride_u, src_v,
|
||||
src_stride_v, dst_rgb565, dst_stride_rgb565,
|
||||
&kYuvI601Constants, width, height);
|
||||
}
|
||||
|
||||
// Ordered 8x8 dither for 888 to 565. Values from 0 to 7.
|
||||
static const uint8_t kDither565_4x4[16] = {
|
||||
0, 4, 1, 5, 6, 2, 7, 3, 1, 5, 0, 4, 7, 3, 6, 2,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user