Frank Barchard
05ed0c539c
rework scale code for ubsan
...
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/1654253004 .
2016-02-02 11:01:49 -08:00
Frank Barchard
0e7d2926e2
UBSan: Add blacklist files for libyuvC standalone.
...
For more info, 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,webrtc:5124
Review URL: https://codereview.chromium.org/1659713002 .
2016-02-01 18:08:52 -08:00
Frank Barchard
9e39c1f271
ubsan overflow fix for multiply by 0x01010101
...
This is an UBSan error reported by libjingle
[ RUN ] WebRtcVideoFrameTest.ConvertToYUY2BufferStride
[000:000] (videoframe.cc:375): Validate frame passed. format: I420 bpp: 12 size: 1280x720 bytes: 1382400 expected: 1382400 sample[0..3]: 73, 73, 73, 73
../../chromium/src/third_party/libyuv/source/row_gcc.cc:2903:25: runtime error: signed integer overflow: 128 * 16843009 cannot be represented in type 'int'
[8/614] WebRtcVideoFrameTest.ConvertToYUY2BufferStride returned/aborted with exit code 1 (32 ms)
[9/614] WebRtcVideoFrameTest.ConvertToYUY2BufferInverted (29 ms)
Note: Google Test filter = WebRtcVideoFrameTest.ConvertToYUY2BufferInverted
The source is uint8 and the multiply is by 0x01010101 to replicate the byte to 4 bytes.
Changing the constant to 0x01010101u should avoid overflow.
R=harryjin@google.com
TBR=harryjin@google.com
BUG=libyuv:563
Review URL: https://codereview.chromium.org/1657533005 .
2016-02-01 12:29:04 -08:00
Frank Barchard
1cc0177669
Remove duplicate prototype for MJPGToARGB
...
MJPGToARGB prototype is in both convert_argb.h and planar_functions.h
Remove the duplicate prototype from planar_functions.h
R=harryjin@google.com
TBR=harryjin@google.com
BUG=libyuv:561
Review URL: https://codereview.chromium.org/1638133002 .
2016-01-26 17:02:45 -08:00
Frank Barchard
ad71738f6a
Remove svn version build and unittest.
...
R=harryjin@google.com
TBR=harryjin@google.com , kjellander@google.com
BUG=libyuv:551
Review URL: https://codereview.chromium.org/1612123002 .
2016-01-21 11:22:11 -08:00
Henrik Kjellander
a4288dd6dc
Disable sometimes-uninitialized Clang warning for iOS
...
This works around a compile problem with iossim.mm.
BUG=libyuv:548
TBR=fbarchard@chromium.org
Review URL: https://codereview.chromium.org/1611123004 .
2016-01-21 13:07:35 +01:00
Henrik Kjellander
484692b6cc
Remove mac_x64_rel from trybot defaults.
...
As this bot was removed in https://codereview.chromium.org/1613013003/
TBR=fbarchard@chromium.org
BUG=
Review URL: https://codereview.chromium.org/1615793002 .
2016-01-21 12:03:14 +01:00
Frank Barchard
085bfc1d04
Rename test from CropNV12 to NV12Crop
...
When scanning profiles for unexpected _C functions
this test function contained the substring.
Changing the name will simplify the search.
TBR=harryjin@google.com
BUG=libyuv:543
Review URL: https://codereview.chromium.org/1602363002 .
2016-01-19 16:43:51 -08:00
Frank Barchard
8c196f4d4c
Fix testi420 unittest for odd height
...
When the image height for unittests was set to an
odd height, the TestI420 unittest would not fill
the complete source buffer. This change handles
the odd height test case.
No change to library code.
TBR=harryjin@google.com
BUG=libyuv:549
Review URL: https://codereview.chromium.org/1609103002 .
2016-01-19 16:16:39 -08:00
Frank Barchard
58cb534962
Fix memory overwrite in YUY2ToNV12 odd wdiths
...
When width was odd Y channel wrote an extra pixel.
This change splits the Y from UV into a temporary
buffer and memcpy's to the destination. Performance
is slower.
Was
YUY2ToNV12_Any (307 ms)
YUY2ToNV12_Unaligned (213 ms)
TestYUY2ToNV12 (181 ms)
YUY2ToNV12_Opt (177 ms)
YUY2ToNV12_Invert (177 ms)
Npw
YUY2ToNV12_Any (300 ms)
YUY2ToNV12_Unaligned (226 ms)
YUY2ToNV12_Invert (206 ms)
TestYUY2ToNV12 (184 ms)
YUY2ToNV12_Opt (181 ms)
TBR=harryjin@google.com
BUG=libyuv:545
Review URL: https://codereview.chromium.org/1593833002 .
2016-01-19 11:28:09 -08:00
Frank Barchard
8377c798fb
Fix I420ToNV21 for wrong dst_stride_y parameter.
...
I420ToNV21 passes the wrong dst_stride_y when it calls I420ToNV12; parameter 8 (convert_from.cc:448) is src_stride_y but should be dst_stride_y. This causes image corruption when converting I420 -> NV21 with mismatched luminance strides.
R=dhrosa@google.com , harryjin@google.com
BUG=libyuv:547
Review URL: https://codereview.chromium.org/1582793008 .
2016-01-14 17:38:54 -08:00
Frank Barchard
d1c6eb0887
Roll chromium to fix java_cpp_enum.py
...
Remove assumption on absolute paths in java_cpp_enum.py.
In java_cpp_enum.py there were assumptions on 'build' being
a component of the absolute path of the script invoking the
script. This leads to problems when other projects are using
the Chromium build toolchain (in this case libyuv), where
the script invoking GYP is located in the root of the project
dir (https://chromium.googlesource.com/libyuv/libyuv/+/master/gyp_libyuv ).
TBR=harryjin@google.com , jkellander@chromium.org
BUG=libyuv:536
Review URL: https://codereview.chromium.org/1581773003 .
2016-01-14 11:39:13 -08:00
Frank Barchard
f7c6b1a196
pull gflags.gyp changes from webrtc
...
gflags has a build warning in the chromium version.
../../third_party/gflags/src/gflags.cc:281:53: error: unused typedef 'true_false_equal' [-Werror,-Wunused-local-typedef]
COMPILE_ASSERT(sizeof(kTrue) == sizeof(kFalse), true_false_equal);
^
1 error generated.
[8/231] CXX obj/chromium/src/testing/gtest/src/gtest.gtest.o
Its been reported and fixed upstream
https://github.com/gflags/gflags/issues/125
But not pulled into chromium. Last update to flags was in 2013.
This change disables the warning.
R=harryjin@google.com , kjellander@chromium.org , jkellander@chromium.org
BUG=libyuv:536, webrtc:5397, webrtc:5398, webrtc:5399
Review URL: https://codereview.chromium.org/1581123002 .
2016-01-14 11:09:28 -08:00
Frank Barchard
081475b3c8
refactor ARGBToI422 using ARGBToI420 internally
...
R=harryjin@google.com
BUG=libyuv:546
Review URL: https://codereview.chromium.org/1574253004 .
2016-01-12 17:05:49 -08:00
Frank Barchard
54bbea1701
Disable I420Blend_Any test that uses C
...
Also renames Inverted to Invert in test name for consistency.
TBR=harryjin@google.com
BUG=libyuv:543
Review URL: https://codereview.chromium.org/1577973004 .
2016-01-11 18:23:04 -08:00
Frank Barchard
8030a711aa
Rename rotate tests to include _Opt and disable _Odd tests
...
TBR=harryjin@google.com
BUG=libyuv:543
Review URL: https://codereview.chromium.org/1577723003 .
2016-01-11 17:30:27 -08:00
Frank Barchard
23c6a83561
Fix ifdef mismatch for mirroruv
...
Macro define and macro ifdef didnt match, leading to C code
being used. Make macro match function name.
TBR=harryjin@google.com
BUG=libyuv:543
Review URL: https://codereview.chromium.org/1579023002 .
2016-01-11 16:33:36 -08:00
Frank Barchard
0e462e6f45
Remove use_sysroot=0
...
use_sysroot=0 is required for webrtc on linux intel builds, but
libyuv doesnt use the affected libraries, so removing this.
R=harryjin@google.com , sbc@chromium.org
BUG=libyuv:534,libyuv:542
Review URL: https://codereview.chromium.org/1566303002 .
2016-01-11 14:57:50 -08:00
Frank Barchard
fc52d8ded2
Odd width variation of scale down by 2 for subsampling
...
R=dhrosa@google.com , harryjin@google.com
BUG=libyuv:538
Review URL: https://codereview.chromium.org/1558093003 .
2016-01-06 15:12:17 -08:00
Frank Barchard
2560df9513
add clang variable for other apps to use
...
R=dhrosa@google.com
BUG=libyuv:539
Review URL: https://codereview.chromium.org/1557923005 .
2016-01-05 11:47:55 -08:00
Frank Barchard
36615d62a0
fix for InterpolateRow_AVX2
...
port scaledownby4_avx2 to gcc
TBR=harryjin@google.com
BUG=libyuv:492
Review URL: https://codereview.chromium.org/1546763002 .
2015-12-22 12:29:54 -08:00
Frank Barchard
71deb7ba3a
bug fix - remove shift from InterpolateRow_AVX2
...
TBR=harryjin@google.com
BUG=libyuv:537
Review URL: https://codereview.chromium.org/1547703002 .
2015-12-22 10:28:48 -08:00
Frank Barchard
2cb2e9e1ad
fix for InterpolateRow_AVX2
...
TBR=harryjin@google.com
BUG=libyuv:535
Review URL: https://codereview.chromium.org/1543773002 .
2015-12-21 18:35:12 -08:00
Frank Barchard
0f5c7660d1
Disable sysroot for x86 and x64 only
...
In addition to https://codereview.chromium.org/1526163002
disable sysroot only for x86 and x64.
Keep using sysroot for other archs
due to crosscompiling.
BUG=none
R=fbarchard@chromium.org
Review URL: https://codereview.chromium.org/1536403002 .
2015-12-21 11:41:14 -08:00
Frank Barchard
3f4d86053e
avx2 interpolate use 8 bit
...
BUG=libyuv:535
R=dhrosa@google.com
Review URL: https://codereview.chromium.org/1535833003 .
2015-12-21 10:57:32 -08:00
Frank Barchard
f4447745ae
Add rounding to InterpolateRow for improved quality and consistency.
...
Remove inaccurate specializations for 1/4 and 3/4, since they round
incorrectly. Specialize for 100% and 50% are kept due to performance.
Make C and ARM code match SSSE3.
Make unittests expect zero difference.
BUG=libyuv:535
R=harryjin@google.com
Review URL: https://codereview.chromium.org/1533643005 .
2015-12-17 15:24:06 -08:00
Frank Barchard
1ccbf8fb7b
use memory for loop counter to work around nearly out of registers
...
TBR=harryjin@google.com
BUG=libyuv:533
Review URL: https://codereview.chromium.org/1535433003 .
2015-12-16 17:13:37 -08:00
Frank Barchard
029f926a14
add NDEBUG for release chromium buids
...
BUG=libyuv:533
TBR=harryjin@google.com
Review URL: https://codereview.chromium.org/1531143002 .
2015-12-16 16:23:09 -08:00
Frank Barchard
40fd801a28
roll to same version of chromium as head webrtc
...
BUG=libyuv:534
R=kjellander@chromium.org
Review URL: https://codereview.chromium.org/1535493002 .
2015-12-16 15:52:14 -08:00
Frank Barchard
216e93b4e8
Fix MIPS DSPR2 build failure.
...
Fixing the failure:
'TransposeWx8_Fast_MIPS_DSPR2' was not declared in this scope
BUG=none
R=fbarchard@chromium.org
Review URL: https://codereview.chromium.org/1527243002 .
2015-12-16 10:37:42 -08:00
Frank Barchard
80ca4514ef
change scale down by 4 to use rounding.
...
TBR=harryjin@google.com
BUG=libyuv:447
Review URL: https://codereview.chromium.org/1525033005 .
2015-12-15 21:25:18 -08:00
Frank Barchard
be984a8b9a
Bump chromium version and disable use_sysroot=0
...
TBR=harryjin@google.com
BUG=libyuv:534
Review URL: https://codereview.chromium.org/1526163002 .
2015-12-15 12:05:32 -08:00
Frank Barchard
70445ef2ef
avx2 scale down by 2 for gcc
...
R=dhrosa@google.com , harryjin@google.com
BUG=libyuv:527
Review URL: https://codereview.chromium.org/1520423003 .
2015-12-15 10:59:20 -08:00
Frank Barchard
77346fcb4a
disable I411ToARGB assembly if _DEBUG for chromium, as well as DEBUG for other builds.
...
TBR=harryjin@google.com
BUG=libyuv:533
Review URL: https://codereview.chromium.org/1527903002 .
2015-12-14 21:36:12 -08:00
Frank Barchard
ae55e41851
use rounding in scaledown by 2
...
When scaling down by 2 the formula should round consistently.
(a+b+c+d+2)/4
The C version did but the SSE2 version was doing 2 averages.
avg(avg(a,b),avg(c,d))
This change uses a sum, then rounds.
R=dhrosa@google.com , harryjin@google.com
BUG=libyuv:447,libyuv:527
Review URL: https://codereview.chromium.org/1513183004 .
2015-12-14 17:25:36 -08:00
Frank Barchard
71b60123dc
GN: Fix neon files not being included for arm64
...
BUG=568883
R=fbarchard@chromium.org
Review URL: https://codereview.chromium.org/1516653004 .
2015-12-14 11:48:06 -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
5c5cecb40c
rollback to old chromium dependencies
...
include paths break for gtest
TBR=harryjin@google.com
BUG=none
Review URL: https://codereview.chromium.org/1517123002 .
2015-12-10 18:37:25 -08:00
Frank Barchard
44373d8fbb
Add check for DEBUG to functions disabled on 386
...
Some functions run out of registers when compiled for debug,
fpic, with stack frames on 32 bit x86 with clang.
Previously they were enabled based on _DEBUG but that macro
is not set in some build systems. This CL adds DEBUG macro as
well to cover those environments.
R=harryjin@google.com
BUG=libyuv:532
Review URL: https://codereview.chromium.org/1517693005 .
2015-12-10 15:42:46 -08:00
Frank Barchard
785a261cd2
bump to chromium revision used by webrtc
...
BUG=none
R=harryjin@google.com
Review URL: https://codereview.chromium.org/1506023009 .
2015-12-10 15:42:18 -08:00
Frank Barchard
b3bbcc1f4e
add ifdef for AVX2 so vs2010 can still compile
...
R=harryjin@google.com
BUG=libyuv:531
Review URL: https://codereview.chromium.org/1515503005 .
2015-12-09 15:23:51 -08:00
Frank Barchard
cb44936403
fix typo in avx2 gcc blend.
...
was using wrong register on 32 pixel version.
R=harryjin@google.com , dhrosa@google.com
BUG=libyuv:527
Review URL: https://codereview.chromium.org/1511433006 .
2015-12-09 10:38:46 -08:00
Frank Barchard
353ffbab80
fix for gcc compile error: variable duplicate define
...
TBR=harryjin@google.com
BUG=libyuv:529
Review URL: https://codereview.chromium.org/1512793002 .
2015-12-08 19:03:43 -08:00
Frank Barchard
a2ea905679
BlendPlane any width.
...
Benchmark
out\release\libyuv_unittest --libyuv_width=1279 --libyuv_height=719 --libyuv_repeat=999 --libyuv_flags=-1 --gtest_filter=*Blend* | sortms
Was
I420Blend_Any (2321 ms)
I420Blend_Unaligned (1684 ms)
I420Blend_Opt (1675 ms)
I420Blend_Invert (1653 ms)
BlendPlane_Invert (1556 ms)
BlendPlane_Any (1552 ms)
BlendPlane_Unaligned (1548 ms)
BlendPlane_Opt (1535 ms)
ARGBBlend_Unaligned (659 ms)
ARGBBlend_Any (596 ms)
ARGBBlend_Invert (591 ms)
ARGBBlend_Opt (508 ms)
BlendPlaneRow_Unaligned (186 ms)
BlendPlaneRow_Opt (171 ms)
Now
ARGBBlend_Any (621 ms)
ARGBBlend_Unaligned (585 ms)
ARGBBlend_Invert (564 ms)
ARGBBlend_Opt (512 ms)
I420Blend_Unaligned (347 ms)
I420Blend_Invert (345 ms)
I420Blend_Any (337 ms)
I420Blend_Opt (327 ms)
BlendPlane_Unaligned (187 ms)
BlendPlaneRow_Unaligned (187 ms)
BlendPlane_Invert (186 ms)
BlendPlane_Any (186 ms)
BlendPlaneRow_Opt (173 ms)
BlendPlane_Opt (171 ms)
which is comparable to aligned case
out\release\libyuv_unittest --libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=-1 --gtest_filter=*Blend* | sortms
ARGBBlend_Any (625 ms)
ARGBBlend_Unaligned (602 ms)
ARGBBlend_Invert (508 ms)
ARGBBlend_Opt (506 ms)
I420Blend_Any (353 ms)
I420Blend_Unaligned (322 ms)
I420Blend_Invert (304 ms)
I420Blend_Opt (301 ms)
BlendPlaneRow_Unaligned (188 ms)
BlendPlane_Unaligned (186 ms)
BlendPlane_Invert (185 ms)
BlendPlane_Any (184 ms)
BlendPlaneRow_Opt (173 ms)
BlendPlane_Opt (169 ms)
R=dhrosa@google.com , harryjin@google.com
BUG=libyuv:527
Review URL: https://codereview.chromium.org/1513443002 .
2015-12-08 18:59:48 -08:00
Frank Barchard
dee77a4ebe
Optimize yuv alpha blend AVX2 code to do 32 pixels at time.
...
out/Release/libyuv_unittest --libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=9999 --libyuv_flags=-1 --gtest_filter=*I420Blend_Opt
Was LibYUVPlanarTest.I420Blend_Opt (2335 ms)
Now LibYUVPlanarTest.I420Blend_Opt (1937 ms)
vs SSSE3
LibYUVPlanarTest.I420Blend_Opt (2599 ms)
BUG=libyuv:527
R=dhrosa@google.com
Review URL: https://codereview.chromium.org/1505673003 .
2015-12-08 18:20:30 -08:00
Frank Barchard
fae1a10545
Work around bug in xgetbv for Visual Studio.
...
xgetbv is generating bad code, falsely disabling AVX2 and AVX512.
disable optimization for the function affected on older versions of Visual C 32 bit.
R=brucedawson@chromium.org , dhrosa@google.com , harryjin@google.com
BUG=libyuv:529
Review URL: https://codereview.chromium.org/1503393004 .
2015-12-08 18:13:32 -08:00
Frank Barchard
2657688e70
Add support for odd height YUVA alpha blending.
...
R=dhrosa@google.com , harryjin@google.com
BUG=libyuv:527
Review URL: https://codereview.chromium.org/1507683003 .
2015-12-07 12:03:20 -08:00
Frank Barchard
b0b22f88b9
Unroll C version of YUV blender for improved performance.
...
R=dhrosa@google.com , harryjin@google.com
BUG=libyuv:527
Review URL: https://codereview.chromium.org/1502343003 .
2015-12-07 12:02:45 -08:00
Frank Barchard
48a919d86e
Bug fix for UYVYToNV12 odd height
...
TBR=harryjin@google.com
BUG=libyuv:528
Review URL: https://codereview.chromium.org/1506973002 .
2015-12-07 11:39:48 -08:00
Frank Barchard
bea690b3e0
AVX2 YUV alpha blender and improved unittests
...
AVX2 version can process 16 pixels at a time for improved memory bandwidth and fewer instructions.
unittests improved to test unaligned memory, and test exactness when alpha is 0 or 255.
R=dhrosa@google.com , harryjin@google.com
BUG=libyuv:527
Review URL: https://codereview.chromium.org/1505433002 .
2015-12-05 22:23:29 -08:00