156 Commits

Author SHA1 Message Date
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
0a3d23c898 fix clang-format-ing for row arm functions
TBR=kjellander@chromium.org
BUG=None
TEST=git cl lint

Change-Id: I45ecd7f8279981ba037dc051f521f6b6d5506f64
Reviewed-on: https://chromium-review.googlesource.com/664345
Commit-Queue: Frank Barchard <fbarchard@google.com>
Reviewed-by: Frank Barchard <fbarchard@google.com>
2017-09-14 21:35:06 +00:00
Frank Barchard
1e16cb5c38 SplitRGBPlane and MergeRGBPlane functions added
Converts packed RGB to planar and back.

TBR=kjellander@chromium.org
BUG=libyuv:728
TEST=MergeRGBPlane_Opt and SplitRGBPlane_Opt unittests added

Change-Id: Ida59af940afcb1fc4a48bbf62c714f592665c3cc
Reviewed-on: https://chromium-review.googlesource.com/658069
Reviewed-by: Frank Barchard <fbarchard@google.com>
Reviewed-by: Cheng Wang <wangcheng@google.com>
2017-09-11 21:02:04 +00:00
Frank Barchard
6c94ad13b5 Remove ARM NaCL macros from source
NaCL has been disabled for awhile, so the code
will still build, but only with C versions.
This change removes the MEMACCESS() macros from
Neon and Neon64 source.

BUG=libyuv:702
TEST=try bots build for arm.
R=kjellander@chromium.org

Change-Id: Id581a5c8ff71e18cc69595e7fee9337f97c44a19
Reviewed-on: https://chromium-review.googlesource.com/528332
Reviewed-by: Cheng Wang <wangcheng@google.com>
Commit-Queue: Frank Barchard <fbarchard@google.com>
2017-06-09 22:22:07 +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
f2c27dafa2 HalfFloat neon armv7 fix for destination pointer.
Improved unittests detect different in arm64 rounding.

TEST=util/android/test_runner.py gtest -s libyuv_unittest -t 7200 --verbose --release --gtest_filter=*Half* -a "--libyuv_width=640 --libyuv_height=360"
BUG=libyuv:560
R=wangcheng@google.com

Review URL: https://codereview.chromium.org/2478313004 .
2016-11-07 12:13:04 -08:00
Frank Barchard
eca08525cb HalfFloat Neon for ARMv7.
64 bit version made similar to 32 bit with registers 1 for load and store results, and 2 and 3 as expanded float temporary values.

TEST=out/Release/libyuv_unittest --gtest_filter=*Half*

BUG=libyuv:560
R=wangcheng@google.com

Review URL: https://codereview.chromium.org/2467723002 .
2016-11-01 11:36:51 -07:00
Frank Barchard
d363ea6527 Remove I411 support.
YUV 411 is very uncommon format.  Remove support.

Update documentation to reflect that 411 is deprecated.

Simplify tests for YUV to only test with the new side by side YUV but keep old 3 plane test around with a macro for now.

BUG=libyuv:645
R=kjellander@chromium.org

Review URL: https://codereview.chromium.org/2406123002 .
2016-10-11 11:14:16 -07:00
Frank Barchard
edd3a84d05 libyuv::YUY2ToY for isolating Y channel of YUY2.
This function is the first step of YUY2 To I420.
Provided primarily for diagnostics.

TBR=wangcheng@google.com
BUG=libyuv:647
TESTED=LibYUVConvertTest.YUY2ToY_Opt

Review URL: https://codereview.chromium.org/2399153004 .
2016-10-07 17:20:30 -07:00
Frank Barchard
17e8a4d3df Remove ifdefs for neon in row_neon*.cc
ifdefs on a function level are not needed for neon functions, unless
they are conditionally enabled in row.h.  No functions are conditionally
enabled at this time, so all ifdefs can be removed from row_neon.cc and
row_neon64.cc

TBR=kjellander@chromium.org
BUG=libyuv:599

Review URL: https://codereview.chromium.org/2044223002 .
2016-06-07 14:34:13 -07:00
Frank Barchard
6546096269 ARGBExtractAlpha 16 pixels at a time for ARM
arm64   8     TestARGBExtractAlpha (10019 ms) <-original 64 bit code
arm64   8 x2  TestARGBExtractAlpha (7639 ms)
arm64   16    TestARGBExtractAlpha (7369 ms) <- new 64 bit code
thumb32 8     TestARGBExtractAlpha (9505 ms) <- original 32 bit code
thumb32 8 x2  TestARGBExtractAlpha (7400 ms)
thumb32 8 x2i TestARGBExtractAlpha (7266 ms) <- new 32 bit code
arm32   8     TestARGBExtractAlpha (10002 ms)

BUG=libyuv:572
TESTED=local test on nexus 9
R=harryjin@google.com, wangcheng@google.com

Review URL: https://codereview.chromium.org/2035573002 .
2016-06-07 10:44:28 -07:00
Magnus Jedvert
942db3016a Add ARGBExtractAlpha function
BUG=libyuv:572
R=fbarchard@google.com

Review URL: https://codereview.chromium.org/1995293002 .
2016-05-26 10:30:57 +02:00
Frank Barchard
ee99b85126 Port ARGBToRGB565 from aarch64 neon to 32 bit
The 64 bit version of ARGBToRGB565 to 32 bit. 64 bit is using sri which shifts and inserts, saving some masking.  The instruction is available for neon 32 bit as well.

R=magjed@chromium.org, harryjin@google.com
BUG=libyuv:571

Review URL: https://codereview.chromium.org/1724393002 .
2016-02-29 12:22:25 -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
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
98eb102bea set d19 alpha on inner loop
TBR=harryjin@google.com
BUG=libyuv:521

Review URL: https://codereview.chromium.org/1429263004 .
2015-11-06 11:38:21 -08:00
Frank Barchard
860cc0357a Neon versions of I420AlphaToARGB
Add alpha version of YUV to RGB to neon code for ARMv7 and aarch64.
For other YUV to RGB conversions, hoist alpha set to 255 out of loop.

TBR=harryjin@google.com
BUG=libyuv:516

Review URL: https://codereview.chromium.org/1413763017 .
2015-11-03 19:21:36 -08:00
Frank Barchard
d95d2169d9 rename yuv matrix constants to be more clear about what they are
R=harryjin@google.com
BUG=none

Review URL: https://codereview.chromium.org/1429693006 .
2015-11-03 17:09:53 -08:00
Frank Barchard
ce4c2fad1d Raw 24 bit RGB to RGB24 (bgr)
Add unittests that do 1 step conversion vs 2 step conversion.

Tests end swapping versions match direct conversions.

R=harryjin@google.com
BUG=libyuv:518

Review URL: https://codereview.chromium.org/1419103007 .
2015-11-03 10:30:30 -08:00
Frank Barchard
2c7aa0070a remove I422ToBGRA and use I422ToRGBA internally
Removes low levels for I420ToBGRA and I420ToRAW and reimplements them as I420ToRGBA and I420ToRGB24 with transposed color matrix.

Adds unittests that do 1 step conversion vs 2 steps to test end swapping versions match direct conversions.

R=harryjin@google.com
BUG=libyuv:518

Review URL: https://codereview.chromium.org/1427993004 .
2015-11-02 10:24:12 -08:00
Frank Barchard
5d97b93369 refactor I420ToABGR to use I420ToARGBRow
Using a transposed conversion matrix, I420ToARGB can output ABGR.

R=harryjin@google.com, xhwang@chromium.org
BUG=libyuv:473

Review URL: https://codereview.chromium.org/1413573010 .
2015-10-30 11:56:57 -07:00
Frank Barchard
2e4466e282 change all pix parameters to width for consistency
TBR=harryjin@google.com
BUG=none

Review URL: https://codereview.chromium.org/1398633002 .
2015-10-07 22:30:36 -07:00
Frank Barchard
76a599ec3b fix jpeg and bt.709 yuvconstants for neon64.
yuv constants for bt.601 were previously ported to neon64, as well
as the code to respect other color spaces.  But the jpeg and bt.709
colour conversion constants were still in armv7 form.  This changes
the constants for aarch64 builds to be compatible with the code.

yuv constants are now passed as const *

Remove Yvu constants which were used for older version on nv21 but not new code.

TBR=harryjin@google.com
BUG=none

Review URL: https://codereview.chromium.org/1398623002 .
2015-10-07 19:46:56 -07:00
Frank Barchard
914a9856c7 Reimplement NV21ToARGB to allow different color matrix.
Low level for NV21ToARGB written to accept yuv matrix used by
other YUV to ARGB functions.
Previously NV21 was implemented for Windows using NV12 with a different
matrix that swapped U and V.  But the Arm version of the low level does
not allow the matrix U and V contributions to be swapped.
Using a new low level function that reads NV21 and uses the same
yuvconstants as other YUV conversion functions allows an Arm port of
this function.

TBR=harryjin@google.com
BUG=libyuv:500

Review URL: https://codereview.chromium.org/1388273002 .
2015-10-06 20:34:44 -07:00
Frank Barchard
f96890a0be yuvconstants for all YUV to RGB conversion functions.
R=harryjin@google.com
BUG=libyuv:488

Review URL: https://codereview.chromium.org/1363503002 .
2015-09-22 10:26:03 -07:00
Frank Barchard
62c49dc811 move constants into common
R=harryjin@google.com
BUG=libyuv:488

Review URL: https://codereview.chromium.org/1359443005 .
2015-09-18 16:28:44 -07:00
Frank Barchard
28ce7d94f5 j422toabgr neon port using i422toabgr matrix function.
R=harryjin@google.com
BUG=libyuv:488

Review URL: https://codereview.chromium.org/1353923003 .
2015-09-17 15:20:55 -07:00
Frank Barchard
6a6b67e7a9 Add H422ToARGB armv7 neon version.
Patch provided by zhongwei.yao@linaro.org

R=fbarchard@chromium.org, fbarchard@google.com
BUG=libyuv:488

Review URL: https://codereview.chromium.org/1344393002 .
2015-09-17 10:38:15 -07:00
Frank Barchard
509c644245 Add J422ToARGB armv7 neon version.
R=fbarchard@chromium.org, fbarchard@google.com
BUG=libyuv:488

Review URL: https://codereview.chromium.org/1334173005 .
2015-09-15 15:01:48 -07:00
Frank Barchard
73c32d92d7 neon64 use yuvconstants like 32 bit code.
TBR=harryjin@google.com
BUG=libyuv:488

Review URL: https://codereview.chromium.org/1345643002 .
2015-09-14 16:43:07 -07:00
Frank Barchard
a67927c994 use struct instead of vectors
TBR=harryjin@google.com
BUG=libyuv:488

Review URL: https://codereview.chromium.org/1345623003 .
2015-09-14 16:07:58 -07:00
Frank Barchard
909160b3b5 use same macros as row_gcc.cc
R=harryjin@google.com
BUG=libyuv:488

Review URL: https://codereview.chromium.org/1343863002 .
2015-09-14 15:36:10 -07:00
Frank Barchard
67a9e30225 neon yuv matrix function
R=harryjin@google.com
BUG=libyuv:488

Review URL: https://codereview.chromium.org/1337973002 .
2015-09-11 11:12:30 -07:00
Frank Barchard
1f461f73d8 remove align directives
R=harryjin@google.com
BUG=none

Review URL: https://webrtc-codereview.appspot.com/54809004.
2015-08-04 17:00:03 -07:00
fbarchard@google.com
cfce47efc8 Change Sobel to use JPeg Luma calculation instead of extracting G channel. Using luma produces a better sobel that respects all 3 channels of RGB. Historically the G channel was used to improve performance, and because the luma of I420 is a constrained range, hurting quality. Using the JPeg variation of YUV, the luma is more accurate, including cross platform, better optimized for AVX2 and odd widths, and full range.
BUG=444
TESTED=ARGBSobelXY_Opt
R=harryjin@google.com

Review URL: https://webrtc-codereview.appspot.com/57479004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1414 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-05-27 22:32:26 +00:00
fbarchard@google.com
3666015261 add nacl macros for arm to YUV422TORGB_SETUP_REG.
BUG=415
TESTED=ncval.exe newlib/Release/nacltest_arm.nexe
R=bcornell@google.com

Review URL: https://webrtc-codereview.appspot.com/46229005

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1406 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-05-12 21:33:32 +00:00
yang.zhang@arm.com
c00796c4e4 Fix the issue of q4 register not in clobber list for ARMv7
On ARMv7 platform, q4 is used, but it isn't declared in clobber list.
It results that q4 isn't preserved automatically by compiler. So that the value of q4 is destroyed.

BUG=418
TESTED=libyuvTest.* on ARM32 with Android
R=fbarchard@google.com

Change-Id: Ib9b5eff8231c5057f4d58f1c4029f5452222af55

Review URL: https://webrtc-codereview.appspot.com/47899004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1353 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-04-02 02:33:23 +00:00
yang.zhang@arm.com
e246e6c18f Add ARGBToRGB565DitherRow_NEON for ARM32/64
ARM32/64 NEON versions of ARGBToRGB565DitherRow_NEON are implemented.

BUG=407
TESTED=libyuvTest.* on ARM32/64 with Android
R=fbarchard@google.com

Change-Id: Ia689170fb39db964392e5e1113801592ab0628bf

Review URL: https://webrtc-codereview.appspot.com/49409004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1335 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-03-17 02:22:25 +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
6eaee58589 shift by 16 for neon expects a number sign
BUG=408
TESTED=nacl arm build
R=harryjin@google.com

Review URL: https://webrtc-codereview.appspot.com/38329004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1305 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-03-02 18:48:17 +00:00
yang.zhang@arm.com
94e3d5a3be Improve the accuracy YUV to RGB for ARMv7 NEON
NEON version of YUV422TORGB is updated based on C algorithm. Accuracy YUV to RGB
of NEON is also updated according to test result. Macro LIBYUV_NEON is added to
identify accuracy YUV to RGB for ARM platform.
Except TestJ420 and TestYUV, all the other tests are passed.

BUG=324
TESTED=libyuvTest on ARMv7 with Android
R=fbarchard@google.com

Change-Id: I492ca628679940534f40341721dc5b6dc2d7a5b6

Review URL: https://webrtc-codereview.appspot.com/40609004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1296 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-02-25 06:51:29 +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
b2a6af1be6 Change rectangle low level functions to use more conventional row functions including 'any' variations. Previously the yuv function SetPlane stored 32 bit values. Now a more conventional memset() style function is used for YUV that stores bytes. On Haswell a rep stosb is used for YUV. Overall benefit of this CL is improved performance for 'any' width, and simpler row assembly instead of full image assembly. Previously ARGBRect used a low level function that supported a rectangle in assembly. Now it uses a row function, and relies on row coalesce to combine into a single low level call.
BUG=371
TESTED=untested
R=brucedawson@google.com, harryjin@google.com

Review URL: https://webrtc-codereview.appspot.com/35689004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1222 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-01-12 03:58:24 +00:00
fbarchard@google.com
89671c4de1 Fix for build on 32 bit neon
BUG=none
TESTED=nacl neon build
R=harryjin@google.com, tpsiaki@google.com

Review URL: https://webrtc-codereview.appspot.com/34659004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1221 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-01-09 17:40:56 +00:00
fbarchard@google.com
852f4854c0 Neon version of new SetRow functions for rectangles.
BUG=387
TESTED=untested
R=tpsiaki@google.com

Review URL: https://webrtc-codereview.appspot.com/39449004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1220 16f28f9a-4ce2-e073-06de-1de4eb20be90
2015-01-09 00:15:44 +00:00
yang.zhang@arm.com
002feab4c5 Fix the bug in ARGBColorMatrixRow_NEON
BUG=371
TESTED=libyuv_unittest and test case written by myself
R=fbarchard@google.com

Change-Id: I652dc23e4be75bd51d15a8a7f9d023594c9cd032




git-svn-id: http://libyuv.googlecode.com/svn/trunk@1211 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-12-19 08:09:04 +00:00
fbarchard@google.com
d83f63a3b4 InterpolateRow used for scale handle unaligned memory. Remove HalfRow which is not used.
BUG=367
TESTED=unittest on I422ToI420
R=harryjin@google.com

Review URL: https://webrtc-codereview.appspot.com/28639004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1107 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-10-03 17:37:11 +00:00
fbarchard@google.com
8cbfc5d41f Change ifdefs for arm 32 and 64 bit so there will only be 32 bit in legacy mode.
BUG=357
TESTED=ios arm64 build
R=tpsiaki@google.com

Review URL: https://webrtc-codereview.appspot.com/29429004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1083 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-09-15 22:05:01 +00:00
ashok.bhat@gmail.com
c8f529a48f Remove extra MEMACCESS
TESTED=libyuv_unittest

Change-Id: I25fae71200ea44846eea3604a55bf4a88ea593ce
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>


git-svn-id: http://libyuv.googlecode.com/svn/trunk@1039 16f28f9a-4ce2-e073-06de-1de4eb20be90
2014-07-29 18:32:59 +00:00