masterofeye / libyuv

Automatically exported from code.google.com/p/libyuv
0 stars 0 forks source link

TestRoundToByte performance #499

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
LIBYUV_WIDTH=640 LIBYUV_HEIGHT=360 LIBYUV_REPEAT=4000 
out/Release/libyuv_unittest --gtest_filter=**TestRoundToByte* 
[       OK ] libyuvTest.TestRoundToByte (419442 ms)
[----------] 1 test from libyuvTest (419442 ms total)

Performance of 4 rounding methods on Linux GCC:

#define ROUND(f) static_cast<int>(f + 0.5)
TestRoundToByte (10731 ms)

#define ROUND(f) lrintf(f)
TestRoundToByte (7911 ms)

#define ROUND(f) static_cast<int>(round(f))
TestRoundToByte (12700 ms)

#define ROUND(f) _mm_cvt_ss2si(_mm_load_ss(&f))
TestRoundToByte (10428 ms)

Original issue reported on code.google.com by fbarch...@google.com on 2 Oct 2015 at 6:28

GoogleCodeExporter commented 8 years ago

Original comment by fbarch...@chromium.org on 2 Oct 2015 at 11:03

GoogleCodeExporter commented 8 years ago
LIBYUV_WIDTH=640 LIBYUV_HEIGHT=360 LIBYUV_REPEAT=4000 
out/Release/libyuv_unittest --gtest_filter=**TestRoundToByte*
Note: Google Test filter = **TestRoundToByte*
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from libyuvTest
[ RUN      ] libyuvTest.TestRoundToByte
[       OK ] libyuvTest.TestRoundToByte (1129 ms)
[----------] 1 test from libyuvTest (1129 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (1129 ms total)
[  PASSED  ] 1 test.

Original comment by fbarch...@chromium.org on 2 Oct 2015 at 11:04