aboutsummaryrefslogtreecommitdiff
path: root/unit_test
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-12-11Add cpuid target to CMakeList.txtFrank Barchard
Reduce convert_test to just Opt on RISC-V cmake -B out/Release/ -DCMAKE_BUILD_TYPE=Release . cmake --build out/Release/ -t cpuid ./out/Release/cpuid Cpu Flags 0x30000001 Has RISCV 0x10000000 Has RVV 0x20000000 Bug: libyuv:956 Change-Id: I3cca40361af85d983e52465660c0b4d205cd82a5 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5110826 Reviewed-by: Mirko Bonadei <mbonadei@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-12-09Split scale_test and scale_plane_test to allow building on small devicesFrank Barchard
Bug: libyuv:956 Change-Id: I1903aa616243e891440ed92836dfb0992d31d4cd Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5107257 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Wan-Teh Chang <wtc@google.com>
2023-12-08Split convert_test and convert_argb_test to allow building on small systems ↵Frank Barchard
that run out of memory compiling unittests. Update build files to include the new tests and source code. Bug: libyuv:956 Change-Id: I6ec0beb6dc9570f0597d7df1835d616489dbaece Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5103585 Reviewed-by: Mirko Bonadei <mbonadei@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-11-18Fix print of a GG_LONGLONG value.Mirko Bonadei
Bug: None Change-Id: I209a10c9020acc6e7e4f3835e19795413e28603a Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5040781 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: 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-08-02cpu_test show __riscv_v_intrinsic quals to 11000 (v0.11) or 1000000 (v1.0).Frank Barchard
Bug: libyuv:965 Change-Id: Ic983cc036b0b628a82dd2f4bb5eb649af4bfaa08 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4739822 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
2023-06-30Fix warnings for missing prototypesFrank Barchard
- Add static to internal scale and rotate functions - Remove unittest that tested an internal scale function - Remove unused private functions - Include missing scale_argb.h header - Bump version and apply clang format Bug: libyuv:830 Change-Id: I45bab0423b86334f9707f935aedd0c6efc442dd4 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4658956 Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
2023-06-16ARGBAttenuate use (a + b + 255) >> 8Frank Barchard
- Makes ARM and Intel match and fixes some off by 1 cases - Add ARGBToUV444MatrixRow_NEON - Add ConvertFP16ToFP32Column_NEON - scale_rvv fix intinsic build error - disable row_win version of ARGBAttenuate/Unattenuate Bug: libyuv:936, libyuv:956 Change-Id: Ied99aaad3a11a8eb69212b628c58f86ec0723c38 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4617013 Reviewed-by: Wan-Teh Chang <wtc@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-06-15[RVV] Enable ARGBExtractAlphaRow/ARGBCopyYToAlphaRowBruce Lai
* Run on SiFive internal FPGA: TestARGBExtractAlpha(~3.2x vs scalar) TestARGBCopyYToAlpha(~1.6x vs scalar) Change-Id: I36525c67e8ac3f71ea9d1a58c7dc15a4009d9da1 Signed-off-by: Bruce Lai <bruce.lai@sifive.com> Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4617955 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2023-06-07FP16 to FP32 float conversion row functionFrank Barchard
Bug: None Change-Id: I97aab6aafd41c3bf36bfbf33fdcc424e5b3fd6e3 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4590225 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Wan-Teh Chang <wtc@google.com>
2023-06-02Add macro for I012ToAB30MatrixVignesh Venkatasubramanian
Uses I012ToAR30Matrix with u and v swapped and with VU suffixed constants. Bug: b/268505204 Change-Id: If0d189891be3053da776feb48d49fa68a9866037 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4581869 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-06-01Add I412/I212 to I420 functionsVignesh Venkatasubramanian
They re-use the same method as I410/I210 to I420 with a depth value of 12 instead of 10. Bug: b/268505204 Change-Id: I299862b4556461d8c95f0fc1dcd5260e1c1f25cd Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4581867 Commit-Queue: Vignesh Venkatasubramanian <vigneshv@google.com> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2023-05-17ARGBToI420Alpha function to convert ARGB to I420 with AlphaFrank Barchard
Bug: b/281866362 Change-Id: Ic1093a887fb483f134c78909cf1ee7495e7345ba Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4534100 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Wan-Teh Chang <wtc@google.com>
2023-05-11Bump version and apply clang formatFrank Barchard
Bug: libyuv:956 Change-Id: I2375a02583789af2a5f13f8dba6c663d5975aaa9 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4522352 Reviewed-by: Mirko Bonadei <mbonadei@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>
2023-03-03Transpose 4x4 for SSE2 and AVX2Frank Barchard
Skylake Xeon AVX2 Transpose4x4_Opt (290 ms) SSE2 Transpose4x4_Opt (302 ms) C Transpose4x4_Opt (522 ms) AMD Zen2 AVX2 Transpose4x4_Opt (136 ms) SSE2 Transpose4x4_Opt (137 ms) C Transpose4x4_Opt (431 ms) Bug: None Change-Id: I4997dbd5c5387c22bfd6c5960b421504e4bc8a2a Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4292946 Reviewed-by: Justin Green <greenjustin@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-02-22MergeUV AVX512BW use assemblyFrank Barchard
- Convert MergeUVRow_AVX512BW to assembly - Enable MergeUVRow_AVX512BW for Windows with clangcl - MergeUVRow_AVX2 use vpmovzxbw and vpsllw - MergeUVRow_16_AVX2 use vpmovzxbw and vpsllw with different shift for U and V AMD Zen 4 640x360 100000 iterations Was AVX512 MergeUVPlane_Opt (884 ms) AVX2 MergeUVPlane_Opt (945 ms) AVX2 MergeUVPlane_16_Opt (2167 ms) Now AVX512 MergeUVPlane_Opt (865 ms) AVX2 MergeUVPlane_Opt (943 ms) SSE2 MergeUVPlane_Opt (973 ms) AVX2 MergeUVPlane_16_Opt (2102 ms) Bug: None Change-Id: I658ada2a75d44c3f93be8bd3ed96f83d5fa2ab8d Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4271230 Reviewed-by: Fritz Koenig <frkoenig@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: richard winterton <rrwinterton@gmail.com>
2023-02-13MergeUV_AVX512BW for I420ToNV12Frank Barchard
On Skylake Xeon 640x360 100000 iterations AVX512 MergeUVPlane_Opt (1196 ms) AVX2 MergeUVPlane_Opt (1565 ms) SSE2 MergeUVPlane_Opt (1780 ms) Pixel 7 MergeUVPlane_Opt (1177 ms) Bug: None Change-Id: If47d4fa957cf27781bba5fd6a2f0bf554101a5c6 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4242247 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: richard winterton <rrwinterton@gmail.com>
2023-01-13P010ToI010 and P012ToI012 conversion functionsFrank Barchard
- Convert 10 and 12 bit biplanar formats to planar. - Shift 10 MSB to 10 LSB - P010 is similar to NV12 in layout, but uses 10 MSB of 16 bit values. - I010 is similar to I420 in layout, but uses 10 LSB of 16 bit values. Bug: libyuv:951 Change-Id: I16a1bc64239d0fa4f41810910da448bf5720935f Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4166560 Reviewed-by: Justin Green <greenjustin@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-01-04I422Rotate take stride for temporary buffersFrank Barchard
- Minor variable name changes first/last to top/bottom - Comments explaining rotate temporary buffers usage - Add asserts for scale parameter - Use NULL and stddef.h instead of 0 - Use void * for allocation in row.h - Add () around size parameter in macros Bug: libyuv:926, libyuv:949 Change-Id: Ib55417570926ccada0a0f8abd1753dc12e5b162e Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4136762 Reviewed-by: Wan-Teh Chang <wtc@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-01-04Add 10 bit rotate methods.Sergio Garcia Murillo
This initial implementation is based on current unoptimized code in webrtc using just plain for loops. Bug: libyuv:949 Change-Id: Ic87ee49c3a0b62edbaaa4255c263c1f7be4ea02b Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4110782 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-01-03Add I410Copy and I410ToI420 methodsSergio Garcia Murillo
The I410To420 implementation does a two step approach for scaling down and 10-to-8 bit conversion using the Y plane as temporal storage. Bug: libyuv:950 Change-Id: I3d35fad4b99e17253230456233fbd947e013c0ec Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4110783 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2022-12-15Casting for scale functionsFrank Barchard
- MT2T support for source strides added, but only works for positive values. - Reduced casting in row_common - one cast per assignment. - scaling functions use intptr_t for intermediate calculations, then cast strides to ptrdiff_t Bug: libyuv:948, b/257266635, b/262468594 Change-Id: I0409a0ce916b777da2a01c0ab0b56dccefed3b33 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4102203 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Wan-Teh Chang <wtc@google.com> Reviewed-by: Justin Green <greenjustin@google.com> Reviewed-by: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Ernest Hua <ernesthua@google.com>
2022-12-06MT2T Warning fixes for fuchsiaFrank Barchard
Bug: b/258474032, b/257266635 Change-Id: Ic5cbbc60e2e1463361e359a2fe3e97976c1ea929 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4081348 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Justin Green <greenjustin@google.com>
2022-11-17Add Detile_16 planar function for 10 bit MT2T formatFrank Barchard
- Neon and SSE2 - Any for odd widths Pixel 2 little core AArch32 build C TestDetilePlane_16 (1275 ms) TestDetilePlane (1203 ms) Neon TestDetilePlane_16 (693 ms) TestDetilePlane (660 ms) Bug: b/258474032 Change-Id: Idbd09c5e9324e4deef5f1d54090d4b63cc7db812 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4031848 Reviewed-by: Wan-Teh Chang <wtc@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-09-30YUY2ToNV12 using YUY2ToY and YUY2ToNVUVFrank Barchard
- Optimized YUY2ToNV12 that reduces it from 3 steps to 2 steps - Was SplitUV, memcpy Y, InterpolateUV - Now YUY2ToY, YUY2ToNVUV - rollback LIBYUV_UNLIMITED_DATA 3840x2160 1000 iterations: Pixel 2 Cortex A73 Was YUY2ToNV12_Opt (6515 ms) Now YUY2ToNV12_Opt (3350 ms) AB7 Mediatek P35 Cortex A53 Was YUY2ToNV12_Opt (6435 ms) Now YUY2ToNV12_Opt (3301 ms) Skylake AVX2 x64 Was YUY2ToNV12_Opt (1872 ms) Now YUY2ToNV12_Opt (1657 ms) SSE2 x64 Was YUY2ToNV12_Opt (2008 ms) Now YUY2ToNV12_Opt (1691 ms) Windows Skylake AVX2 32 bit x86 Was YUY2ToNV12_Opt (2161 ms) Now YUY2ToNV12_Opt (1628 ms) Bug: libyuv:943 Change-Id: I6c2ba2ae765413426baf770b837de114f808f6d0 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3929843 Reviewed-by: Wan-Teh Chang <wtc@google.com> Reviewed-by: richard winterton <rrwinterton@gmail.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-09-23Enable unlimited data for YUV to RGBFrank Barchard
- Provide LIBYUV_LIMITED_DATA macro for backwards compatiblity Bug: b/474156256 Change-Id: I5d5d7fb640d51ae3c5ad363f2a28c8bfbd3048a5 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3912081 Reviewed-by: Wan-Teh Chang <wtc@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-09-20I422ToRGB24, I422ToRAW, I422ToRGB24MatrixFilter conversion functions added.Frank Barchard
- YUV to RGB use linear for first and last row. - add assert(yuvconstants) - rename pointers to match row functions. - use macros that match row functions. - use 12 bit upsampler for conversions of 10 and 12 bits Cortex A53 AArch32 I420ToRGB24_Opt (3627 ms) I422ToRGB24_Opt (4099 ms) I444ToRGB24_Opt (4186 ms) I420ToRGB24Filter_Opt (5451 ms) I422ToRGB24Filter_Opt (5430 ms) AVX2 Was I420ToRGB24Filter_Opt (583 ms) Now I420ToRGB24Filter_Opt (560 ms) Neon Cortex A7 Was I420ToRGB24Filter_Opt (5447 ms) Now I420ToRGB24Filter_Opt (5439 ms) Bug: libyuv:938 Change-Id: I1731f2dd591073ae11a756f06574103ba0f803c7 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3906082 Reviewed-by: Justin Green <greenjustin@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-09-19Remove include resource.h for Fuchsia buildFrank Barchard
Bug: None Change-Id: I3e0748d3aebdc8bc1ff8ddfc79d9cdb751c03e0f Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3906081 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Justin Green <greenjustin@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-08-16MM21ToYUY2 and ABGRToJ420 conversionFrank Barchard
MM21 to YUY2 use zip1 for performance Cortex A510 Was MM21ToYUY2 (612 ms) Now MM21ToYUY2 (573 ms) Prefetches help Cortex A53 Was MM21ToYUY2 (4998 ms) Now MM21ToYUY2 (1900 ms) Pixel 4 Cortex A76 Was MM21ToYUY2 (215 ms) Now MM21ToYUY2 (173 ms) ABGRToJ420 - NEON, SSSE3 and AVX2 row functions - J400, J420 and J422 formats. - Added AVX2 for UV on ARGBToJ420. Was SSSE3 Same code/performance as ARGBToJ420 but with constants re-ordered. Pixel 4 ABGRToJ420_Opt (623 ms) ABGRToJ422_Opt (702 ms) ABGRToJ400_Opt (238 ms) Skylake Xeon With LIBYUV_BIT_EXACT which uses C for UV ABGRToJ420_Opt (988 ms) ABGRToJ422_Opt (1872 ms) ABGRToJ400_Opt (186 ms) Skylake Xeon using AVX2 ABGRToJ420_Opt (251 ms) ABGRToJ422_Opt (245 ms) ABGRToJ400_Opt (184 ms) Skylake Xeon using SSSE3 ABGRToJ420_Opt (328 ms) ABGRToJ422_Opt (362 ms) ABGRToJ400_Opt (185 ms) Bug: b/238137982 Change-Id: I559c3fe3fb80fa2ce5be3d8218736f9cbc627666 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3832111 Reviewed-by: Justin Green <greenjustin@google.com> Reviewed-by: Wan-Teh Chang <wtc@google.com> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2022-08-12AB64ToARGB fix for inplace conversionFrank Barchard
- add tests for all single plane formats that reduce or stay same in size Bug: b/242233673 Change-Id: Ic25d808114f11995ac56ea9c31b99f66ba36d345 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3828485 Reviewed-by: Wan-Teh Chang <wtc@google.com>
2022-08-01Disable bilinear 16 bit scale up for SSE2Frank Barchard
- Undefine HAS_SCALEROWUP2_BILINEAR_16_SSE2 - Save XMM7 in ScaleRowUp2_Bilinear_16_SSE2(). - Rename HAS_SCALEROWUP2LINEAR_xxx to HAS_SCALEROWUP2_LINEAR_xxx - DetileSplitUVRow_C() is implemented using SplitUVRow_C(). - Changes to unit_test/planar_test.cc. Bug: libyuv:882 Change-Id: I0a8e8e5fb43bdf58ded87244e802343eacb789f2 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3795063 Reviewed-by: Wan-Teh Chang <wtc@google.com>
2022-07-13Enable 256x144 scale tests for libyuvFrank Barchard
- This test used to fail on ARM, but is passing now, so re-enable - Kept behind a flag so it can be disabled with /DDISABLE_SLOW_TESTS Bug: libyuv:905, b/197551385 Change-Id: Iff3c75c1778610c136621b595adee4b1004df9a5 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3758943 Reviewed-by: Mirko Bonadei <mbonadei@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-06-22Bilinear scale up msan fixFrank Barchard
- Avoid stepping to height + 1 for bilinear filter 2nd row for last row of source - Box filter ubsan fix for 3/4 and 3/8 scaling for 16 bit planar - Height 1 asan fixes Bug: libyuv:935, b/206716399 Change-Id: I56088520f2a884a37b987ee5265def175047673e Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3717263 Reviewed-by: Wan-Teh Chang <wtc@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
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-06-07Update CopyPlane to handle 0 width and height dimensionsJoe Downing
If a width, height, and src/dst strides passed in are all 0, height is updated to 1 which means some CPU optimized functions may try to copy data when the dst rect is not valid. Bug: b:234340482 Change-Id: I63be1c6ba05d669d67f5079d812acbec09c8f6c9 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3689909 Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2022-05-24Add UYVYToY functionFrank Barchard
This function reads 2 byte values and writes the 2nd byte to the destination. It turns out this is useful for P010ToNV12 as well, so adding the planar function allows a high level to call this. And adds UYVY support for something YUY2 already had. Which is writing the 1st byte. Bug: b/233233302, b/233634772 Change-Id: I10a9454cb4f5b2c4ac5532fa86feddf78284d8b8 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3659055 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: richard winterton <rrwinterton@gmail.com> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2022-04-27MergeUV test fix - depth is 16 (bits)Frank Barchard
Bug: b/230550621 Change-Id: Ie36d3b8bdadb4300d54611798a4dfd488c30ca8d Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3609691 Reviewed-by: Mirko Bonadei <mbonadei@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-04-12Reduce RGBScale benchmark to 4 tests when --copt=-DDISABLE_SLOW_TESTS is ↵Frank Barchard
specified Was [----------] 59 tests from LibYUVScaleTest (223179 ms total) Now [----------] 13 tests from LibYUVScaleTest (15926 ms total) Bug: b/224814071, b/228518489 Change-Id: Ifcb9c86793e94f32fd7cd2dd112dc3e6df77e283 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3583609 Reviewed-by: Mirko Bonadei <mbonadei@chromium.org> Reviewed-by: richard winterton <rrwinterton@gmail.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-04-07I422Rotate update to remove name space for ios build warningFrank Barchard
- Remove libyuv:: from within libyuv to resolve a build warning on IOS. - Check src_y parameter is not NULL if there is a dst_y parameter - Apply clang-format - Bump version Performance on Intel Skylake Xeon ARGBRotate90_Opt (795 ms) I420Rotate90_Opt (283 ms) I422Rotate90_Opt (867 ms) <-- scales and rotates I444Rotate90_Opt (565 ms) NV12Rotate90_Opt (289 ms) Performance on Pixel 4 (Cortex A76) ARGBRotate90_Opt (4208 ms) I420Rotate90_Opt (273 ms) I422Rotate90_Opt (1207 ms) I444Rotate90_Opt (718 ms) NV12Rotate90_Opt (282 ms) Bug: libyuv:926 Change-Id: I42e1b93a9595f6ed075918e91bed977dd3d23f6f Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3576778 Reviewed-by: Mirko Bonadei <mbonadei@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-04-06Add tentative I422Rotate.Sergio Garcia Murillo
When doing 90 or 270 degrees rotation we need to do a rotate&scale of the UV planes, as there are no helper optimized functions to do this, we use the Y plane as temporal memory and perform each of the transforms independently: First U plane is rotated, putting the result in the Y plane. After the rotation, the output has double the samples horizontally and half the samples vertically, so it is scaled into the final U plane. Same process is done with the V plane. Last the Y plane that can be just rotated without scaling. It would be great to have an optimized version for this, but maybe this is helpfull for triggering the discussions. Bug: libyuv:926 Change-Id: I188af103c4d0e3f9522021b4bf2b63c9d5de8b93 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3568424 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-03-19RGBScale function using 3 steps: RGB24ToARGB, ARGBScale, ARGBToRGB24Frank Barchard
1920x1080 to/from 1280x720 to ARGB on Intel Skylake Xeon RGBScaleTo1920x1080_Bilinear (2625 ms) RGBScaleFrom1920x1080_Bilinear (2115 ms) ARGBScaleTo1920x1080_Bilinear (1668 ms) ARGBScaleFrom1920x1080_Bilinear (1164 ms) Bug: b/224814071 Change-Id: Ifc7611b597409771728b13c9c39e5a7e06131021 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3537341 Reviewed-by: Wan-Teh Chang <wtc@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>