Frank Barchard
903c91cc2e
fix for ubsan on unittest.h fastrand()
...
internal math of the fastrand function uses a multiply
and add that overflows a signed int. This triggers a
ubsan failure:
../../unit_test/../unit_test/unit_test.h:60:33: runtime error: signed integer overflow: 56248274 * 214013 cannot be represented in type 'int'
This change casts the intermediate math to unsigned
int to avoid the overflow.
For more info on ubsan, see
http://dev.chromium.org/developers/testing/undefinedbehaviorsanitizer
TESTED=Passing compilation using:
GYP_DEFINES="ubsan=1"
GYP_DEFINES="ubsan_vptr=1"
R=harryjin@google.com , pbos@webrtc.org
BUG=libyuv:563
Review URL: https://codereview.chromium.org/1662453003 .
2016-02-02 14:32:12 -08:00
Frank Barchard
82d74a37fa
unittest fix for cpu flags.
...
cpu flags of 1 disables SIMD and uses C. This used to be 0, but the change
in auto init behavior means that 0 now means uninitialized, and will cause
auto detect to reinit the cpu info. A value of 1 disables the auto init.
TBR=harryjin@google.com
BUG=none
Review URL: https://codereview.chromium.org/1408753004 .
2015-11-03 19:06:19 -08:00
Frank Barchard
c629cb3afe
add command line cpu info to allow android neon test
...
in order to compare C and Neon code, a new command line flag is added.
historically environment variables controlled cpu features, but on
android apk it is easier to pass a command line option to disable cpu
optimizations.
R=harryjin@google.com
BUG=libyuv:516
Review URL: https://codereview.chromium.org/1407193009 .
2015-11-03 17:01:48 -08:00
Frank Barchard
e2417df4cb
create color test category of unittests to narrow down arm bug
...
A hang in color conversion on arm occurs somewhere in yuv to rgb.
Breaking the color test into its own category of test will help
run selective tests to narrow down the issue.
R=harryjin@google.com
BUG=libyuv:506
Review URL: https://codereview.chromium.org/1405543003 .
2015-10-14 16:58:55 -07:00
Frank Barchard
26db4de2ae
break up unittests into categories
...
R=harryjin@google.com
BUG=none
Review URL: https://codereview.chromium.org/1399523004 .
2015-10-13 16:01:07 -07:00
Frank Barchard
16f12b58cc
Replace random with fastrand
...
random / rand is slow and impacts performance testing.
Although its only called to clear a frame once, a typical profile shows
it high in the overall profile, when doing 1000 frames for a benchmark.
95.10% libyuv_unittest libyuv_unittest [.] YUY2ToARGBRow_SSSE3
2.01% libyuv_unittest libc-2.19.so [.] __random_r
1.13% libyuv_unittest libc-2.19.so [.] __random
Replace random is a faster version for unittests.
set LIBYUV_WIDTH=1280
set LIBYUV_HEIGHT=720
set LIBYUV_REPEAT=999
set LIBYUV_FLAGS=-1
out\release\libyuv_unittest --gtest_filter=*YUY2ToARGB* | findms
Was
libyuvTest.YUY2ToARGB_Opt (497 ms)
Now
libyuvTest.YUY2ToARGB_Opt (454 ms)
R=harryjin@google.com
BUG=none
Review URL: https://codereview.chromium.org/1361813002 .
2015-09-22 15:47:36 -07:00
fbarchard@google.com
d880a90eca
make randomize take 64 bit count to allow larger images to be tested
...
BUG=none
TESTED=untested
Review URL: https://webrtc-codereview.appspot.com/53679004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1429 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-06-09 01:55:01 +00:00
fbarchard@google.com
f16f33d4ce
All cpu flags to be set so that instead of comparing C code, compare assembler to assembler, for benchmarking purposes.
...
BUG=none
TESTED=libyuv_unittest.exe
R=bcornell@google.com
Review URL: https://webrtc-codereview.appspot.com/50499004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1346 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-03-26 18:22:29 +00:00
fbarchard@google.com
008ce53ac4
pavgb with memory op requires alignment. This CL disables conversions that use pavgb, and resolves scale by 3/8 unittest for checking alignment works. The 3/8 code used a pavgb with a memory operand. tests are added for scaling and allow unaligning on purpose.
...
BUG=365
TESTED=local change to force unaligned memory fails on some conversions and scaling code.
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/29699004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1114 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-10-07 01:57:34 +00:00
fbarchard@google.com
ae9a1388a7
Use malloc for row buffers in rotate
...
BUG=296
TESTED=rotate_test
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/6329004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@922 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-26 21:41:11 +00:00
fbarchard@google.com
4b4b50fb44
Make unittests to 1280 pixels for simple planar tests, to get more realistic performance metrics than 256 pixels.
...
BUG=253
TEST=planar tests
R=nfullagar@google.com
Review URL: https://webrtc-codereview.appspot.com/1994004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@753 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-08-09 02:02:52 +00:00
fbarchard@google.com
b3a08b3e05
include lint warning fixes
...
BUG=none
TEST=lint
R=ryanpetrie@google.com
Review URL: https://webrtc-codereview.appspot.com/1676004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@728 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-06-17 16:37:39 +00:00
fbarchard@google.com
f2f9dbb644
FixedDiv function in C and benchmark
...
BUG=none
TEST=FixedDiv*
R=johannkoenig@google.com
Review URL: https://webrtc-codereview.appspot.com/1668004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@727 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-06-15 21:10:19 +00:00
fbarchard@google.com
47c4989b79
MemRandomize fix for short result
...
BUG=none
TEST=none
R=dingkai@google.com
Review URL: https://webrtc-codereview.appspot.com/1668005
git-svn-id: http://libyuv.googlecode.com/svn/trunk@725 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-06-13 21:36:58 +00:00
fbarchard@google.com
ae67c900f4
Randomize function for filling a buffer with random values.
...
BUG=244
TEST=*ScaleFrom1366x768_Box
R=mflodman@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/1644004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@720 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-06-10 16:12:20 +00:00
fbarchard@google.com
cde587092f
Replace two spaces with one after .
...
BUG=none
TEST=lint
Review URL: https://webrtc-codereview.appspot.com/1063010
git-svn-id: http://libyuv.googlecode.com/svn/trunk@553 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-01-28 00:02:35 +00:00
fbarchard@google.com
3e46444727
Mirror source to continuous destination with Neon
...
BUG=none
TEST=none
Review URL: https://webrtc-codereview.appspot.com/937020
git-svn-id: http://libyuv.googlecode.com/svn/trunk@488 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-11-14 02:03:49 +00:00
fbarchard@google.com
d26b451472
I420ToNV12_Neon bug fix
...
BUG=135
TEST=/libyuv_unittest --gtest_filter=*NV*
Review URL: https://webrtc-codereview.appspot.com/939005
git-svn-id: http://libyuv.googlecode.com/svn/trunk@444 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-10-25 19:24:59 +00:00
fbarchard@google.com
d3728d9222
unittest simplify loop counter
...
BUG=none
TEST=planar unittests
Review URL: https://webrtc-codereview.appspot.com/935006
git-svn-id: http://libyuv.googlecode.com/svn/trunk@443 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-10-25 17:12:41 +00:00
fbarchard@google.com
75f90ac315
Add unittest environment variables to set conversion width and height
...
BUG=none
TEST=convert_test
Review URL: https://webrtc-codereview.appspot.com/932004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@439 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-10-24 17:43:51 +00:00
fbarchard@google.com
7781d943b0
Disable V210 unittest that fails valgrind, and some warning fixes for android.
...
BUG=91
TEST=try
Review URL: https://webrtc-codereview.appspot.com/813004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@362 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-09-18 22:58:34 +00:00
fbarchard@google.com
6ccda3d206
Add environment variable for tests to repeat for benchmarking purposes.
...
BUG=none
TEST=none
Review URL: https://webrtc-codereview.appspot.com/796006
git-svn-id: http://libyuv.googlecode.com/svn/trunk@352 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-09-14 15:35:34 +00:00
fbarchard@google.com
b0c9797589
Update Copyright notice to follow new chromium conventions.
...
BUG=63
TEST=none
Review URL: https://webrtc-codereview.appspot.com/730004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@314 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-08-08 19:04:24 +00:00
fbarchard@google.com
d9eb63fc16
UNDER_ALLOCATED_HACK for scale that detects odd width and odd height were miscalculated and adjusts scaler for it.
...
BUG=none
TEST=none
Review URL: https://webrtc-codereview.appspot.com/663007
git-svn-id: http://libyuv.googlecode.com/svn/trunk@290 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-06-21 01:13:44 +00:00
fbarchard@google.com
81b804e35c
ARGBQuantize to do a posterizing effect. Added random resolution unittest.
...
BUG=none
TEST=none
Review URL: https://webrtc-codereview.appspot.com/654005
git-svn-id: http://libyuv.googlecode.com/svn/trunk@289 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-06-20 02:15:01 +00:00
fbarchard@google.com
810cd91079
ARGBUnattenuateRow_SSE2 use reciprocal table and pmul
...
BUG=none
TEST=none
Review URL: https://webrtc-codereview.appspot.com/497001
git-svn-id: http://libyuv.googlecode.com/svn/trunk@244 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-04-20 20:15:27 +00:00
fbarchard@google.com
e3ebe7a5cd
Neon instructions detect without using NDK so it will work within Android, and on other linux arm based platforms and builds
...
BUG=none
TEST=none
Review URL: https://webrtc-codereview.appspot.com/358008
git-svn-id: http://libyuv.googlecode.com/svn/trunk@153 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-01-26 02:14:52 +00:00
frkoenig@google.com
93d003f874
YUVToARGB, YUVToBGRA,YUVToABGR optimized.
...
Review URL: http://webrtc-codereview.appspot.com/267022
git-svn-id: http://libyuv.googlecode.com/svn/trunk@86 16f28f9a-4ce2-e073-06de-1de4eb20be90
2011-11-19 01:39:57 +00:00
mikhal@webrtc.org
1b06484b4a
libyuv: clean up:
...
1. Removing libyuv:: when not needed
2. Test clean-up
Review URL: http://webrtc-codereview.appspot.com/279002
git-svn-id: http://libyuv.googlecode.com/svn/trunk@74 16f28f9a-4ce2-e073-06de-1de4eb20be90
2011-11-10 23:58:32 +00:00
frkoenig@google.com
2cb934c624
PSNR and SSIM plane comparision functions.
...
Code sourced from libvpx.
http://www.webmproject.org/code/#libvpx_the_vp8_codec_sdk
Review URL: http://webrtc-codereview.appspot.com/267004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@72 16f28f9a-4ce2-e073-06de-1de4eb20be90
2011-11-10 20:52:24 +00:00
frkoenig@google.com
f7e74a1a6f
Move neon rotate code from straight assembly to inline.
...
Allow assemblers with a slightly different syntax to use
the optimized neon routines.
Removed extra constraints on the calling of the optimized
routines. All neon routines can load unaligned and handle
odd widths.
Align allocated buffers in rotate_test.cc
Add neon rotate file to gyp file for arm targets.
Review URL: http://webrtc-codereview.appspot.com/253007
git-svn-id: http://libyuv.googlecode.com/svn/trunk@59 16f28f9a-4ce2-e073-06de-1de4eb20be90
2011-11-03 22:41:59 +00:00
frkoenig@google.com
3de12ae1c6
I420 and NV12 rotate functions.
...
Consolidate rotate files. Add unit tests for I420
and NV12 rotate functions. Fix remaining pitch/stride
references.
Review URL: http://webrtc-codereview.appspot.com/239001
git-svn-id: http://libyuv.googlecode.com/svn/trunk@32 16f28f9a-4ce2-e073-06de-1de4eb20be90
2011-10-19 17:52:15 +00:00
frkoenig@google.com
ed6edcab8b
Fixed image rotators.
...
90, 180, 270 rotate of array with a minimum size of 8x8.
Also deinterleave on rotate for NV12/NV21 formats.
Review URL: http://webrtc-codereview.appspot.com/195002
git-svn-id: http://libyuv.googlecode.com/svn/trunk@23 16f28f9a-4ce2-e073-06de-1de4eb20be90
2011-10-12 21:37:43 +00:00
frkoenig@google.com
3660f2e56a
empty gtest.
...
Placeholder for unit tests. No tests currently defined.
Review URL: http://webrtc-codereview.appspot.com/197001
git-svn-id: http://libyuv.googlecode.com/svn/trunk@11 16f28f9a-4ce2-e073-06de-1de4eb20be90
2011-10-04 18:17:35 +00:00