Avoid warnings regarding loss of qualifiers:
warning: cast from type ‘const uint8_t* {aka const unsigned char*}’
to type ‘v16i8* {aka __vector(16) signed char*}’ casts away
qualifiers
BUG=libyuv:793
Change-Id: Ie0d215bc07b49285b5d06ee91ccc2c9a7979799e
Reviewed-on: https://chromium-review.googlesource.com/1107879
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
After [1], a manual dependency on exe_and_shlib_deps is no longer necessary
since it's automatically added. This CL removes all remaining manual references
to exe_and_shlib_deps.
[1] d7ed1f0a9c
BUG=chromium:845700
R=fbarchard
Change-Id: I01ade690f3f098599ec271a1e82ec34c573e21d7
Reviewed-on: https://chromium-review.googlesource.com/1102100
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This reverts commit a8aa921c4614f9d6a0e8f3459648ca1ae75cdbe6.
Reason for revert: breaks a webrtc unittest on Windows.
https://bugs.chromium.org/p/webrtc/issues/detail?id=9263&can=2&start=0&num=100&q=&colspec=ID%20Pri%20M%20ReleaseBlock%20Component%20Status%20Owner%20Summary&groupby=&sort=
Original change's description:
> Allow negative height when ConvertToI420/ARGB is called with NV12/NV21
>
> ConvertToI420 and ConvertToARGB support the use of a negative height
> parameter to flip the image vertically. When converting from NV12 or
> NV21 this parameter was misinterpreted, resulting in invalid output.
> This CL introduces the use of abs_src_height to correctly calculate
> the location of the source UV plane.
>
> The sign of crop_height is not used, to reduce confusion ConvertToI420
> and ConvertToARGB no longer accept negative crop height.
>
> Unit tests for Android420ToI420 are updated to fix miscalculation of
> src_stride_uv, fix incorrect pixel strides, and to test inversion.
> New unit tests are included to test inversion for ConvertToARGB,
> ConvertToI420, Android420ToARGB, and Android420ToABGR.
> For consistency the test NV12Crop is renamed ConvertToI420_NV12_Crop.
>
> Bug: libyuv:446
> Test: out/Release/libyuv_unittest --gtest_filter=*.ConvertTo*:*.Android420To*
> Change-Id: Idc98e62671cb30272cfa7e24fafbc8b73712f7c6
> Reviewed-on: https://chromium-review.googlesource.com/994074
> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
TBR=fbarchard@chromium.org,robert@bares.me
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: libyuv:446, chromium:9263, libyuv:801
Change-Id: I7c55b3fcb477f9754c249b9c2c54b24da2c29283
Reviewed-on: https://chromium-review.googlesource.com/1081267
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Weiyong Yao <braveyao@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Mask was set to 32, but should have been 31.
BUG=libyuv:798
TESTED=try bots tested
Change-Id: I6120928873a4a2f1efef907d8e8296ca8c20bb03
Reviewed-on: https://chromium-review.googlesource.com/1054830
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
ConvertToI420 and ConvertToARGB support the use of a negative height
parameter to flip the image vertically. When converting from NV12 or
NV21 this parameter was misinterpreted, resulting in invalid output.
This CL introduces the use of abs_src_height to correctly calculate
the location of the source UV plane.
The sign of crop_height is not used, to reduce confusion ConvertToI420
and ConvertToARGB no longer accept negative crop height.
Unit tests for Android420ToI420 are updated to fix miscalculation of
src_stride_uv, fix incorrect pixel strides, and to test inversion.
New unit tests are included to test inversion for ConvertToARGB,
ConvertToI420, Android420ToARGB, and Android420ToABGR.
For consistency the test NV12Crop is renamed ConvertToI420_NV12_Crop.
Bug: libyuv:446
Test: out/Release/libyuv_unittest --gtest_filter=*.ConvertTo*:*.Android420To*
Change-Id: Idc98e62671cb30272cfa7e24fafbc8b73712f7c6
Reviewed-on: https://chromium-review.googlesource.com/994074
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This is a stop-gap; it will simply cause cipd deps to not be updated,
which will probably keep things working for now, but it's not what we
want for the long term.
Bug: chromium:659808
Change-Id: I292b96f174c8d910c0b5f0196eefd0e5a5f907c2
Reviewed-on: https://chromium-review.googlesource.com/1016380
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
When casting a const value, ensure the cast is const as well.
BUG=webm:1509
Change-Id: I5b597fdcc148d111e9824bc7cf918fc5f24e970f
Reviewed-on: https://chromium-review.googlesource.com/996553
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
This is the same fix as in d4cfc7bca1e6d66431b98b78dc2e29d9ec1bf904,
but applied at the second block that also defines HAS_HASHDJB2_AVX2.
Remove the duplicated, redundant block.
Change-Id: I53e0fc5f46e2ed5c14a4531c2b571c72d969a471
Reviewed-on: https://chromium-review.googlesource.com/989432
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
The file this referes to (x86inc.asm) was removed in commit
c9986313acbd74ebc2609f0a42492d0e2f1e78c6
BUG=libyuv:790
Change-Id: I4aae28475ef11e01304daf2aaf60a0404752cfa7
Reviewed-on: https://chromium-review.googlesource.com/996373
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
iOS simulator has the option to build with xcode instead of clang.
GN use_xcode_clang=true enables the xcode build.
As of version Xcode 9.2, the clang version used does not support
AVX512. The version reported is version 9, but for normal clang,
version 7 is sufficient to AVX512.
When a version of XCode does support AVX512, the version check can
be updated to allow AVX512 for newer versions of XCode.
with XCode 9.2 the following macro is set.
__APPLE_CC__ 6000
Bug: libyuv:789
Test: gn gen out/Release "--args=is_debug=false target_os=\"ios\" ios_enable_code_signing=false target_cpu=\"x86\" use_xcode_clang=true"
Change-Id: I5a9a0b4a2760c7d09a4bcb464b3668979113b07e
Reviewed-on: https://chromium-review.googlesource.com/991595
Reviewed-by: richard winterton <rrwinterton@gmail.com>
When detected, add the necessary defines to actually use it.
Change-Id: I540c3e11e480be8aaab154ad91ee08cdc52319de
Reviewed-on: https://chromium-review.googlesource.com/988432
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
In these cases, CLANG_HAS_AVX2 is defined, but _MSC_VER isn't.
The corresponding codepaths are in source/compare_win.cc, and the whole
file is guarded with a defined(_MSC_VER).
This is the same fix as in d8680893ecfcffd952c7a5d0dc1878d1c486a4e4,
but this issue wasn't noticed since compare.o wasn't linked in in
earlier tested configurations.
Change-Id: Ifff6d4bd7b1071256df1169881490a52026c183b
Reviewed-on: https://chromium-review.googlesource.com/988573
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Bug: libyuv:789
Test: builds locally on linux with clang
Change-Id: I3000494d4b0b18f59d7852bc1bc0c9e422d2d63a
Reviewed-on: https://chromium-review.googlesource.com/987331
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Scalar multiply expects a 'd' register. The "w" (float) uses 's' for float
and wont work with the multiply in 32 bit (it does in 64 bit).
A vector 2 of float passes as 'd' register.
A vector 4 of float passes as 'q' register.
This change copies the float into the first entry of a vector 2
and passes that. The optimizer removes the extra copy, allowing
the single float to use referenced as
Test: LibYUVPlanarTest.TestByteToFloat
Bug: libyuv:786
Change-Id: I8773c5bae043c7b84e1d1db7fdea6731aa0b1323
Reviewed-on: https://chromium-review.googlesource.com/973984
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
In these cases, CLANG_HAS_AVX2 is defined, but _MSC_VER isn't.
The corresponding codepaths are in source/row_win.cc, and the whole
file is guarded with an defined(_MSC_VER).
Change-Id: Idf0cfced3a0ef28c07b1393fe605a904420fd50f
Reviewed-on: https://chromium-review.googlesource.com/983592
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
row.h adds CLANG_HAS_AVX512
function ifdefs in row.h for avx512
source code ifdefed function by function for
avx512 and avx2.
Bug: libyuv:778
Test: LibYUVConvertTest.NV21ToRGB24_Opt
Change-Id: If32b51459685d0d5785c5c1e94c8f668f8e74b55
Reviewed-on: https://chromium-review.googlesource.com/982402
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Adds a method that forces the CPU flags. Useful when using libyuv inside
a sandboxed process which may not have access to the file system.
Bug: libyuv:787
Change-Id: I01f71e39a7301085d9de388eba930b4cac0fd7be
Reviewed-on: https://chromium-review.googlesource.com/972338
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This is what Chromium is moving to, and what WebRTC is using.
Next step: pull xcode via CIPD.
Bug:chromium:633032
Change-Id: I6a21aa0e5b212a3a9cb4e7cc79ebb614a89f73ed
Reviewed-on: https://chromium-review.googlesource.com/915921
Commit-Queue: Patrik Höglund <phoglund@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
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>
Use VMBI instructions but on AVX2 registers to avoid clockrate change.
Bug: libyuv:778
Test: LibYUVConvertTest.NV21ToRGB24_Opt
Change-Id: Id4f8ad1e0e142a380c8a46c5eab90ce145a10edd
Reviewed-on: https://chromium-review.googlesource.com/956609
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Change unittest flags to decimal so they can be used for --libyuv_cpu_info=
Add environment variables to disable AVX 512 bits.
Bug: libyuv:784
Test: LibYUVBaseTest.TestCpuHas
Change-Id: Iea6704368fbe9f6d3395933da7993fb2a3453225
Reviewed-on: https://chromium-review.googlesource.com/957704
Reviewed-by: richard winterton <rrwinterton@gmail.com>
AVX2 port of SSSE3 conversion to output 24 bit RGB
Bug: libyuv:778
Test: LibYUVConvertTest.NV21ToRGB24_Opt
Change-Id: I14f7815522d1b790ecd2bb39d9a3441e803b694a
Reviewed-on: https://chromium-review.googlesource.com/953303
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Use 2 step conversion for NV21ToRGB24 to leverage AVX2
low levels instead of C.
Was C
NV21ToRGB24_Opt (882 ms)
Now SSSE3
NV21ToRGB24_Opt (218 ms)
Bug: libyuv:778
Test: LibYUVConvertTest.NV21ToRGB24_Opt
Change-Id: I58faf766bbec4cc595aab2e217f6c874dd4b4363
Reviewed-on: https://chromium-review.googlesource.com/951629
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Unit tests to convert YUV to RGB previously allowed some error
for differences in implementation between C and SIMD versions,
and there were differences with Intel SSE2 vs ARM NEON.
Now those differences are resolved, the unittest can expect
exactness.
Bug: libyuv:447
Test: LibYUVConvertTest.I420ToARGB_Any
Change-Id: I00fe342523deba9420eb71812d09a8e89dc641a0
Reviewed-on: https://chromium-review.googlesource.com/946563
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Each byte is converted to float (0.0 to 255.0) and then multiplied
by a scale parameter.
Bug: None
Test: arm 64 build passes.
Change-Id: I04736798540b8d985f60abdf0388e24a209d075b
Reviewed-on: https://chromium-review.googlesource.com/930226
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Ian Field <ianfield@google.com>
ARGB rotation using scaling code. Previously it had forward
declarations of the low level row functions used. This CL
uses the header and hooks up Any and MSA versions of the code.
Bug: libyuv:779
Test: perf record out/Release/libyuv_unittest --gtest_filter=*ARGBRotate90_Opt --libyuv_width=640 --libyuv_height=359 --libyuv_repeat=999
Change-Id: Ifacd58b26bb17a236181a404fad589fd2543b911
Reviewed-on: https://chromium-review.googlesource.com/927530
Reviewed-by: Weiyong Yao <braveyao@chromium.org>
AR30ToARGB will vectorize if the output is masked
together as an int instead of 4 byte stores.
Performance is 2x faster
Was AR30ToARGB_Opt (1585 ms)
Now AR30ToARGB_Opt (746 ms)
Bug: libyuv:777
Test:LibYUVConvertTest.AR30ToARGB_Opt
Change-Id: Idd47ae599d5d125207bb53e618d6d7e784d4a37c
Reviewed-on: https://chromium-review.googlesource.com/923169
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
BGR variation of 10 bit conversion using swapped U and V
and mirrored matrix to produce AB30 format instead of AR30.
Bug: libyuv:777
Test: LibYUVConvertTest.H010ToAB30_Opt
Change-Id: I96d115a5d1e12138f40cb548871e03aa3ab210eb
Reviewed-on: https://chromium-review.googlesource.com/922284
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
This reverts commit 724dbeba6c2397d99ee30542d80db1ea16d209ee.
Reason for revert: bots remain red after revert.
Original change's description:
> Revert "Fixing libyuv gn check."
>
> This reverts commit b625f7b932fb93b877e603a1addcf613a5a0c3eb.
>
> Reason for revert: ios builds broke shortly after this CL, so trying a revert to get builds back to green.
>
> Original change's description:
> > Fixing libyuv gn check.
> >
> > Starting from [1], GN is able to ensure that the inclusion or headers
> > with relative paths is matched by a GN dependency.
> >
> > This CL fixes the libyuv build graph according to GN.
> >
> > [1] - https://chromium-review.googlesource.com/c/chromium/src/+/827014
> >
> > Bug: webrtc:8850
> > Change-Id: I7e0f9a8bd1ae2d205213dc75bf322be587efd1f5
> > Reviewed-on: https://chromium-review.googlesource.com/903843
> > Reviewed-by: Frank Barchard <fbarchard@chromium.org>
> > Commit-Queue: Frank Barchard <fbarchard@chromium.org>
>
> TBR=fbarchard@chromium.org,mbonadei@chromium.org
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: webrtc:8850
> Change-Id: I8585de252bd83e2c628a37b0a0d5324ed961209e
> Reviewed-on: https://chromium-review.googlesource.com/912178
> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
TBR=fbarchard@chromium.org,mbonadei@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: webrtc:8850
Change-Id: Idfd37e0e20d278b374c57d7e2c5465971aae3a52
Reviewed-on: https://chromium-review.googlesource.com/914529
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This reverts commit b625f7b932fb93b877e603a1addcf613a5a0c3eb.
Reason for revert: ios builds broke shortly after this CL, so trying a revert to get builds back to green.
Original change's description:
> Fixing libyuv gn check.
>
> Starting from [1], GN is able to ensure that the inclusion or headers
> with relative paths is matched by a GN dependency.
>
> This CL fixes the libyuv build graph according to GN.
>
> [1] - https://chromium-review.googlesource.com/c/chromium/src/+/827014
>
> Bug: webrtc:8850
> Change-Id: I7e0f9a8bd1ae2d205213dc75bf322be587efd1f5
> Reviewed-on: https://chromium-review.googlesource.com/903843
> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
TBR=fbarchard@chromium.org,mbonadei@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: webrtc:8850
Change-Id: I8585de252bd83e2c628a37b0a0d5324ed961209e
Reviewed-on: https://chromium-review.googlesource.com/912178
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
This reverts commit 7b9ff4a0355c778f2cf03bdb15029d60a1259061.
Reason for revert: ios build bots are red
Original change's description:
> tidy applied with readability-*
>
> TBR=braveyao@chromium.org
> Bug: libyuv:750
> Test: builds and runs and passes more tidy tests
> Change-Id: I316822f7d13b370b88b92a693912e880b21f92c8
> Reviewed-on: https://chromium-review.googlesource.com/907371
> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
TBR=fbarchard@chromium.org,braveyao@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: libyuv:750
Change-Id: I4a73ffee2b71664c6cb93f38f2b5d70ebd76953e
Reviewed-on: https://chromium-review.googlesource.com/912175
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>