40 Commits

Author SHA1 Message Date
Mark Zhuang
fb7b9a4df4 Fix typo, remove mips as title already contain mips
Change-Id: I884f2f3ba937ec71fa070373e5c32977d35e7e75
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6267779
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
2025-04-15 14:02:28 -07:00
Chunbo Hua
e434b8c5ae Fix build script instructions for Windows
Bug: 359296629
Change-Id: I118650a89d3e3c9500b592f3f62f058e378f514e
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5785268
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2024-08-21 00:05:21 +00:00
Bruce Lai
b76fcd4654 [RISC-V] Support CMake build with custom compiler flags
This CL aims to support custom compiler flags.
Because upstream clang has supported to build for x280 with -mcpu=sifive-x280.

Change-Id: Ic8fbf026fe6805ac5c3422a9ccc3f53293c89570
Signed-off-by: Bruce Lai <bruce.lai@sifive.com>
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4713191
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-07-25 09:21:59 +00:00
Prashanth Swaminathan
d573f6451d Remove stale Android NDK and fix docs [2/2]
Now that chromium/base has rolled and switched the android_ndk_root to
the new android_toolchain directory, remove the stale Android NDK. Fix
up documentation that refers to stale paths and suggest the appropriate
tools to perform objdump operations.

Bug: 1448383
Test: Verified build of LibYUV.
Change-Id: I7b674052b1ef0914cf4ee81c6c6d62410e5fc569
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4583622
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Prashanth Swaminathan <prashanthsw@google.com>
2023-06-07 21:39:59 +00:00
Bruce Lai
f4bd840794 Fix compile error for riscv scalar & simplify cmake cross build flow
1. Fix compile error when build riscv without using vector

2. Fix run_qemu.sh misused v=true for USE_RVV=OFF case

3. [cmake] Fix warning by rename TEST to UNIT_TEST
Warning log:
CMake Warning (dev) at CMakeLists.txt:57 (if):                                                                                                                                                                                                                  [54/1931]
  Policy CMP0064 is not set: Support new TEST if() operator.  Run "cmake
  --help-policy CMP0064" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  TEST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

4. [cmake] Simplify logic for cross-build

Bug: libyuv:956

Change-Id: I120402fc7d6d86403e7d974180b81f4f9c663e36
Signed-off-by: Bruce Lai <bruce.lai@sifive.com>
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4486239
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-05-04 18:09:00 +00:00
Bruce Lai
aec27be648 Remove out-of-date description for testing RVV on QEMU
Aafter commit in CL: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4429570
We don't need to hack the code for testing RVV on QEMU at all.

Change-Id: Ic123d88b7ccc8dd54768e33cb0db363472be6ffc
Signed-off-by: Bruce Lai <bruce.lai@sifive.com>
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4442914
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-04-19 08:10:41 +00:00
Bruce Lai
646fc1b214 Enable RISC-V cmake build & qemu test
1. Provide script to build qemu & clang locally
2. Enable risc-v cmake build with clang
3. Enable test with qemu
4. Update doc to introduce how to cross-build & test with qemu

Signed-off-by: Bruce Lai <bruce.lai@sifive.com>
Change-Id: I7ce8315993b0e8300e8fd5b1632610a91a4e9f52
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4401740
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-04-10 00:50:25 +00:00
Frank Barchard
42d76a342f RAWToJNV21 function with 2 step conversion
RAWToJ420 + J420ToNV21 on row level

Pixel 6
RAWToJNV21_Opt (320 ms)

Skylake Xeon
RAWToJNV21_Opt (302 ms)

Bug: b/220171611
Change-Id: I39dcce9cf56c576b95666bb4fb1baccf9fbc7f7a
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3495876
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-03-01 19:33:49 +00:00
Christoffer Jansson
eba45a9c17 Update gclient instructions + environment
Bug: libyuv:917
Change-Id: I0c9930570bba8a1c43f8477e29b839cfa82051a8
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3488008
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Christoffer Jansson <jansson@chromium.org>
2022-02-24 15:19:23 +00:00
Frank Barchard
2c6bfc02d5 Remove MMI support
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-26 08:41:33 +00:00
Frank Barchard
d768774299 add yuvconvstants util
miscellaneous cleanup of other code/comments

Bug: libyuv:873, libyuv:877
Change-Id: I0d8caf9a65908ff8898b25494f7c724775f84fa3
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2692930
Reviewed-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2021-02-12 19:45:16 +00:00
Frank Barchard
7a61759f78 NV12Mirror and MirrorUVPlane functions added
HalfMergeUV AVX2 version

Skylake Xeon performance for 1280x720
NV12Mirror_Any (109 ms)
NV12Mirror_Unaligned (113 ms)
NV12Mirror_Invert (107 ms)
NV12Mirror_Opt (108 ms)
NV12Mirror_NullY (19 ms)

Slightly faster than comparable I420Mirror
I420Mirror_Any (113 ms)
I420Mirror_Unaligned (110 ms)
I420Mirror_Invert (109 ms)
I420Mirror_Opt (110 ms)

BUG=libyuv:840, libyuv:858

Change-Id: I686b1b778383bfa10ecd1655e986bdc99e76d132
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2176066
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: richard winterton <rrwinterton@gmail.com>
2020-05-04 22:32:14 +00:00
Frank Barchard
9a07219dc8 Documentation update for GYP and envionment variables
Bug: libyuv:816, libyuv:804
Change-Id: I73a6960b2cc6f3ca31c43c44ccd8b01f5e9e7013
Test" Untested
Reviewed-on: https://chromium-review.googlesource.com/1205053
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2018-09-04 19:45:41 +00:00
Frank Barchard
d694f0a82b Document update for running android apps
Bug: libyuv:803
Test: out/Release/bin/run_libyuv_unittest -v --gtest_filter=*ToRGB565* --libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=-1  --libyuv_cpu_info=-1 2>&1 | sortms
Change-Id: I024823752e410e55076cb5c5ec5ca78736848f86
Reviewed-on: https://chromium-review.googlesource.com/1173662
Reviewed-by: Patrik Höglund <phoglund@chromium.org>
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2018-08-14 17:40:57 +00:00
lixia zhang
21be9122aa libyuv:loongson optimize compare/row/scale/rotate files with mmi.
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-07-20 22:53:04 +00:00
Frank Barchard
a9626b9daf Disable AVX512 for iOS simulator xcode 9 builds.
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>
2018-04-03 18:45:14 +00:00
Frank Barchard
4ad33344cf Pass float parameters via vector 2 float and "w" for scalar multiply.
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>
2018-03-28 21:52:08 +00:00
Shenghua Zhang
caeb9dca7a [ndk] Add android ndk deps in libyuv DEPS
Because of the android sdk managed by CIPD (see go/use-adjective-apis),
its deps repo ndk needs to be relocated, as well as hooked by the root
DEPS instead of recursedeps. This CL addes android ndk deps in
libyuv/DEPS.

Bug: chromium:659808
Change-Id: I3d83c06d108d131ea1809c79955fae39d6cc737d
Reviewed-on: https://chromium-review.googlesource.com/858433
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2018-01-10 19:25:11 +00:00
Frank Barchard
3b81288ece Remove Mips DSPR2 code
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-12-14 18:22:16 +00:00
Frank Barchard
75ec56b55a documentation - iaca, yuvconvert, clang-cl doc updates
Bug: None
Test: None
Change-Id: Ie7cab948b7e879b08e5e5efaae008977513a0a80
Reviewed-on: https://chromium-review.googlesource.com/749895
Commit-Queue: Frank Barchard <fbarchard@google.com>
Reviewed-by: Patrik Höglund <phoglund@chromium.org>
2017-11-02 22:34:14 +00:00
Frank Barchard
831da079eb Update msan instructions to show release build
The current documentation shows a debug build.
When you attempt that an assert is triggered suggesting
a release build.  Update the documentation to reflect that.

TBR=kjellander@chromium.org
BUG=libyuv:731
TEST=gn gen out/Deb^C "--args=is_debug=true is_msan=true"

Change-Id: Ib78e3a7859aa391ac359fa38234aaef0554d0df4
Reviewed-on: https://chromium-review.googlesource.com/663882
Reviewed-by: Cheng Wang <wangcheng@google.com>
2017-09-12 19:14:31 +00:00
Henrik Kjellander
960088ec10 DEPS: Remove root_dir variable.
Due to legacy reasons, libyuv uses a root_dir variable in the DEPS file.
It was used to make the bots checkout into a 'src' dir instead of 'libyuv',
in order to get some tools working that had hard-coded assumptions on the name
'src' of the top-level directory. This changes all those dirs to be named
'src', which is needed to get tools_libyuv/autoroller/roll_deps.py to work
while keeping the buildbot infrastructure working.

BUG=libyuv:690
TBR=fbarchard@chromium.org

Change-Id: Ia138264d2576e3a9db95efa3de72a14531c92752
Reviewed-on: https://chromium-review.googlesource.com/447913
Reviewed-by: Frank Barchard <fbarchard@google.com>
2017-03-03 02:30:00 +00:00
Henrik Kjellander
f49fde796f Use DEPS for all dependencies + add PRESUBMIT.py
This changes libyuv to use the DEPS file for pulling
down all dependencies (thus no Chromium checkout is needed any more).

Add tools_libyuv directory to contain libyuv-specific tools
(needed to avoid name collision with the now DEPSed tools/ directory
of Chromium, which is needed by the toolchain).
Add tools_libyuv/autoroller/roll_deps.py script to automatically
roll all entries in the DEPS file (copied from WebRTC).

third_party/ is now DEPSed as well, including the gtest configuration
headers that used to live inside the libyuv repo.

Add PRESUBMIT.py with a few simple checks + execution of PyLint and
Python unit tests. For PyLint a pylintrc file was also added.

Valgrind in tools_libyuv/valgrind was updated to make PRESUBMIT.py pass
and remove old tsan suppressions (not used).

Removed util/android/test_runner.py since it's no longer needed.

Buildbot changes in https://chromium-review.googlesource.com/436464 
are needed for the Memcheck bot to go green.

BUG=libyuv:676
NOTRY=True

Change-Id: Ib86fea2905a1656bba2933703ce5a59d29d8db6b
Reviewed-on: https://chromium-review.googlesource.com/436264
Commit-Queue: Henrik Kjellander <kjellander@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@google.com>
2017-02-03 11:36:53 +00:00
Frank Barchard
76e7f104ae documentation updates
BUG=None
TEST=Untested

Change-Id: I8ab95654255d1aa9cf05a664ecf59ee6c0757e66
Reviewed-on: https://chromium-review.googlesource.com/434941
Reviewed-by: Henrik Kjellander <kjellander@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@google.com>
2017-02-02 18:31:32 +00:00
Frank Barchard
b89bcda273 Add comments for ARGBToUV_C and ARGBToUVJ_C
ARGBToUV_C and ARGBToUVJ_C are generated functions with subtle
difference in rounding.  Adding comment to make them easier to find.

TBR=kjellander@chromium.org
BUG=libyuv:634
TEST=untested

Change-Id: I9912d256a1e04c58475d33bdb472c37484f6cab9
Reviewed-on: https://chromium-review.googlesource.com/434980
Reviewed-by: Frank Barchard <fbarchard@google.com>
Commit-Queue: Frank Barchard <fbarchard@google.com>
2017-01-30 23:44:05 +00:00
Frank Barchard
33f52bdac9 Add installer builds to cmake for linux
cd ~/my_projects/libyuv
git pull
mkdir cbuild  # (for out-of-source builds)
cd cbuild
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
make package

BUG=libyuv:673
TEST=make package

Change-Id: Ia449cbfd0bc118cc90c8648f8199a0526b7ae2a2
Reviewed-on: https://chromium-review.googlesource.com/433440
Commit-Queue: Frank Barchard <fbarchard@google.com>
Reviewed-by: Henrik Kjellander <kjellander@chromium.org>
2017-01-26 23:05:17 +00:00
Frank Barchard
2c94d6bd5a document GN for ios
BUG=libyuv:643
TEST=gn gen out/Release "--args=is_debug=false target_os=\"ios\" ios_enable_code_signing=false target_cpu=\"arm64\"" && ninja -v -C out/Release libyuv_unittest
R=kjellander@chromium.org

Review URL: https://codereview.chromium.org/2450853003 .
2016-10-25 17:13:59 -07:00
Frank Barchard
a2891ec77c Add MSA optimized YUY2ToI422, YUY2ToI420, UYVYToI422, UYVYToI420 functions
R=fbarchard@google.com
BUG=libyuv:634

Performance gains as below,

YUY2ToI422, YUY2ToI420 :-

YUY2ToYRow_MSA          : ~10x
YUY2ToUVRow_MSA         : ~11x
YUY2ToUV422Row_MSA      : ~9x
YUY2ToYRow_Any_MSA      : ~6x
YUY2ToUVRow_Any_MSA     : ~5x
YUY2ToUV422Row_Any_MSA  : ~4x

UYVYToI422, UYVYToI420 :-

UYVYToYRow_MSA          : ~10x
UYVYToUVRow_MSA         : ~11x
UYVYToUV422Row_MSA      : ~9x
UYVYToYRow_Any_MSA      : ~6x
UYVYToUVRow_Any_MSA     : ~5x
UYVYToUV422Row_Any_MSA  : ~4x

Review URL: https://codereview.chromium.org/2397693002 .
2016-10-07 10:37:22 -07:00
Frank Barchard
4b3b310e66 Enable optimize max for GN builds + update docs
Optimize max enables O2 for official builds.  Normally release builds
are O2 but the official build is Os, affecting performance.
The GYP file was previously updated to enable optimize max,
which enables ltcg and O2.

Documentation updated to show GN builds in docs/getting_started.md

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

Review URL: https://codereview.chromium.org/2386093003 .
2016-10-04 11:50:19 -07:00
Frank Barchard
c5323b0fdc Add MIPS SIMD Arch (MSA) optimized MirrorRow function
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-09-22 16:12:22 -07:00
Frank Barchard
742be44654 Remove references to svn version control.
BUG=libyuv:636
TESTED=try bots
R=kjellander@chromium.org

Review URL: https://codereview.chromium.org/2339813002 .
2016-09-14 14:54:47 -07:00
Frank Barchard
74491ba0c5 add blank lines to getting started
BUG=libyuv:626

Review URL: https://codereview.chromium.org/2225763003 .
2016-08-08 15:23:38 -07:00
Henrik Kjellander
d19f1c319a Roll chromium_revision 0868029..33f8768
Add a lot of new dependencies for the Android toolchain
to setup_links.py (added for WebRTC in https://codereview.webrtc.org/2190893002
and https://codereview.webrtc.org/2215633002).

There was no other way to get the Android test to build
than renaming the APK to yuv_unittests. That made it possible
to use build/apk_test.gypi (there's some bug somewhere that assumes
names doesn't start with "lib", see http://crbug.com/543820).

TBR=fbarchard@chromium.org
BUG=libyuv:626

Review URL: https://codereview.chromium.org/2201893007 .
2016-08-04 13:43:17 +02:00
Frank Barchard
e2611a7349 document cpuid command line behavior
cpu_info_ is zero for uninitialized state and all bits are off, disabling all cpu optimizations.
the 1 bit indicates cpu_info_ is initialized avoiding calling the detection code again for performance.

MaskCpuFlags initializes the cpu ignoring existing flags, then masks with the supplied flags and stores to cpu_info_.
As a mask, -1 has no effect, enabling all cpu features that were detected, but nothing that wasnt detected.
Setting to 0 will cause the next call to re-initialize the cpu, which is same as enabling all features.
Setting mask to 1 will turn off all cpu features but keep the initialized bit on, so the next detection call wont reinitialize and the cpu features are all disabled.

So normal behavior for command line and programatic masking is:
1 = C
-1 = SIMD

TBR=harryjin@google.com
BUG=libyuv:600
TESTED=out64/Release/bin/run_libyuv_unittest -s libyuv_unittest --verbose --release --gtest_filter=*ARGBExtractAlpha* -a "--libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=9999 --libyuv_flags=1 --libyuv_cpu_info=1"

Review URL: https://codereview.chromium.org/2042933002 .
2016-06-08 10:38:09 -07:00
Frank Barchard
8c8294f09b Empty overrides file for GN on Mac
R=kjellander@chromium.org

BUG=libyuv:583
TESTED=gn gen out/Debug

Review URL: https://codereview.chromium.org/1870473002 .
2016-04-07 14:39:30 -07:00
Frank Barchard
ab0dfdd4ff Documentation fix for android aarch64 disassembly.
Name of objdump tool updated.

TBR=kjellander@chromium.org
BUG=none

Review URL: https://codereview.chromium.org/1715743003 .

Review URL: https://codereview.chromium.org/1727993002 .
2016-02-23 18:30:35 -08:00
Frank Barchard
38d37a5bee Documentation fix for android aarch64 disassembly
Name of objdump tool updated.

R=kjellander@chromium.org
BUG=none

Review URL: https://codereview.chromium.org/1715743003 .
2016-02-19 11:30:22 -08:00
Frank Barchard
127ff512b3 add perf data files to ignores
document play services update

R=jkellander@chromium.org
BUG=none

Review URL: https://codereview.chromium.org/1712463002 .
2016-02-17 21:37:09 -08:00
Frank Barchard
69c38c5cf5 update linux instructions to not update clang
R=jkellander@chromium.org
BUG=none

Review URL: https://codereview.chromium.org/1703243003 .
2016-02-17 21:16:28 -08:00
Henrik Kjellander
584c2e660d Add all wiki pages as MarkDown documents + README.md
This is based on today's content at
https://code.google.com/p/libyuv/w/list

BUG=chromium:587193

Review URL: https://codereview.chromium.org/1703653002 .
2016-02-17 07:50:19 +01:00