Commit 2580ccf6 authored by fbarchard@google.com's avatar fbarchard@google.com

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
parent 95d845bd
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 @@ ...@@ -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, ...@@ -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 { ...@@ -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, ...@@ -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, ...@@ -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) / benchmark_iterations; c_time = (get_time() - c_time);
MaskCpuFlags(-1); // Enable all CPU optimization. MaskCpuFlags(-1); // Enable all CPU optimization.
double opt_time = get_time(); double opt_time = get_time();
......
...@@ -88,7 +88,6 @@ static int TestFilter(int src_width, int src_height, ...@@ -88,7 +88,6 @@ 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,
...@@ -97,8 +96,8 @@ static int TestFilter(int src_width, int src_height, ...@@ -97,8 +96,8 @@ static int TestFilter(int src_width, int src_height,
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) / benchmark_iterations; c_time = (get_time() - c_time);
MaskCpuFlags(-1); // Enable all CPU optimization. MaskCpuFlags(-1); // Enable all CPU optimization.
double opt_time = get_time(); double opt_time = get_time();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment