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
8bca9fc178
remove unused var in a test
...
remove include from unittest.cc that is already done by unittest.h
TBR=harryjin@google.com
BUG=libyuv:530
Review URL: https://codereview.chromium.org/1513263004 .
2015-12-10 18:39:36 -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
5bf4de0806
width and 3 bug fix in odd width support of ARGBToI411
...
TBR=harryjin@google.com
BUG=none
Review URL: https://codereview.chromium.org/1415213002 .
2015-10-21 12:45:08 -07:00
Frank Barchard
e6a54f223a
Call AllowCommandLineReparsing in unit tests
...
Allows us to ignore flags passed on to us by Chromium build bots
without having to explicitly disable them. (Thanks pbos!)
TESTED=webrtc ran modules_unittests with a bogus flag did not result in an
error.
R=kjellander@chromium.org
BUG=libyuv:507
Review URL: https://codereview.chromium.org/1417573002 .
2015-10-19 16:30:41 -07:00
Frank Barchard
94312b695a
add gflags support files from webrtc
...
files needed for command line support with gtest.
These files are copied directly from webrtc.
TBR=kjellander@chromium.org
BUG=libyuv:507
Review URL: https://codereview.chromium.org/1414483002 .
2015-10-16 18:53:25 -07: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
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
b14f46fa30
NaCL pepper_33 port of scale and compare using lock/unlock. Remove less useful scaling tests and change default size to a multiple of 16 for better assembly coverage.
...
BUG=none
TESTED=ncval
R=nfullagar@google.com
Review URL: https://webrtc-codereview.appspot.com/5939005
git-svn-id: http://libyuv.googlecode.com/svn/trunk@917 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-17 18:27:06 +00:00
fbarchard@google.com
5ed2b2e465
Test scaling to/from 1 pixel
...
BUG=none
TEST=scale unittests updated to test to/from 1 pixel
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/5479005
git-svn-id: http://libyuv.googlecode.com/svn/trunk@908 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-10 01:25:35 +00:00
fbarchard@google.com
a6b8e0da51
Reduce filter to None if 1 pixel wide.
...
BUG=none
TESTED=talk media_unittest YuvScalerTest.TestScaleUp1x6OptInt
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/5449005
git-svn-id: http://libyuv.googlecode.com/svn/trunk@906 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-09 19:56:16 +00:00
fbarchard@google.com
0db78ad127
Switch from xor/mov bx, to movzx ebx, which still passes drmemory and valgrind.
...
BUG=none
TESTED=drmemory
Review URL: https://webrtc-codereview.appspot.com/5339004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@904 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-08 19:23:41 +00:00
fbarchard@google.com
09d5f2bfd6
Change scale factors to test QVGA to/from CIF
...
BUG=261
TESTED=valgrind
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/5129004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@895 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-05 22:32:46 +00:00
fbarchard@google.com
48e5364313
Use xor/mov bx instead of movzx to avoid drmemory bug
...
BUG=none
TEST=none
R=johannkoenig@google.com , tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/4879004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@891 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-04 03:04:58 +00:00
fbarchard@google.com
339ce58196
Aligned buffer sizes for subsampled Bayer formats.
...
BUG=289
TEST=drmemory
Review URL: https://webrtc-codereview.appspot.com/4819004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@888 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-03 11:30:57 +00:00
fbarchard@google.com
0014ce0056
test odd width and fix for unaligned used on odd width conversion.
...
BUG=283
TESTED=try bots
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/4729004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@883 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-02 20:07:29 +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
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
1e985bbc16
ARGBSobel
...
BUG=201
TEST=Sobel*
Review URL: https://webrtc-codereview.appspot.com/1221005
git-svn-id: http://libyuv.googlecode.com/svn/trunk@609 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-03-19 19:23:44 +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
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
bd4fcb9877
Switch to 128x72 for default testing size when not benchmarking.
...
BUG=none
TEST=none
Review URL: https://webrtc-codereview.appspot.com/935004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@442 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-10-24 19:52:14 +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
d5a27f0533
RGBA to and from I420 with C implementation.
...
BUG=78
TEST=planar_test
Review URL: https://webrtc-codereview.appspot.com/798007
git-svn-id: http://libyuv.googlecode.com/svn/trunk@355 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-09-16 23:27:29 +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
de6eca3104
Change unittest to default to 1 iteration of each test. Can be change manually to 1000 for benchmarking purposes.
...
BUG=77
TEST=build\release\libyuv_unittest.exe
Review URL: https://webrtc-codereview.appspot.com/768006
git-svn-id: http://libyuv.googlecode.com/svn/trunk@336 16f28f9a-4ce2-e073-06de-1de4eb20be90
2012-08-30 21:18:10 +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
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
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
fbarchard@google.com
a1280730c2
cleanup yuv for consistency. stride, return int, negative heights, inplace conversions, lower case names, filter enum, uint, planarfunction updates, remove common.h, remove common/ folder, cpuid header public, move headers into libyuv/, add libyuv.h, fixed header guards, remove internal timing from scale, tweaks for llvm build, videocommon simplified
...
BUG=none
TEST=Talk builds on all platforms against libyuv.
Review URL: http://webrtc-codereview.appspot.com/226003
git-svn-id: http://libyuv.googlecode.com/svn/trunk@31 16f28f9a-4ce2-e073-06de-1de4eb20be90
2011-10-14 17:50:12 +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