I420ToARGB prototype added to convert_from.h

Duplicate I420ToARGB prototype from convert_argb.h into convert_from.h for webrtc
Apply clang format for white spacing consistency.

Bug: libyuv:838, b/151375918
Change-Id: I0f667ca5350192710dbb135e92e73e18b46135e5
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2446613
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
Frank Barchard 2020-10-02 10:20:09 -07:00 committed by Commit Bot
parent 0b1e6ea6c9
commit 385418a8e2
7 changed files with 48 additions and 18 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 1764
Version: 1765
License: BSD
License File: LICENSE

View File

@ -132,6 +132,35 @@ int I420ToUYVY(const uint8_t* src_y,
int width,
int height);
// The following are from convert_argb.h
// DEPRECATED: The prototypes will be removed in future. Use convert_argb.h
// Convert I420 to ARGB.
LIBYUV_API
int I420ToARGB(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_argb,
int dst_stride_argb,
int width,
int height);
// Convert I420 to ABGR.
LIBYUV_API
int I420ToABGR(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_abgr,
int dst_stride_abgr,
int width,
int height);
// Convert I420 to specified format.
// "dst_sample_stride" is bytes in a row for the destination. Pass 0 if the
// buffer has contiguous rows. Can be negative. A multiple of 16 is optimal.

View File

@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1764
#define LIBYUV_VERSION 1765
#endif // INCLUDE_LIBYUV_VERSION_H_

View File

@ -7146,10 +7146,7 @@ void HalfMergeUVRow_AVX2(const uint8_t* src_u,
: "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5");
}
void ClampFloatToZero_SSE2(const float* src_x,
float * dst_y,
int width) {
void ClampFloatToZero_SSE2(const float* src_x, float* dst_y, int width) {
asm volatile(
"pxor %%xmm1,%%xmm1 \n"

View File

@ -402,7 +402,11 @@ static void YUVHToRGBReference(int y, int u, int v, int* r, int* g, int* b) {
}
// BT.2020 YUV to RGB reference
static void YUVRec2020ToRGBReference(int y, int u, int v, int* r, int* g,
static void YUVRec2020ToRGBReference(int y,
int u,
int v,
int* r,
int* g,
int* b) {
*r = RoundToByte((y - 16) * 1.164384 - (v - 128) * -1.67867);
*g = RoundToByte((y - 16) * 1.164384 - (u - 128) * 0.187326 -

View File

@ -546,17 +546,17 @@ static int NV12TestFilter(int src_width,
MaskCpuFlags(disable_cpu_flags); // Disable all CPU optimization.
double c_time = get_time();
NV12Scale(src_y, src_stride_y, src_uv, src_stride_uv,
src_width, src_height, dst_y_c, dst_stride_y, dst_uv_c,
dst_stride_uv, dst_width, dst_height, f);
NV12Scale(src_y, src_stride_y, src_uv, src_stride_uv, src_width, src_height,
dst_y_c, dst_stride_y, dst_uv_c, dst_stride_uv, dst_width,
dst_height, f);
c_time = (get_time() - c_time);
MaskCpuFlags(benchmark_cpu_info); // Enable all CPU optimization.
double opt_time = get_time();
for (i = 0; i < benchmark_iterations; ++i) {
NV12Scale(src_y, src_stride_y, src_uv, src_stride_uv,
src_width, src_height, dst_y_opt, dst_stride_y, dst_uv_opt,
dst_stride_uv, dst_width, dst_height, f);
NV12Scale(src_y, src_stride_y, src_uv, src_stride_uv, src_width, src_height,
dst_y_opt, dst_stride_y, dst_uv_opt, dst_stride_uv, dst_width,
dst_height, f);
}
opt_time = (get_time() - opt_time) / benchmark_iterations;
// Report performance of C vs OPT.