47 Commits

Author SHA1 Message Date
Frank Barchard
9a07219dc8 Documentation update for GYP and envionment variables
Bug: libyuv:816, libyuv:804
Change-Id: I73a6960b2cc6f3ca31c43c44ccd8b01f5e9e7013
Test" Untested
Reviewed-on: https://chromium-review.googlesource.com/1205053
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2018-09-04 19:45:41 +00:00
Frank Barchard
9d70f13c8f cpuid sandbox friendlier avoiding getenv()
Move getenv to unittest.cc to allow libyuv to be
run in sandbox for x86, x64 and aarch64

Bug: libyuv:767
Test: unittests still run and respect environment variables
Change-Id: I84cb1717977828776142b51c029774b3e6b142a3
Reviewed-on: https://chromium-review.googlesource.com/969645
Reviewed-by: richard winterton <rrwinterton@gmail.com>
2018-03-20 01:04:30 +00:00
Frank Barchard
7e389884a1 Switch to C99 types
Append _t to all sized types.
uint64 becomes uint64_t etc

Bug: libyuv:774
Test: try bots build on all platforms
Change-Id: Ide273d7f8012313d6610415d514a956d6f3a8cac
Reviewed-on: https://chromium-review.googlesource.com/879922
Reviewed-by: Miguel Casas <mcasas@chromium.org>
2018-01-23 19:16:05 +00:00
Frank Barchard
5336217f11 H010Copy function to copy 16 bit planar formats
Bug: libyuv:751
Test: LibYUVConvertTest.H010ToH010_Opt
Change-Id: I996d309040a14193a97d05b62ac0b3e1ad1ee74b
Reviewed-on: https://chromium-review.googlesource.com/823445
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Cheng Wang <wangcheng@google.com>
Reviewed-by: richard winterton <rrwinterton@gmail.com>
2017-12-15 03:34:34 +00:00
Frank Barchard
80e27fc747 Add MaskCpuFlags(benchmark_cpu_info_) to unittest initialization
When command line --libyuv_cpu_info is used the individual tests
used to need to set the cpumask.  This CL moves that to the init
for each test class so the individual tests dont need to set it.

TBR=kjellander@chromium.org
BUG=libyuv:720
TEST=LibYUVBaseTest.TestCpuHas

Change-Id: I6ae180388debf6cf76be6df5b81cfffeb35ee2eb
Reviewed-on: https://chromium-review.googlesource.com/662367
Reviewed-by: Cheng Wang <wangcheng@google.com>
2017-09-12 19:13:06 +00:00
Frank Barchard
db25485ee2 Move compare functions into a unittest class
BUG=None
TEST=LibYUVCompareTest.*
R=jkellander@chromium.org

Change-Id: I3131ca73020f855ead08255d09aa7a846bf0d556
Reviewed-on: https://chromium-review.googlesource.com/540064
Commit-Queue: Frank Barchard <fbarchard@google.com>
Reviewed-by: Henrik Kjellander <kjellander@chromium.org>
2017-06-19 19:39:10 +00:00
Frank Barchard
2adb84e39e make gflags command line parser optional
BUG=libyuv:691
TEST=gn gen out/Release "--args=is_debug=false target_cpu=\"x64\" libyuv_include_tests=true"

Change-Id: Ib481189be884c34d9bbc30bfcf71c7969c6f4dae
Reviewed-on: https://chromium-review.googlesource.com/452736
Reviewed-by: Frank Barchard <fbarchard@google.com>
Commit-Queue: Frank Barchard <fbarchard@google.com>
2017-03-14 01:52:52 +00:00
Frank Barchard
e62309f259 clang-format libyuv
BUG=libyuv:654
R=kjellander@chromium.org

Review URL: https://codereview.chromium.org/2469353005 .
2016-11-07 17:37:23 -08:00
Frank Barchard
e2611a7349 document cpuid command line behavior
cpu_info_ is zero for uninitialized state and all bits are off, disabling all cpu optimizations.
the 1 bit indicates cpu_info_ is initialized avoiding calling the detection code again for performance.

MaskCpuFlags initializes the cpu ignoring existing flags, then masks with the supplied flags and stores to cpu_info_.
As a mask, -1 has no effect, enabling all cpu features that were detected, but nothing that wasnt detected.
Setting to 0 will cause the next call to re-initialize the cpu, which is same as enabling all features.
Setting mask to 1 will turn off all cpu features but keep the initialized bit on, so the next detection call wont reinitialize and the cpu features are all disabled.

So normal behavior for command line and programatic masking is:
1 = C
-1 = SIMD

TBR=harryjin@google.com
BUG=libyuv:600
TESTED=out64/Release/bin/run_libyuv_unittest -s libyuv_unittest --verbose --release --gtest_filter=*ARGBExtractAlpha* -a "--libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=9999 --libyuv_flags=1 --libyuv_cpu_info=1"

Review URL: https://codereview.chromium.org/2042933002 .
2016-06-08 10:38:09 -07:00
Frank Barchard
b00d40160a make unittest allocator align to 64 bytes.
blur requires memory be aligned.  change the unittest allocator to guarantee 64 byte alignment.
re-enable blur any test that fails if memory is unaligned.

TBR=harryjin@google.com
BUG=libyuv:596,libyuv:594
TESTED=local build passes with row.h removed from tests.

Review URL: https://codereview.chromium.org/2019753002 .
2016-05-27 18:02:47 -07:00
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