85 Commits

Author SHA1 Message Date
Byoungchan Lee
4e8a843bfc Fix missing headers in GN/GYP build files
While porting libyuv's GN to other build systems, I discovered that
several headers were absent in the GN and GYP build files. These headers
are utilized in the source files but were not included in the GN and GYP
build configurations.

Without these headers, the Bazel build fails with the following error:
ERROR: /path/to/bazel/external/libyuv/BUILD.bazel:4:11: Compiling source/compare.cc failed: (Exit 1): clang-17 failed: error executing CppCompile command (from target @@libyuv//:libyuv) /usr/bin/clang-17 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++14' ... (remaining 32 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/libyuv/source/compare.cc:20:10: fatal error: 'libyuv/compare_row.h' file not found
   20 | #include "libyuv/compare_row.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Bug: None
Change-Id: I39c4c545e381d5f28c749f9ba8940e039aa55dfc
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5380588
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
2024-04-01 09:19:24 +00:00
Frank Barchard
10f00a4960 Add CHROMIUM define when building libyuv with GN
- tells cpu_id.cc to avoid sys_call

Bug: None
Change-Id: I61cd87fd130a6106306cf0f0cc3e36028fa5635f
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5378424
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2024-03-18 19:15:55 +00:00
Frank Barchard
6dc03dacbf Split scale_test and scale_plane_test to allow building on small devices
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-09 18:39:41 +00:00
Frank Barchard
9e61d7f9c1 Split convert_test and convert_argb_test to allow building on small systems 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-12-08 13:39:56 +00:00
Cheng Yangyang
c0031cfd95 Add GN builds on loongarch platform.
Currently, chromium has merged loongarch config file in bug:1454442,
and so we resubmit gn builds support for loongarch.

Bug: chromium:1289502
Change-Id: Iac83f5ea016945f7d9cc5f6de20d4c561bab6347
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4615589
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-06-19 17:47:05 +00:00
Frank Barchard
2a5d7e2fbc FilterRows_NEON - remove unused function - same as InterpolateRow_NEON
- Bump version to 1872
- Add scale_rvv to build files

Bug: libyuv:956
Change-Id: Ib9e9fd840a0774bd35bcdcca55a2596f33272383
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4608519
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-06-13 15:20:02 +00:00
Prashanth Swaminathan
8b4aa7cef9 Add RVV files to Android and GN builds
Include row_rvv.cc source file and support for riscv64 builds in Android
and GN builds. Adds GN build flag to disable RISC-V vector operations.
Switches dynamic linker to 64-bit by default, with exceptions for 32-bit
targets as defined in //build/config/android/abi.gni.

Bug: b/280364043
Test: Verified local build via Android and GN.
Change-Id: I1bbd36f16aafa16d4bfd117de03354be79743a9d
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4501727
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Prashanth Swaminathan <prashanthsw@google.com>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2023-05-09 15:31:51 +00:00
Abhijeet Kandalkar
77c2121f7e [ios-blink] Enabled JPEG for ios-blink
MJPGToI420 and MJPGToNV12 are needed for successfully compiling
/m/c/v/m/sample_buffer_transformer_mac.cc on ios-blink port.

This CL enables JPEG support for ios-blink port of chromium.

Bug: 1411704
Change-Id: I2009b371a35fa881b9e95ad4fad22356992cef52
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4454847
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2023-04-20 16:27:51 +00:00
Frank Barchard
30f9b28048 Add I210ToI420
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-09 08:07:50 +00:00
Frank Barchard
d011314f14 Revert "I210ToI420, InterpolatePlane_16, and ScalePlane Vertical-only asan fix"
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-07 09:16:05 +00:00
Frank Barchard
60254a1d84 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>
2022-06-07 01:41:56 +00:00
Frank Barchard
715150b5aa Add UYVYToY function
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-05-24 01:42:31 +00:00
Ivan Pavlotskiy
966768e899 Fix compile errors for ARM targets when libyuv_use_neon = false
When building for ARM target with "libyuv_use_neon" set to false, the
build fails because there are still codes that reference to the NEON
related functions. To disable these code parts completely, the
LIBYUV_DISABLE_NEON macro should be defined when the "libyuv_use_neon"
is set to false.

Bug: libyuv:929
Change-Id: I8f34288d0d17dd29b85db004e62d83e4ace3d595
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3628112
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
2022-05-13 10:12:38 +00:00
Frank Barchard
124bf08fee RGBScale function using 3 steps: RGB24ToARGB, ARGBScale, ARGBToRGB24
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>
2022-03-19 01:44:06 +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
08815a2976 Scale 12 functions that are scale 16 but with only low 12 bits valid
Rename yuvconstants to .c and use round from math.h

Bug: libyuv:882, b/180472591
Change-Id: I70720bf3e0833ba00df0d721f12020fba0b07a03
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2706966
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
2021-02-19 18:04:48 +00:00
Mirko Bonadei
63dd43dd46 [libyuv] - Switch from gflags to absl/flags.
No-Try: True
Bug: libyuv:883
Change-Id: I11f1dbcccdc3697b73b3cfc2d423876841eb7b7a
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2701771
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2021-02-19 08:54:30 +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
cec28e7088 PlaneScale, UVScale and ARGBScale test 3x and 4x down sample.
Intel SkylakeX
UVTest3x (1925 ms)
UVTest4x (2915 ms)
PlaneTest3x (2040 ms)
PlaneTest4x (4292 ms)
ARGBTest3x (2079 ms)
ARGBTest4x (1854 ms)

Pixel 2
ARGBTest3x (3602 ms)
ARGBTest4x (4064 ms)
PlaneTest3x (3331 ms)
PlaneTest4x (8977 ms)
UVTest3x (3473 ms)
UVTest4x (6970 ms)

Bug: b/171798872, b/171884264
Change-Id: Iebc70fed907857b6cb71a9baf2aba9861ef1e3f7
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2505601
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2020-10-28 20:41:59 +00:00
Frank Barchard
5c4dc242f4 MJPGToNV12 added and build files sorted
Bug: None
Change-Id: I87aa64a14bb3f0785f984f492e56fcf2313431ce
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2502780
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2020-10-28 16:24:38 +00:00
Frank Barchard
e647902212 NV12Scale function and ScaleUV for packed UV plane bilinear scaling
Bug: libyuv:718, libyuv:838, b/168918847
Change-Id: I3300c1e7d51407b9c3201cf52b68e2e11346ff5f
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2427868
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: richard winterton <rrwinterton@gmail.com>
2020-09-29 23:49:05 +00:00
Hidehiko Abe
165f39cd12 libyuv: Expand is_linux to is_linux || is_chromeos.
Currently is_linux is true on building Chrome OS,
but it is planned to set to false. This is the preparation.

Bug: chromium:1110266
Test: Build locally.
Change-Id: Icf3445a8a828e1e1a637360363845bcca5863aca
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2400818
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2020-09-15 01:08:14 +00:00
Mirko Bonadei
7050e07982 Remove comment from BUILD.gn
The goal of this CL is to trigger all the CI bots to ensure they have
all been migrated to goma RBE.

TBR=fbarchard@chromium.org
Bug: None
Change-Id: I201ac1852bac0d7f6a53f66a0ff56bc93096c005
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2274415
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
2020-06-30 07:16:22 +00:00
Frank Barchard
eed202f1f3 i444tonv12_eg example program
Bug: libyuv:858
Change-Id: I1b970f57a6ff6288afc8f60b2244e51bf6d30e78
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2169341
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2020-04-28 16:35:49 +00:00
Shiyou Yin
59b29c5f4d Fix prob of disabling mmi on loongson3 variant.
If 'mips_arch_variant=loongson3' is setted without 'mips_use_mmi=true',
undefined reference of MMI functions will be reported.

Change-Id: I2e91d63e1fa2d6c0db907aaab978227c87c991ac
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2129285
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2020-03-31 20:25:25 +00:00
Frank Barchard
d82f4baf5f Upstream minor changes. Faster tests, Faster YUV Rotate180 and Mirror
Bug: libyuv:840, libyuv:849: b/144318948
Change-Id: I303c02ac2b838a09d3e623df7a69ffc085fe3cd2
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/1914781
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2019-11-13 20:02:40 +00:00
Mirko Bonadei
7320ac5277 Re-enable optimize_max to fix UBSan.
This reverts the changes to BUILD.gn done by [1] because they were
breaking UBSan. At least one between:
//build/config/compiler:default_optimization
//build/config/compiler:optimize_max

need to be selected, this CL re-enables optimize_max since that was the
previous default.

[1] - https://chromium-review.googlesource.com/c/libyuv/libyuv/+/1790959

Bug: None
Change-Id: I136179c2e814f7aba9cc8515cc4825cbd41f8abb
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/1809137
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2019-09-17 17:39:54 +00:00
Frank Barchard
c85a7b3ae3 MMI Optimized functions I422ToARGB for 1080p video
Improves playback performance for 1080p video on www.youku.com

BUG=libyuv:841

Change-Id: Iabe7693fba276162af0290863f46e214ab86fb6c
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/1790959
Reviewed-by: Miguel Casas <mcasas@chromium.org>
2019-09-11 21:06:21 +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
Tom Anderson
780cdfed4e Remove manual references to exe_and_shlib_deps
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>
2018-06-15 22:07:38 +00:00
Frank Barchard
439fc3ce3d Revert "Revert "Fixing libyuv gn check.""
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>
2018-02-12 19:36:52 +00:00
Frank Barchard
724dbeba6c 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>
2018-02-10 00:10:20 +00:00
Mirko Bonadei
b625f7b932 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>
2018-02-06 18:58:35 +00:00
VladimirTechMan
56eb5a4775 Allow enabling libyuv symbols visibility for shared library targets
When developing WebRTC applications with custom video sources, libyuv's
API is often the required part of the project. For that, application
developers can link with a separate standalone instance of libyuv.
However, it is even better to avoid that binary code duplication and
link against libyuv as a part compiled into the WebRTC library.

When building WebRTC as a static library target, the symbols from libyuv
are normally accessible to the linker without any extra actions. When
building WebRTC as a shared library, that does not work as the exported
symbols are those marked as visible, while libyuv is built with the
hidden visibility setting by default.

This patch adds an extra flag to enable switching the symbol visibility
to default when building shared library targets depending on libyuv in
WebRTC and Chromium projects. By default the flag is not enabled,
preserving the prior behaviour.

Bug: NONE
Change-Id: I48893cb9f54b1e1b49a34e14434e67f91d3e5e79
Reviewed-on: https://chromium-review.googlesource.com/827746
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2017-12-21 00:34:52 +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
Mirko Bonadei
d94a4867bf Using all_dependent_configs to pass libyuv_config around.
Using public_configs, client projects must rely on public_deps to
propagate configurations up in the build graph. This is bad because
public_deps allows the exposition of headers that live in another
target. This can lead to a really unhealthy build.

On the other side, all_dependent_configs is automatically propagated
up in the build graph but if a target includes a libyuv header it is
forced by GN to declare the dependency (and this will propagate
libyuv_config).

Bug: webrtc:8605, webrtc:8603
Change-Id: I4d71bb5de0b5b62a4ec110349223614f0b98e655
No-Try: True
Reviewed-on: https://chromium-review.googlesource.com/822112
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Reviewed-by: Patrik Höglund <phoglund@chromium.org>
2017-12-12 13:39:42 +00:00
Frank Barchard
3541e46a7e Add H010ToARGB for 10 bit YUV to ARGB
Bug: libyuv:751
Test:  LibYUVConvertTest.H010ToARGB_Opt
Change-Id: I668d3f3810e59a4fb6611503aae1c8edc7d596e7
Reviewed-on: https://chromium-review.googlesource.com/815015
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: richard winterton <rrwinterton@gmail.com>
2017-12-07 20:17:50 +00:00
Frank Barchard
fecd741794 Port HammingDistance to SSSE3
Bug: libyuv:701
Test: BenchmarkHammingDistance_Opt
Change-Id: Ibdd5d382677ebef4f82a62e0d5c3b88614a3b6e4
Reviewed-on: https://chromium-review.googlesource.com/696290
Commit-Queue: Frank Barchard <fbarchard@google.com>
Reviewed-by: Cheng Wang <wangcheng@google.com>
2017-10-03 19:11:05 +00:00
Frank Barchard
bde789b176 Hamming Distance SSE2 and AVX2 optimized
Bug: None
Test: None
Change-Id: Id52663f9c957aac3172fba92d888ad1b041d5cf0
Reviewed-on: https://chromium-review.googlesource.com/692981
Reviewed-by: Cheng Wang <wangcheng@google.com>
Commit-Queue: Frank Barchard <fbarchard@google.com>
2017-10-02 22:32:54 +00:00
Frank Barchard
0b0a891cb2 Change TestScaleSumSamples_C test to allow for some float error in sum.
The sum of floats can optimize differently with vectorization, producing
a different result between NEON and C.
Adjust the unittest to allow for some difference in the sum.

The NEON version is 8 samples at a time, so the test now rounds up
the number of values to multiple of 8.

TBR=kjellander@chromium.org
Bug: libyuv:717
Test: LibYUVPlanarTest.TestScaleSumSamples_Opt


Change-Id: I2a0783780c7e0f240f7a8e4700b2a4d3e6b52d87
Reviewed-on: https://chromium-review.googlesource.com/673708
Reviewed-by: Cheng Wang <wangcheng@google.com>
2017-09-22 18:58:11 +00:00
Manojkumar Bhosale
2621c91bf1 Add MSA optimized HammingDistance and SumSquareError functions
TBR=kjellander@chromium.org
R=fbarchard@google.com

Bug:libyuv:634
Change-Id: Id0126ba5aff38817525b1efa6044f1dc2cfa1a36
Reviewed-on: https://chromium-review.googlesource.com/625739
Reviewed-by: Frank Barchard <fbarchard@google.com>
2017-09-05 21:32:33 +00:00
Frank Barchard
83ca1abe09 Change ScaleSumSamples to return Sum of Squares
TBR=kjellander@chromium.org
BUG=libyuv:717
TEST=LibYUVPlanarTest.TestScaleSumSamples_Opt

Change-Id: I5208666f3968c5c4b0f1b0c951f24216d78ee3fe
Reviewed-on: https://chromium-review.googlesource.com/607184
Reviewed-by: Cheng Wang <wangcheng@google.com>
2017-08-09 22:19:45 +00:00
Nico Weber
56022ef77f win: Rename clang_x64 to win_clang_x64 in build/toolchain/win, step 4/5.
In cross builds of chrome/win, the host and target toolchains currently
have the same name.  To fix this, rename clang_x64 to win_clang_x64.
Because the toolchain name is also referenced in libyuv, this requires
a five-sided change:

1. Introduce variable containing the toolchain name in src.git
2. Change libyuv to refer to the variable
3. Rename toolchain in src.git (including in the newly introduced var)
4* Let libyuv refer to the new name directly
5. Remove variable again

(See also https://codereview.chromium.org/2463143002)

Bug: 748501
Change-Id: I89fdf1503f1a57992a8336026d4c8d767685d53f
Reviewed-on: https://chromium-review.googlesource.com/585306
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
2017-07-25 19:59:42 +00:00
Nico Weber
58d3392ad3 win: Rename clang_x64 to win_clang_x64 in build/toolchain/win, step 2/5.
In cross builds of chrome/win, the host and target toolchains currently
have the same name.  To fix this, rename clang_x64 to win_clang_x64.
Because the toolchain name is also referenced in libyuv, this requires
a five-sided change:

1. Introduce variable containing the toolchain name in src.git
2* Change libyuv to refer to the variable
3. Rename toolchain in src.git (including in the newly introduced var)
4. Let libyuv refer to the new name directly
5. Remove variable again

(See also https://codereview.chromium.org/2463143002)

TBR=fbarchard
Bug: 748501
Change-Id: Id8398ab5c4615c7c33dfa5ec793fdc8c0a717e57
Reviewed-on: https://chromium-review.googlesource.com/585307
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@google.com>
2017-07-25 17:28:31 +00:00
Frank Barchard
d0ed025447 add exe_and_shlib_deps dependency for libc++ new[]
TBR=kjellander@chromium.org
BUG=libyuv:712
TEST=libyuv try bots build

Change-Id: Ibe2ff9ac557d5086566941d93f71d1b8048dfb58
Reviewed-on: https://chromium-review.googlesource.com/579663
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@google.com>
2017-07-20 21:17:25 +00:00
Frank Barchard
651ccc0c3a Fix data races in libyuv::TestCpuFlag().
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-05-24 02:09:03 +00:00
Frank Barchard
2136e349da Hamming code difference of 2 memory blocks
BUG=libyuv:701
TEST=built and disassembled for aarch64
R=kjellander@chromium.org

Change-Id: I7712b1c7934e5dfb55fda1fa7c8405c32d6964ce
Reviewed-on: https://chromium-review.googlesource.com/495327
Reviewed-by: Henrik Kjellander <kjellander@chromium.org>
Reviewed-by: Cheng Wang <wangcheng@google.com>
2017-05-08 21:37:51 +00:00
Bruce Dawson
996a2bbdb5 Avoid double compiles of libjpeg
When libyuv was changed to compile with clang-cl this also cause libjpeg
to be compiled with clang-cl, which means that it was being compiled
twice. This is generally a bad practice, it was causing duplicate symbol
warnings in some builds, and it slows builds slightly. This change
reduces the number of build steps with the default gn settings on
Win64 builds by 71 (currently from 47,200 to 47,129).

See this change that change libyuv's compilation:
https://chromium-review.googlesource.com/c/446667/

BUG=706627

Change-Id: I13e2d4ff8511350901af10f7443f3f4b89cc2499
Reviewed-on: https://chromium-review.googlesource.com/456651
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Henrik Kjellander <kjellander@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
2017-04-20 21:02:39 +00:00
Frank Barchard
78ef440a1f Rename convert to yuvconvert to avoid name clash with linux util
Bug: libyuv:695
Test: untested
Change-Id: Ib088fd16fd00bbc50868ea330b2a544e29a3385c
Reviewed-on: https://chromium-review.googlesource.com/469077
Reviewed-by: Henrik Kjellander <kjellander@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@google.com>
2017-04-06 18:58:42 +00:00
Frank Barchard
2adb84e39e make gflags command line parser optional
BUG=libyuv:691
TEST=gn gen out/Release "--args=is_debug=false target_cpu=\"x64\" libyuv_include_tests=true"

Change-Id: Ib481189be884c34d9bbc30bfcf71c7969c6f4dae
Reviewed-on: https://chromium-review.googlesource.com/452736
Reviewed-by: Frank Barchard <fbarchard@google.com>
Commit-Queue: Frank Barchard <fbarchard@google.com>
2017-03-14 01:52:52 +00:00