diff options
author | Frank Barchard <fbarchard@google.com> | 2017-11-16 16:30:07 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2017-11-17 01:20:05 +0000 |
commit | 12c904a97c81c3ef4cab0fc8fb1f0485b4ec4e8c (patch) | |
tree | a0eada72442c330b097012446a16517cf56bb590 /source/convert_from.cc | |
parent | 46594be7588d21cbe7a5620ff1ecee269e46c498 (diff) | |
download | libyuv-12c904a97c81c3ef4cab0fc8fb1f0485b4ec4e8c.tar.gz |
H420ToRAW and H420ToRGB24 added for bt.709 support.
Bug: libyuv:760
Test: LibYUVConvertTest.H420ToRAW_Opt
Change-Id: I050385f477309d5db02bb2218088f224c83392ed
Reviewed-on: https://chromium-review.googlesource.com/775785
Commit-Queue: Frank Barchard <fbarchard@google.com>
Reviewed-by: Weiyong Yao <braveyao@chromium.org>
Diffstat (limited to 'source/convert_from.cc')
-rw-r--r-- | source/convert_from.cc | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/source/convert_from.cc b/source/convert_from.cc index d623731d..0f52f9ef 100644 --- a/source/convert_from.cc +++ b/source/convert_from.cc @@ -657,6 +657,42 @@ int I420ToRAW(const uint8* src_y, width, height); } +// Convert H420 to RGB24. +LIBYUV_API +int H420ToRGB24(const uint8* src_y, + int src_stride_y, + const uint8* src_u, + int src_stride_u, + const uint8* src_v, + int src_stride_v, + uint8* dst_rgb24, + int dst_stride_rgb24, + int width, + int height) { + return I420ToRGB24Matrix(src_y, src_stride_y, src_u, src_stride_u, src_v, + src_stride_v, dst_rgb24, dst_stride_rgb24, + &kYuvH709Constants, width, height); +} + +// Convert H420 to RAW. +LIBYUV_API +int H420ToRAW(const uint8* src_y, + int src_stride_y, + const uint8* src_u, + int src_stride_u, + const uint8* src_v, + int src_stride_v, + uint8* dst_raw, + int dst_stride_raw, + int width, + int height) { + return I420ToRGB24Matrix(src_y, src_stride_y, src_v, + src_stride_v, // Swap U and V + src_u, src_stride_u, dst_raw, dst_stride_raw, + &kYvuH709Constants, // Use Yvu matrix + width, height); +} + // Convert I420 to ARGB1555. LIBYUV_API int I420ToARGB1555(const uint8* src_y, @@ -1075,8 +1111,8 @@ int I420ToRGB565Dither(const uint8* src_y, for (y = 0; y < height; ++y) { I422ToARGBRow(src_y, src_u, src_v, row_argb, &kYuvI601Constants, width); ARGBToRGB565DitherRow(row_argb, dst_rgb565, - *(uint32*)(dither4x4 + ((y & 3) << 2)), - width); // NOLINT + *(uint32*)(dither4x4 + ((y & 3) << 2)), // NOLINT + width); // NOLINT dst_rgb565 += dst_stride_rgb565; src_y += src_stride_y; if (y & 1) { |