mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-01-01 03:12:16 +08:00
Scale benchmark just the OPT and run C version once.
BUG=none TEST=scale_test Review URL: https://webrtc-codereview.appspot.com/929028 git-svn-id: http://libyuv.googlecode.com/svn/trunk@503 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
95d845bd5b
commit
2580ccf64d
@ -1,6 +1,6 @@
|
|||||||
Name: libyuv
|
Name: libyuv
|
||||||
URL: http://code.google.com/p/libyuv/
|
URL: http://code.google.com/p/libyuv/
|
||||||
Version: 502
|
Version: 503
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: LICENSE
|
License File: LICENSE
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,6 @@
|
|||||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||||
#define INCLUDE_LIBYUV_VERSION_H_
|
#define INCLUDE_LIBYUV_VERSION_H_
|
||||||
|
|
||||||
#define LIBYUV_VERSION 502
|
#define LIBYUV_VERSION 503
|
||||||
|
|
||||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||||
|
|||||||
@ -4346,7 +4346,6 @@ void ARGBInterpolateRow_SSSE3(uint8* dst_argb, const uint8* src_argb,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
|
void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
|
||||||
uint8* dst_uv, int pix) {
|
uint8* dst_uv, int pix) {
|
||||||
asm volatile (
|
asm volatile (
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace libyuv {
|
|||||||
|
|
||||||
static int ARGBTestRotate(int src_width, int src_height,
|
static int ARGBTestRotate(int src_width, int src_height,
|
||||||
int dst_width, int dst_height,
|
int dst_width, int dst_height,
|
||||||
libyuv::RotationMode mode, int runs) {
|
libyuv::RotationMode mode, int benchmark_iterations) {
|
||||||
const int b = 128;
|
const int b = 128;
|
||||||
int src_argb_plane_size = (src_width + b * 2) * (src_height + b * 2) * 4;
|
int src_argb_plane_size = (src_width + b * 2) * (src_height + b * 2) * 4;
|
||||||
int src_stride_argb = (b * 2 + src_width) * 4;
|
int src_stride_argb = (b * 2 + src_width) * 4;
|
||||||
@ -63,12 +63,12 @@ static int ARGBTestRotate(int src_width, int src_height,
|
|||||||
|
|
||||||
MaskCpuFlags(-1); // Enable all CPU optimization.
|
MaskCpuFlags(-1); // Enable all CPU optimization.
|
||||||
double opt_time = get_time();
|
double opt_time = get_time();
|
||||||
for (i = 0; i < runs; ++i) {
|
for (i = 0; i < benchmark_iterations; ++i) {
|
||||||
ARGBRotate(src_argb + (src_stride_argb * b) + b * 4, src_stride_argb,
|
ARGBRotate(src_argb + (src_stride_argb * b) + b * 4, src_stride_argb,
|
||||||
dst_argb_opt + (dst_stride_argb * b) + b * 4, dst_stride_argb,
|
dst_argb_opt + (dst_stride_argb * b) + b * 4, dst_stride_argb,
|
||||||
src_width, src_height, mode);
|
src_width, src_height, mode);
|
||||||
}
|
}
|
||||||
opt_time = (get_time() - opt_time) / runs;
|
opt_time = (get_time() - opt_time) / benchmark_iterations;
|
||||||
|
|
||||||
// Report performance of C vs OPT
|
// Report performance of C vs OPT
|
||||||
printf("filter %d - %8d us C - %8d us OPT\n",
|
printf("filter %d - %8d us C - %8d us OPT\n",
|
||||||
|
|||||||
@ -58,13 +58,12 @@ static int ARGBTestFilter(int src_width, int src_height,
|
|||||||
|
|
||||||
MaskCpuFlags(0); // Disable all CPU optimization.
|
MaskCpuFlags(0); // Disable all CPU optimization.
|
||||||
double c_time = get_time();
|
double c_time = get_time();
|
||||||
for (i = 0; i < benchmark_iterations; ++i) {
|
ARGBScale(src_argb + (src_stride_argb * b) + b * 4, src_stride_argb,
|
||||||
ARGBScale(src_argb + (src_stride_argb * b) + b * 4, src_stride_argb,
|
src_width, src_height,
|
||||||
src_width, src_height,
|
dst_argb_c + (dst_stride_argb * b) + b * 4, dst_stride_argb,
|
||||||
dst_argb_c + (dst_stride_argb * b) + b * 4, dst_stride_argb,
|
dst_width, dst_height, f);
|
||||||
dst_width, dst_height, f);
|
|
||||||
}
|
c_time = (get_time() - c_time);
|
||||||
c_time = (get_time() - c_time) / benchmark_iterations;
|
|
||||||
|
|
||||||
MaskCpuFlags(-1); // Enable all CPU optimization.
|
MaskCpuFlags(-1); // Enable all CPU optimization.
|
||||||
double opt_time = get_time();
|
double opt_time = get_time();
|
||||||
|
|||||||
@ -88,17 +88,16 @@ static int TestFilter(int src_width, int src_height,
|
|||||||
|
|
||||||
MaskCpuFlags(0); // Disable all CPU optimization.
|
MaskCpuFlags(0); // Disable all CPU optimization.
|
||||||
double c_time = get_time();
|
double c_time = get_time();
|
||||||
for (i = 0; i < benchmark_iterations; ++i) {
|
I420Scale(src_y + (src_stride_y * b) + b, src_stride_y,
|
||||||
I420Scale(src_y + (src_stride_y * b) + b, src_stride_y,
|
src_u + (src_stride_uv * b) + b, src_stride_uv,
|
||||||
src_u + (src_stride_uv * b) + b, src_stride_uv,
|
src_v + (src_stride_uv * b) + b, src_stride_uv,
|
||||||
src_v + (src_stride_uv * b) + b, src_stride_uv,
|
src_width, src_height,
|
||||||
src_width, src_height,
|
dst_y_c + (dst_stride_y * b) + b, dst_stride_y,
|
||||||
dst_y_c + (dst_stride_y * b) + b, dst_stride_y,
|
dst_u_c + (dst_stride_uv * b) + b, dst_stride_uv,
|
||||||
dst_u_c + (dst_stride_uv * b) + b, dst_stride_uv,
|
dst_v_c + (dst_stride_uv * b) + b, dst_stride_uv,
|
||||||
dst_v_c + (dst_stride_uv * b) + b, dst_stride_uv,
|
dst_width, dst_height, f);
|
||||||
dst_width, dst_height, f);
|
|
||||||
}
|
c_time = (get_time() - c_time);
|
||||||
c_time = (get_time() - c_time) / benchmark_iterations;
|
|
||||||
|
|
||||||
MaskCpuFlags(-1); // Enable all CPU optimization.
|
MaskCpuFlags(-1); // Enable all CPU optimization.
|
||||||
double opt_time = get_time();
|
double opt_time = get_time();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user