aboutsummaryrefslogtreecommitdiff
path: root/source/cpu_id.cc
AgeCommit message (Collapse)Author
2024-01-10AVX10 cpuid detect addedFrank Barchard
Replace unused popcount feature bit Bug: libyuv:911 Change-Id: Icd88fcc732751d39b0950d5f09a58bc9ac2c4e30 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5179911 Reviewed-by: richard winterton <rrwinterton@gmail.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-10-05AVX-VNNI detectFrank Barchard
- Add kCpuHasAVXVNNI flag - Remove deprecated GFNI detect to make space. Meteor Lake has AVX-VNNI but not AVX512 ~/intelsde/sde -mtl -- blaze-bin/third_party/libyuv/libyuv_test --gunit_filter=*CpuHas doyuv3 Note: Google Test filter = *CpuHas [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from LibYUVBaseTest [ RUN ] LibYUVBaseTest.TestCpuHas Cpu Flags 0x203ff1 Has X86 0x10 Has SSE2 0x20 Has SSSE3 0x40 Has SSE41 0x80 Has SSE42 0x100 Has AVX 0x200 Has AVX2 0x400 Has ERMS 0x800 Has FMA3 0x1000 Has F16C 0x2000 Has AVX512BW 0x0 Has AVX512VL 0x0 Has AVX512VNNI 0x0 Has AVX512VBMI 0x0 Has AVX512VBMI2 0x0 Has AVX512VBITALG 0x0 Has AVX512VPOPCNTDQ 0x0 HAS AVXVNNI 0x200000 Has AVXVNNIINT8 0x0 AVX-VNNI detect - Add kCpuHasAVXVNNI flag - Remove deprecated GFNI detect to make space. https://bugs.chromium.org/p/libyuv/issues/detail?id=967 Meteor Lake has AVX-VNNI but not AVX512 ~/intelsde/sde -mtl -- blaze-bin/third_party/libyuv/libyuv_test --gunit_filter=*CpuHas doyuv3 Note: Google Test filter = *CpuHas [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from LibYUVBaseTest [ RUN ] LibYUVBaseTest.TestCpuHas Cpu Flags 0x203ff1 Has X86 0x10 Has SSE2 0x20 Has SSSE3 0x40 Has SSE41 0x80 Has SSE42 0x100 Has AVX 0x200 Has AVX2 0x400 Has ERMS 0x800 Has FMA3 0x1000 Has F16C 0x2000 Has AVX512BW 0x0 Has AVX512VL 0x0 Has AVX512VNNI 0x0 Has AVX512VBMI 0x0 Has AVX512VBMI2 0x0 Has AVX512VBITALG 0x0 Has AVX512VPOPCNTDQ 0x0 HAS AVXVNNI 0x200000 Has AVXVNNIINT8 0x0 Running on all cpus the following report avx-vnni grep 'AVXVNNI 0x2' */* adl/libyuv64.txt:HAS AVXVNNI 0x200000 gnr/libyuv64.txt:HAS AVXVNNI 0x200000 grr/libyuv64.txt:HAS AVXVNNI 0x200000 mtl/libyuv64.txt:HAS AVXVNNI 0x200000 rpl/libyuv64.txt:HAS AVXVNNI 0x200000 spr/libyuv64.txt:HAS AVXVNNI 0x200000 srf/libyuv64.txt:HAS AVXVNNI 0x200000 while these support avx512 vnni grep 'VNNI 0x1' */* clx/libyuv64.txt:Has AVX512VNNI 0x10000 cpx/libyuv64.txt:Has AVX512VNNI 0x10000 gnr/libyuv64.txt:Has AVX512VNNI 0x10000 icl/libyuv64.txt:Has AVX512VNNI 0x10000 icx/libyuv64.txt:Has AVX512VNNI 0x10000 spr/libyuv64.txt:Has AVX512VNNI 0x10000 tgl/libyuv64.txt:Has AVX512VNNI 0x10000 and these support avx-vnni-int8 grep AVXVNNIINT8.0x4 */* grr/libyuv64.txt:Has AVXVNNIINT8 0x400000 srf/libyuv64.txt:Has AVXVNNIINT8 0x400000 Bug: libyuv:967 Change-Id: I84cd71d1b320e7c284173eb695fc1d3b72d14ddb Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4912017 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: richard winterton <rrwinterton@gmail.com>
2023-10-04VNNI-INT8 detectFrank Barchard
- Add kCpuHasAVXVNNIINT8 flag - Move mips flags up a bit to make space. ~/intelsde/sde -srf -- blaze-bin/third_party/libyuv/libyuv_test --gunit_filter=*CpuHas Note: Google Test filter = *CpuHas [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from LibYUVBaseTest [ RUN ] LibYUVBaseTest.TestCpuHas Cpu Flags 0x403ff1 Has X86 0x10 Has SSE2 0x20 Has SSSE3 0x40 Has SSE41 0x80 Has SSE42 0x100 Has AVX 0x200 Has AVX2 0x400 Has ERMS 0x800 Has FMA3 0x1000 Has F16C 0x2000 Has AVX512BW 0x0 Has AVX512VL 0x0 Has AVX512VNNI 0x0 Has AVX512VBMI 0x0 Has AVX512VBMI2 0x0 Has AVX512VBITALG 0x0 Has AVX512VPOPCNTDQ 0x0 Has AVXVNNIINT8 0x400000 Has GFNI 0x0 [ OK ] LibYUVBaseTest.TestCpuHas (32 ms) INT8 supported on srf and grr -srf Set chip-check and CPUID for Intel(R) Sierra Forest CPU -grr Set chip-check and CPUID for Intel(R) Grand Ridge CPU Bug: b/303434603 Change-Id: I628007929ff0518b2b36e1469b4d9aed71a9fa8f Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4912015 Reviewed-by: richard winterton <rrwinterton@gmail.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-05-04Fix TestLinuxRVV test failBruce Lai
Fail log: [ RUN ] LibYUVBaseTest.TestLinuxRVV Note: testing to load "../../unit_test/testdata/riscv64.txt" /scratch/brucel/libyuv/src/unit_test/cpu_test.cc:290: Failure Expected equality of these values: kCpuHasRVV | kCpuHasRVVZVFH Which is: 1610612736 RiscvCpuCaps("../../unit_test/testdata/riscv64_rvv_zvfh.txt") Which is: 536870912 [ FAILED ] LibYUVBaseTest.TestLinuxRVV (17 ms) Reason: The root cause is "\n" may be contained in the ext variable. The last of extension substring contains "\n". For instance, test case riscv64_rvv_zvfh.txt, the last substring is "zvfh\n" instead of "zvfh". Solved this failure by removing "\n" which is at the end of line. NOTE: We avoid using strstr() to solve the problem here. Becasue using strstr() will violate the parsing rule, if future extension contains "zvfh"(e.g zvfhxxx). Log after modification: [ RUN ] LibYUVBaseTest.TestLinuxRVV Note: testing to load "../../unit_test/testdata/riscv64.txt" [ OK ] LibYUVBaseTest.TestLinuxRVV (38 ms) Change-Id: I7b7db98dbc5388cbc148423da6892b8f0be64599 Signed-off-by: Bruce Lai <bruce.lai@sifive.com> Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4498101 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-04-27cpuid for arm/mips/riscv initialize bufferFrank Barchard
- change cpu printf to hex to better show flags util/cpuid: Cpu Flags 0x30000001 Has RISCV 0x10000000 Has RVV 0x20000000 [ RUN ] LibYUVBaseTest.TestCpuHas Cpu Flags 0x30000001 Has RISCV 0x10000000 Has RVV 0x20000000 Has RVVZVFH 0x0 [ OK ] LibYUVBaseTest.TestCpuHas (1 ms) [ RUN ] LibYUVBaseTest.TestCompilerMacros __ATOMIC_RELAXED 0 __cplusplus 201703 __clang_major__ 9999 __clang_minor__ 0 __GNUC__ 4 __GNUC_MINOR__ 2 __riscv 1 __riscv_vector 1 __clang__ 1 __llvm__ 1 __pic__ 2 INT_TYPES_DEFINED __has_feature Bug: libyuv:956 Change-Id: Iee4f1f34799434390e756de1e6c2c4596d82ace5 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4484957 Reviewed-by: Wan-Teh Chang <wtc@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-04-18Enable RVV if qemu is detectedFrank Barchard
- include a fix for jpeg unittests to do at least 1 iteration - include a fix for scale uv to only use linearup2 if filter is linear Tested on qemu with Intel host: [ RUN ] LibYUVBaseTest.TestCpuHas Cpu Flags 805306369 Has RISCV 268435456 Has RVV 536870912 Has RVVZVFH 0 Has X86 0 Bug: libyuv:956, libyuv:959, libyuv:960 Change-Id: I4a1b66f83d82ba127780f52526153d586db90111 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4429570 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Randall Bosetti <rlb@google.com>
2023-04-12UVScale down by 2 fix for C and optimize for NEONFrank Barchard
- update cpu_id to use "re" for fopen to avoid leaking handles if a thread is started while the file is open. Bug: libyuv:958 Change-Id: I1af9de68fce12e440e1226fc8070634ccb1bf090 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4417176 Reviewed-by: Wan-Teh Chang <wtc@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-04-06Add riscv cpu info detection.Darren Hsieh
* Supports: * The standard single-letter Vector detection. * Vector fp16 detection. Signed-off-by: Darren Hsieh <darren.hsieh@sifive.com> Change-Id: Ia7ee1bd8ec1a990f1b2b1700805942e99c0aa87b Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4401738 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2022-10-03Use `find_package(JPEG)` in place of `include(FindJPEG)`Jeremy Maitin-Shepard
The former allows the package to be overridden with a local build by `FetchContent`. Also includes the fix to _MSC_VER conditions from: https://aomedia.googlesource.com/aom/+/refs/heads/main/third_party/libyuv/README.libaom Change-Id: I666e591becb3efaa7b5b68d27476319a2909b88e Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3933570 Reviewed-by: Wan-Teh Chang <wtc@google.com>
2022-09-16I420ToRGB24MatrixFilter function addedFrank Barchard
- Implemented as 3 steps: Upsample UV to 4:4:4, I444ToARGB, ARGBToRGB24 - Fix some build warnings for missing prototypes. Pixel 4 I420ToRGB24_Opt (743 ms) I420ToRGB24Filter_Opt (1331 ms) Windows with skylake xeon: x86 32 bit I420ToRGB24_Opt (387 ms) I420ToRGB24Filter_Opt (571 ms) x64 64 bit I420ToRGB24_Opt (384 ms) I420ToRGB24Filter_Opt (582 ms) Bug: libyuv:938, libyuv:830 Change-Id: Ie27f70816ec084437014f8a1c630ae011ee2348c Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3900298 Reviewed-by: Wan-Teh Chang <wtc@google.com>
2022-06-09Add I210ToI420Frank Barchard
Bug: libyuv:931, b/228605787, b/233233302, b/233634772, b/234558395, b/234340482 Change-Id: Ib135d0b4ff17665f6a4ab60edb782a7b314219a4 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3696042 Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
2022-06-07Revert "I210ToI420, InterpolatePlane_16, and ScalePlane Vertical-only asan fix"Frank Barchard
This reverts commit 60254a1d846a93a4d7559009004cdd91bcc04d82. Reason for revert: breaks PaintCanvasVideoRendererTest.HighBitDepth Original change's description: > I210ToI420, InterpolatePlane_16, and ScalePlane Vertical-only asan fix > > - Add I210ToI420 to convert 10 bit 4:2:2 YUV to 4:2:0 8 bit > - Add NEON InterpolateRow_16 for fast 10 bit scaling > - When scaling up, set step to interpolate toward height - 1 to avoid buffer overread > - When scaling down, center the 2 rows used for source to achieve filtering. > - CopyPlane check for 0 size and return > > Bug: libyuv:931, b/228605787, b/233233302, b/233634772, b/234558395, b/234340482 > Change-Id: I63e8580710a57812b683c2fe40583ac5a179c4f1 > Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3687552 > Reviewed-by: Mirko Bonadei <mbonadei@chromium.org> > Reviewed-by: richard winterton <rrwinterton@gmail.com> Bug: libyuv:931, b/228605787, b/233233302, b/233634772, b/234558395, b/234340482 Change-Id: Icc05bb340db0e7fe864061fb501d0a861c764116 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3692886 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Mirko Bonadei <mbonadei@chromium.org> Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
2022-06-07I210ToI420, InterpolatePlane_16, and ScalePlane Vertical-only asan fixFrank Barchard
- Add I210ToI420 to convert 10 bit 4:2:2 YUV to 4:2:0 8 bit - Add NEON InterpolateRow_16 for fast 10 bit scaling - When scaling up, set step to interpolate toward height - 1 to avoid buffer overread - When scaling down, center the 2 rows used for source to achieve filtering. - CopyPlane check for 0 size and return Bug: libyuv:931, b/228605787, b/233233302, b/233634772, b/234558395, b/234340482 Change-Id: I63e8580710a57812b683c2fe40583ac5a179c4f1 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3687552 Reviewed-by: Mirko Bonadei <mbonadei@chromium.org> Reviewed-by: richard winterton <rrwinterton@gmail.com>
2022-03-09Optimize functions for LASX in row_lasx.cc.Hao Chen
1. Optimize 18 functions in source/row_lasx.cc file. 2. Make small modifications to LSX. 3. Remove some unnecessary content. Bug: libyuv:912 Change-Id: Ifd1d85366efb9cdb3b99491e30fa450ff1848661 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3507640 Reviewed-by: Mirko Bonadei <mbonadei@chromium.org> Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-01-31DetilePlane and unittest for NEONFrank Barchard
Bug: libyuv:915, b/215425056 Change-Id: Iccab1ed3f6d385f02895d44faa94d198ad79d693 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3424820 Reviewed-by: Justin Green <greenjustin@google.com> Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-01-26Remove MMI supportFrank Barchard
Bug: libyuv:916 Change-Id: I345b7e271ceb4b32fe91e292915e66be40812810 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3415817 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Wan-Teh Chang <wtc@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-01-20Add supports for loongarch LSX and LASX.Hao Chen
1. Add supports for LSX and LASX. 2. Three optimization functions are added in loongarch/row_lasx.cc file: I422ToARGBRow_LASX,I422ToRGBARow_LASX,I422AlphaToARGBRow_LASX. Bug: libyuv:912, Bug: libyuv:913 Change-Id: I043c2704f99a5215724b5c0b7f97e6bf5f7a199b Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3329189 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-01-12VNNI detectFrank Barchard
Bug: libyuv:911 Change-Id: Ic4e7720b4d5c20010470f06a7021d1a2426e765f Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3381495 Reviewed-by: richard winterton <rrwinterton@gmail.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2021-06-10Update Android.bp to always enable NEONFrank Barchard
Relax Cpu unittest to allow ARM emulator to run. Bug: libyuv:863, libyuv:877, b/178283356 Change-Id: I3c751574219fdf731a3f9d4a79934a349acba446 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2950938 Reviewed-by: Wan-Teh Chang <wtc@google.com>
2020-11-03Scale by even factor low level row functionFrank Barchard
Bug: b/171884264 Change-Id: I6a94bde0aa05e681bb4590ea8beec33a61ddbfc9 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2518361 Reviewed-by: richard winterton <rrwinterton@gmail.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2020-04-16Add unittest TestLinuxMipsMsaMmi.Shiyou Yin
This unittest help to test MipsCpuCaps. Change-Id: I9e0ceeed0e5243446eaafa27e8de4c5f8163b09e Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2133314 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2020-04-01Refine function MipsCpuCaps.Frank Barchard
1. Refactored function MipsCpuCaps. 2. allow msa and mmi can be enabled together. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Change-Id: I7330d0551a6a167e4c76d37e4defcc20783f5815 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2131145 Reviewed-by: Hsiu Wang <hsiu@google.com> Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2018-10-03Fix ConvertToI420() for odd crop_yFrank Barchard
The original src_u calculation of FOURCC_I420 shifted half width if crop_y is odd. This CL fixs the problem and also add a test case for it. Bug: b:115278653 Test: pass libyuv_unittest Change-Id: Ia9732d22e64e13de26df47726ba44ad1c5a06484 Reviewed-on: https://chromium-review.googlesource.com/c/1258743 Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2018-07-20libyuv:loongson optimize compare/row/scale/rotate files with mmi.lixia zhang
Currently, libyuv supports MIPS SIMD Arch(MSA), but libyuv does not supports MultiMedia Instruction(MMI)(such as loongson3a platform). In order to improve performance of libyuv on loongson3a platform, this provides optimize 98 functions with mmi. BUG=libyuv:804 Change-Id: I8947626009efad769b3103a867363ece25d79629 Reviewed-on: https://chromium-review.googlesource.com/1122064 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2018-03-26Add a method to force the CPU flagsJay Civelli
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>
2018-03-20cpuid sandbox friendlier avoiding getenv()Frank Barchard
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-10cpu disables for AVX 512 and unittest show decimalFrank Barchard
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>
2018-01-23basic_types.h - remove unused macrosFrank Barchard
Removes macros that were part of standard basic_types header but not used by libyuv itself. TBR=braveyao@chromium.org Bug: libyuv:774 Test: try bots still build Change-Id: I8de6fad5a9277df0a50959881392ba212b1b5972 Reviewed-on: https://chromium-review.googlesource.com/879591 Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2017-12-14Remove Mips DSPR2 codeFrank Barchard
Bug: libyuv:765 Test: build for mips still passes Change-Id: I99105ad3951d2210c0793e3b9241c178442fdc37 Reviewed-on: https://chromium-review.googlesource.com/826404 Reviewed-by: Weiyong Yao <braveyao@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2017-11-09casting for c89 compatibility and lint cleanupFrank Barchard
Bug: libyuv:756 Test: CFLAGS="-m32 -static -std=gnu89 -mno-sse -O2" CXXFLAGS="-m32 -x c -static -std=gnu99 -mno-sse -O2" make -f linux.mk libyuv.a Change-Id: Ic362f93e01ccbb0bea14f361a58585e79297e7d2 Reviewed-on: https://chromium-review.googlesource.com/759423 Reviewed-by: Frank Barchard <fbarchard@google.com> Reviewed-by: Patrik Höglund <phoglund@chromium.org> Commit-Queue: Frank Barchard <fbarchard@google.com>
2017-11-07AVX512 feature detects for cnl and iclFrank Barchard
Key instruction sets added for each microarchitecture: AVX512BW, AVX512VL, AVX512DQ - skylake server or later AVX512_VBMI, AVX512_IFMA - cannon lake or later AVX512_BITALG, AVX512_VBMI2, AVX512_VPOPCNTDQ, AVX512_VNNI, GFNI, VAES, VPCLMULQDQ - ice lake or later Bug: libyuv:752 Test: ~/intelsde/sde -icl -- out/Release/libyuv_unittest --gtest_filter=*Cpu* Change-Id: I9ee28904c90009d66721b9f805a440c5fc2da122 Reviewed-on: https://chromium-review.googlesource.com/755617 Reviewed-by: Frank Barchard <fbarchard@google.com> Reviewed-by: richard winterton <rrwinterton@gmail.com>
2017-09-19Step thru full color test by increments of 5 for better test speed.Frank Barchard
Full color test is the slowest of the unittests, and not catching any additional bugs at the moment. Step thru range of 0 to 255 in steps of 5 to speed up the test. 255 is 3 * 5 * 17, so any of those primes would hit 0 and 255 exactly. Was LibYUVColorTest.TestFullYUV (896 ms) Now LibYUVColorTest.TestFullYUV (212 ms) TBR=kjellander@chromium.org Bug: libyuv:736 Test: LibYUVColorTest.TestFullYUV Change-Id: I5b55fb07ada0dc7bdc3c3c20569d36bf09bb3804 Reviewed-on: https://chromium-review.googlesource.com/672064 Commit-Queue: Frank Barchard <fbarchard@google.com> Reviewed-by: Frank Barchard <fbarchard@google.com>
2017-09-15Cast xgetbv from int64 to int to avoid Visual C warning.Frank Barchard
TBR=kjellander@chromium.org Bug: libyuv:735 Test: try bots Change-Id: I00dc06689cd0a23847865c0c8edeb538b0cc81ac Reviewed-on: https://chromium-review.googlesource.com/669142 Reviewed-by: Frank Barchard <fbarchard@google.com>
2017-05-25lint warning fixes for CpuIDFrank Barchard
The CpuId function is a wrapper for the intrinsic, or implemented with inline if unavailable. It had been using uint32, but the intrinsics use int, so it was causing casting and lint warnings. This change makes the internal implementation use int. Casting was also done for xgetbv, and the cast is simply removed, and is not causing a build error. MipCpuCaps was doing strlen to check for white space after the instruction set. Arm also does this but with a hard coded offset. This was causing a cast from size_t to int, which produced a lint warning. The change removes the white space detect. In theory the code could be used to detect SSE vs SSE2, and it would need to check SSE is followed by a space or end of line. But this code is only used on Arm and Mips, where there there is one form of SIMD detected. e.g. MSA for mips. If a new instruction set is added with a similar name, the write space check could be reintroduced. But its more likely the code can be rewritten to use a better form of detection by then. Or remove detection and require the instructions BUG=libyuv:641 TEST=try bots build on all platforms without error and lint is clean Change-Id: I9f55f8e57bba0f78571bdddbe63b945dea3e8809 Reviewed-on: https://chromium-review.googlesource.com/514524 Commit-Queue: Frank Barchard <fbarchard@google.com> Reviewed-by: Cheng Wang <wangcheng@google.com> Reviewed-by: Wan-Teh Chang <wtc@chromium.org>
2017-05-24MaskCpuFlags return cpuinfo so InitCpuFlags can call itFrank Barchard
Reduce number of atomic references to cpu_info by making InitCpuFlags call MaskCpuFlags and return the same value. BUG=libyuv:641 TEST=libyuv_unittests pass Change-Id: I5dfff8f7a10671bc8ef3ec0ed6f302791e752faa Reviewed-on: https://chromium-review.googlesource.com/514145 Commit-Queue: Frank Barchard <fbarchard@google.com> Reviewed-by: Cheng Wang <wangcheng@google.com>
2017-05-24Fix data races in libyuv::TestCpuFlag().Frank Barchard
Detect the compiler's support of C11 atomics, and use C11 atomics when available. Note that libyuv::MaskCpuFlags() is still not thread-safe. BUG=libyuv:641 TEST= cpu_thread_test.cc adds a pthread based test R=wangcheng@google.com Change-Id: If05b1e16da833105a0159ed67ef20f4e61bc7abd Reviewed-on: https://chromium-review.googlesource.com/510079 Commit-Queue: Frank Barchard <fbarchard@google.com> Reviewed-by: Cheng Wang <wangcheng@google.com>
2017-03-01Fix missing return in MipsCpuCaps.Frank Barchard
Previously if MipsCpuCaps were called with something other than dspr2 or msa, the file was closed but still used. This change assumed the function is only called internally twice: once for msa and once for dspr2. If msa is not being detected, the function assumed dspr2 was being tested and returns dspr2 was true. BUG=libyuv:687 TEST=try bots Change-Id: I80b328eb5ffc7baf5f1ee5a79c16d75c45ff26cc Reviewed-on: https://chromium-review.googlesource.com/447831 Reviewed-by: Frank Barchard <fbarchard@google.com> Commit-Queue: Frank Barchard <fbarchard@google.com>
2017-02-14enable unused parameter warningFrank Barchard
android.mk builds have unused parameter warning on by default. This change for GN makes libyuv build the same way. BUG=libyuv:681 TEST=build on linux with clang and ninja. Change-Id: I76c627d446b96653f147725bca915d94a42ce9a6 Reviewed-on: https://chromium-review.googlesource.com/441194 Reviewed-by: Frank Barchard <fbarchard@google.com> Commit-Queue: Frank Barchard <fbarchard@google.com>
2016-11-07clang-format libyuvFrank Barchard
BUG=libyuv:654 R=kjellander@chromium.org Review URL: https://codereview.chromium.org/2469353005 .
2016-10-18cpu_id cleanup. no functional change.Frank Barchard
remove old comment about initialize to zero. remove ifdef and replace with macro defined to zero. BUG=None TEST=try bots R=kjellander@chromium.org Review URL: https://codereview.chromium.org/2425623004 .
2016-10-14Add f16c (halffloat) cpuidFrank Barchard
R=wangcheng@google.com, hubbe@chromium.org BUG=libyuv:560 Review URL: https://codereview.chromium.org/2418763006 .
2016-09-22fix warning on visual C for mips cpu detectFrank Barchard
follow up warning fixs cpu_id.cc(167): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data lint warning: cpu_id.cc:171: Missing space before ( in if( [whitespace/parens] [5] TBR=manojkumar.bhosale@imgtec.com BUG=libyuv:634 TEST=try bots for windows. Review URL: https://codereview.chromium.org/2365813002 .
2016-09-22Add MIPS SIMD Arch (MSA) optimized MirrorRow functionFrank Barchard
As per the preparation patch added in Chromium sources at, 2150943003: Add MIPS SIMD Arch (MSA) build flags for GYP/GN builds This patch adds first MSA optimized function in libYUV project. BUG=libyuv:634 R=fbarchard@google.com Review URL: https://codereview.chromium.org/2285683002 .
2016-04-01add if defined(_MSC_FULL_VER) for NaCLFrank Barchard
TBR=kjellander@chromium.org BUG=libyuv:573 TESTED=try bots Review URL: https://codereview.chromium.org/1850053002 .
2016-03-10Remove most clang-cl special cases from cpu_id.ccFrank Barchard
They are not needed, and due to them there was a call to _xgetbv() without a declaration of the function. This used to work because we implicitly included intrin.h in all translation units with clang-cl, but we want to stop doing that. BUG=chromium:592745 R=fbarchard@google.com Review URL: https://codereview.chromium.org/1780473003 .
2016-02-05rename MIPS_DSPR2 to DSPR2 for consistencyFrank Barchard
When attempting to normalize function names to end in Row_SIMD it was made harder with MIPS_DSPR2 naming convention. Other CPUs do not include the vendor. This should be named consistently. Removed the DISABLE_MIPS in favour of DISABLE_ASM for consistency with other processors. TBR=harryjin@google.com BUG=libyuv:562 Review URL: https://codereview.chromium.org/1677633002 .
2015-12-08fix for gcc compile error: variable duplicate defineFrank Barchard
TBR=harryjin@google.com BUG=libyuv:529 Review URL: https://codereview.chromium.org/1512793002 .
2015-12-08Optimize yuv alpha blend AVX2 code to do 32 pixels at time.Frank Barchard
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-08Work around bug in xgetbv for Visual Studio.Frank Barchard
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-11-03remove mips dsp detectFrank Barchard
DSP code is not actually used, only DSPR2. Remove the detect. TBR=harryjin@google.com BUG=none Review URL: https://codereview.chromium.org/1405043008 .