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
Frank Barchard
28427a53e2
I444ToABGR for android
...
Reimplements I444ToARGB as a matrix function.
new I444ToABGR as matrix functions with wrappers and any functions.
Allows for future J444 and H444 versions.
I444ToABGR user level function added.
BUG=libyuv:490, libyuv:449
R=harryjin@google.com
Review URL: https://codereview.chromium.org/1355733002 .
2015-09-18 11:20:58 -07:00
Frank Barchard
ed55d24d9f
H420 functionality
...
R=harryjin@google.com
BUG=libyuv:488
Review URL: https://webrtc-codereview.appspot.com/54869004 .
2015-09-06 11:01:40 -07:00
Frank Barchard
7060e0d826
I420ToABGRMatrix functions with J420ToABGR wrapper.
...
Allows direct conversion from JPeg to ABGR for android.
BUG=libyuv:488
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/55719004 .
2015-09-03 10:42:36 -07:00
Frank Barchard
4dfdabb552
I420AlphaToABGR for android version of yuva conversion
...
Same as I420AlphaToARGB but first step converts to ABGR instead of ARGB.
TBR=harryjin@google.com
BUG=libyuv:473
Review URL: https://webrtc-codereview.appspot.com/52779004 .
2015-08-20 19:36:59 -07:00
Frank Barchard
cda9d38a4e
xmmword cast for clang
...
clangcl use compare_win for 32 bit, allowing fallback and enabling avx2 code for clang.
move defines/protos to compare_row.h
fix issue with odd width ARGBCopyAlpha functions by copying destination to temp buffer, then doing alpha copy, then copy back to destination.
R=harryjin@google.com
TBR=harryjin@google.com
BUG=libyuv:484
Review URL: https://webrtc-codereview.appspot.com/59379004 .
2015-08-18 11:13:12 -07:00
Frank Barchard
8e7a62f22a
I420AlphaToARGB conversion for planar YUV with Alpha to ARGB.
...
R=brucedawson@chromium.org , harryjin@google.com
BUG=libyuv:473
Review URL: https://webrtc-codereview.appspot.com/54829004 .
2015-08-12 17:01:24 -07:00
Frank Barchard
f242a4a1a1
ValidateJpeg check for valid pointer and size
...
R=harryjin@google.com
BUG=chromium:497297
Review URL: https://webrtc-codereview.appspot.com/57649004 .
2015-07-30 15:49:48 -07:00
Frank Barchard
f5c71e52bb
rowbytes fix for nv12 tests
...
R=harryjin@google.com
BUG=libyuv:466
Review URL: https://webrtc-codereview.appspot.com/50349004 .
2015-07-21 10:48:10 -07:00
Frank Barchard
ce98129951
yuy2tonv12
...
R=bcornell@google.com
BUG=libyuv:466
Review URL: https://webrtc-codereview.appspot.com/51309004 .
2015-07-17 16:22:59 -07:00
Frank Barchard
faa4b14f85
uyvy to nv12
...
R=harryjin@google.com
BUG=libyuv:466
Review URL: https://webrtc-codereview.appspot.com/50339004 .
2015-07-17 14:43:19 -07:00
fbarchard@google.com
05416e2d9a
Box filter for YUV use rows with accumulation buffer for better memory behavior. The old code would do columns accumulated into registers, and then store the result once. This was slow from a memory point of view. The new code does a row of source at a time, updating an accumulation buffer every row. The accumulation buffer is small, and should fit cache. Before each accumulation of N rows, the buffer needs to be reset to zero. If the memset is a bottleneck, it would be faster to do the first row without an add, storing to the accumulation buffer, and then add for the remaining rows.
...
BUG=425
TESTED=out\release\libyuv_unittest --gtest_filter=*ScaleTo1x1*
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/52659004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1428 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-06-09 01:05:18 +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
d28cd77f99
Enable assembly for clangcl build on Windows. Previously assembly was disabled so clangcl would work, but only with C code. As clangcl mimics both Visual C and GCC, ifdefs need to pick one or the other or often you'll end up with both. In this CL we disable most Visual C code and use the GCC versions which allow assembly for both 32 and 64 bit intel.
...
BUG=412
TESTED=clang=1 build on windows
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/51389004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1341 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-03-19 20:36:31 +00:00
fbarchard@google.com
92f7f421fd
rename I400 to J400 and I400 reference to I400. J400 is a simple replication of values to convert to RGB, which is what the old I400 was. I400 reference is the Y part of the YUV formula, so renaming that to I400.
...
BUG=none
TESTED=libyuvTest (5925 ms total)
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/50369005
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1333 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-03-17 00:01:18 +00:00
fbarchard@google.com
24152b2435
Dither from I420 to RGB565 in 2 steps - I420ToARGB then ARGBToRGB565.
...
BUG=407
TESTED=untested
R=brucedawson@google.com , tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/48429004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1315 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-03-10 01:45:04 +00:00
fbarchard@google.com
9c96867a97
lrintf is not supported by visual studio 2010; replace instances of lrintf with a cast to int.
...
BUG=409
TESTED=python build\gyp_chromium -fninja -G msvs_version=2010 --depth=. libyuv_test.gyp
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/44569004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1312 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-03-06 22:20:41 +00:00
fbarchard@google.com
bdeb9ac584
switch from 8x8 to 4x4 matrix for dithering
...
BUG=407
TESTED=Dither unittests
R=brucedawson@google.com
Review URL: https://webrtc-codereview.appspot.com/46459004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1310 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-03-06 18:28:00 +00:00
fbarchard@google.com
0fe4abbc5c
ARGBToRGB565 AVX2 with dithering
...
BUG=407
TESTED=ARGBToRGB565Dither unittest
R=brucedawson@google.com , harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/44519004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1309 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-03-04 22:31:43 +00:00
fbarchard@google.com
933bd40c3c
port ARGBToRGB565 and ARGB1555 to AVX2. Enable functions that use ARGBToRGB565 AVX2 code. Add ARGBToRGB565Dither function.
...
BUG=403
TESTED=local windows build
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/42109004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1302 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-02-27 21:15:28 +00:00
fbarchard@google.com
194f740d0e
Scan from start of buffer to handle case where an invalid size was passed.
...
BUG=404
TESTED=libyuvTest.ValidateJpegLarge
R=brucedawson@google.com , harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/41989004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1285 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-02-18 01:57:31 +00:00
fbarchard@google.com
a965a97d8e
Unittest to test ValidateJpeg when jpeg is small but buffer is large
...
BUG=404
TESTED=libyuvTest.ValidateJpegLarge
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/36169004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1284 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-02-17 19:16:14 +00:00
fbarchard@google.com
738dfa0307
Support odd widths for NV12 format when cropping vertically.
...
BUG=400
TESTED=CropNV12
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/39009004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1272 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-02-10 02:18:38 +00:00
fbarchard@google.com
0887315390
Remove bayer format support from libyuv. This format is very rare and used on legacy hardware. Its not well optimized and has bugs related to odd widths. Removing the format will allow tests to pass under more circumstances, run faster and allow focus on higher priority quality and performance issues.
...
BUG=301
TESTED=local unittests build/pass on windows gyp build.
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/38059004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1270 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-02-09 19:58:19 +00:00
fbarchard@google.com
c4e032c543
change Y multiplier and bias to compensate for 257/256 which makes YToARGB exactly match float math.
...
Histogram Before
hist -3 -2 -1 0 1 2 3
red 0 0 1809408 13140736 1827072 0 0
green 0 0 1679912 13471329 1625975 0 0
blue 168448 994816 1876480 10655488 1893376 1006336 182272
Histogram After
hist -3 -2 -1 0 1 2 3
red 0 0 558848 15632128 586240 0 0
green 0 0 209907 16350588 216721 0 0
blue 14848 642816 1989376 11363328 2053120 695040 18688
BUG=394
TESTED=more stringent luma tests
R=brucedawson@google.com
Review URL: https://webrtc-codereview.appspot.com/38859004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1259 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-02-04 19:45:26 +00:00
fbarchard@google.com
3982998c7c
YToARGB AVX2 port from SSE2
...
BUG=393
TESTED=YToARGB unittest
R=brucedawson@google.com , harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/41679004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1258 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-02-03 01:35:11 +00:00
fbarchard@google.com
0494ffee81
use lrintf to round from float to int instead of round and then cast.
...
BUG=393
TESTED=local windows test passed.
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/37899004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1257 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-02-02 21:06:51 +00:00
fbarchard@google.com
c61394789d
Test for YToARGB to ensure ordering of values.
...
BUG=393
TESTED=TestYToARGB
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/37819004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1256 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-02-02 18:51:29 +00:00
fbarchard@google.com
a5a15198b4
Add J422 support which is 2x1 subsampling with jpeg color space.
...
BUG=391
TESTED=color_test
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/41479004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1228 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-01-14 19:16:01 +00:00
fbarchard@google.com
e0a2472fb3
Move color space tests into its own source file.
...
BUG=391
TESTED=TestI420
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/35769004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1227 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-01-13 23:47:25 +00:00
fbarchard@google.com
69df62234b
Test J420 conversion to and from ARGB has low absolute difference.
...
BUG=none
TESTED=TestJ420
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/34739004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1225 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-01-13 19:53:15 +00:00
fbarchard@google.com
cb96f37afa
Convert to and from J420 to test absolute conversion error.
...
BUG=241
TESTED=TestJ420
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/36729004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1224 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-01-13 18:58:17 +00:00
fbarchard@google.com
40e3457574
J420ToARGB jpeg variation of YUV color space to ARGB.
...
BUG=241
TESTED=J420ToARGB unittest
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/32929004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1212 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-12-29 19:17:53 +00:00
fbarchard@google.com
d3bc010367
Use expect near to see exact values for differences.
...
BUG=269
TESTED=local unittest
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/32349004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1204 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-12-15 22:48:32 +00:00
fbarchard@google.com
7866d8e082
Make unittest check every pixel and report the first failure.
...
BUG=269
TESTED=unittest passes on windows
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/36509004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1203 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-12-15 19:51:50 +00:00
fbarchard@google.com
9107460c7f
Offset destination by 1 for I420ToARGB_Unaligned test to ensure destination alignment avoids exceptions.
...
BUG=372
TESTED=out\release_x64\libyuv_unittest --gtest_catch_exceptions=0 --gtest_filter=*I420ToARGB_Unaligned
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/23109004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1125 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-10-17 01:18:02 +00:00
ashok.bhat@gmail.com
147bbede9d
Row AArch64 Neon implementation - Part 8
...
BUG=319
TESTED=libyuv_unittest
R=fbarchard@google.com
Change-Id: If30eb2d255a09dece9d216a9d29317dd748ef496
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Review URL: https://webrtc-codereview.appspot.com/22769004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1109 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-10-03 18:10:05 +00:00
fbarchard@google.com
77564a9323
valgrind fix to CropNV12 unittest. round crop amount to multiple of 2 so UV will be an even number.
...
BUG=350
TESTED=drmemory out\debug\libyuv_unittest.exe --gtest_catch_exceptions=0 --gtest_filter=*CropNV12
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/14159004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1050 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-08-19 18:32:03 +00:00
fbarchard@google.com
455c66b437
Add a gyp define LIBYUV_DISABLE_JPEG to not build jpeg library
...
BUG=346
TESTED=set GYP_DEFINES=target_arch=ia32 libyuv_disable_jpeg=1 & python gyp_libyuv -fninja -G msvs_version=2010 libyuv_test.gyp
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/16989004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1038 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-07-28 21:48:43 +00:00
fbarchard@google.com
9f12361e39
redo nv12 crop unittest with expect eq
...
BUG=334
TESTED=crop
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/16129004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1037 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-07-18 22:34:04 +00:00
fbarchard@google.com
74ce999a9a
Add NV12 cropping unittest to confirm behavior.
...
BUG=344
TESTED=libyuv_unittest --gtest_filter=*CropNV12
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/16939004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1036 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-07-18 18:18:35 +00:00
fbarchard@google.com
193c1ff11d
test conversions that are reversible.
...
BUG=334
TESTED=unittests added to test functionality that is reversible.
R=sandersd@chromium.org
Review URL: https://webrtc-codereview.appspot.com/15679004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1009 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-06-04 23:19:37 +00:00
fbarchard@google.com
16ea9c816b
libyuv::MJPGToI420() and libyuv::MJPGToARGB() return failure if callback to JPeg fails.
...
BUG=309
TESTED=try bots still pass
R=braveyao@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/7709004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@976 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-01-28 03:08:59 +00:00
fbarchard@google.com
4752dc5949
Clear destinations to different values to detect returning with error code rather than doing the conversion.
...
BUG=296
TESTED=convert_unittest
R=johannkoenig@google.com
Review URL: https://webrtc-codereview.appspot.com/6349004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@923 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-26 23:09:57 +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
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
04f40278df
yasm ALIGN uppercase
...
BUG=none
TEST=untested
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/4769005
git-svn-id: http://libyuv.googlecode.com/svn/trunk@885 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-03 00:51:14 +00:00
fbarchard@google.com
545a51c1d3
use scale for subsampling to handle odd source width to even destination width.
...
BUG=289
TEST=drmemory
R=nfullagar@google.com , ryanpetrie@google.com
Review URL: https://webrtc-codereview.appspot.com/4779004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@884 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-03 00:27:29 +00:00
fbarchard@google.com
0e82bd7e9f
respect subsample in planar unittest
...
BUG=289
TESTED=drmemory on YUY2ToI420_Opt with odd width
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/4709004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@881 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-12-02 18:03:42 +00:00
fbarchard@google.com
88ce3c0caa
Change unittests to pass when size is 1 tall.
...
BUG=202
TEST=set LIBYUV_HEIGHT=1 & out\release\libyuv_unittest
R=ryanpetrie@google.com
Review URL: https://webrtc-codereview.appspot.com/2391004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@811 16f28f9a-4ce2-e073-06de-1de4eb20be90
2013-10-14 19:36:26 +00:00