Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libyuv #3527

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions modules/libyuv/0.0.0-20250102-47ddac2/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module(
name = "libyuv",
version = "0.0.0-20250102-47ddac2",
bazel_compatibility = [">=7.2.1"], # need support for "overlay" directory
compatibility_level = 1,
)

bazel_dep(name = "rules_cc", version = "0.0.17")
128 changes: 128 additions & 0 deletions modules/libyuv/0.0.0-20250102-47ddac2/overlay/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Copied from https://skia.googlesource.com/skia/+/refs/heads/main/bazel/external/libwebp/BUILD.bazel
# The copied code is available under the following BSD-style license (see
# https://skia.googlesource.com/skia/+/refs/heads/main/LICENSE):
#
# Copyright (c) 2011 Google Inc. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# This file will be copied into //third_party/externals/libwebp via the new_local_repository
# rule in WORKSPACE.bazel, so all files should be relative to that path.
# We define this here because the emscripten toolchain calls the cpu wasm, whereas the
# bazelbuild/platforms call it wasm32. https://github.com/emscripten-core/emsdk/issues/919

load("@rules_cc//cc:cc_library.bzl", "cc_library")

cc_library(
name = "libyuv",
srcs = [
"include/libyuv/basic_types.h",
"include/libyuv/compare.h",
"include/libyuv/compare_row.h",
"include/libyuv/convert.h",
"include/libyuv/convert_argb.h",
"include/libyuv/convert_from.h",
"include/libyuv/convert_from_argb.h",
"include/libyuv/cpu_id.h",
"include/libyuv/loongson_intrinsics.h",
"include/libyuv/macros_msa.h",
"include/libyuv/mjpeg_decoder.h",
"include/libyuv/planar_functions.h",
"include/libyuv/rotate.h",
"include/libyuv/rotate_argb.h",
"include/libyuv/rotate_row.h",
"include/libyuv/row.h",
"include/libyuv/scale.h",
"include/libyuv/scale_argb.h",
"include/libyuv/scale_rgb.h",
"include/libyuv/scale_row.h",
"include/libyuv/scale_uv.h",
"include/libyuv/version.h",
"include/libyuv/video_common.h",
"source/compare.cc",
"source/compare_common.cc",
"source/compare_gcc.cc",
"source/compare_mmi.cc",
"source/compare_msa.cc",
"source/compare_neon.cc",
"source/compare_neon64.cc",
"source/compare_win.cc",
"source/convert.cc",
"source/convert_argb.cc",
"source/convert_from.cc",
"source/convert_from_argb.cc",
"source/convert_jpeg.cc",
"source/convert_to_argb.cc",
"source/convert_to_i420.cc",
"source/cpu_id.cc",
"source/mjpeg_decoder.cc",
"source/mjpeg_validate.cc",
"source/planar_functions.cc",
"source/rotate.cc",
"source/rotate_any.cc",
"source/rotate_argb.cc",
"source/rotate_common.cc",
"source/rotate_gcc.cc",
"source/rotate_lsx.cc",
"source/rotate_mmi.cc",
"source/rotate_msa.cc",
"source/rotate_neon.cc",
"source/rotate_neon64.cc",
"source/rotate_win.cc",
"source/row_any.cc",
"source/row_common.cc",
"source/row_gcc.cc",
"source/row_lasx.cc",
"source/row_lsx.cc",
"source/row_mmi.cc",
"source/row_msa.cc",
"source/row_neon.cc",
"source/row_neon64.cc",
"source/row_win.cc",
"source/scale.cc",
"source/scale_any.cc",
"source/scale_argb.cc",
"source/scale_common.cc",
"source/scale_gcc.cc",
"source/scale_lsx.cc",
"source/scale_mmi.cc",
"source/scale_msa.cc",
"source/scale_neon.cc",
"source/scale_neon64.cc",
"source/scale_rgb.cc",
"source/scale_uv.cc",
"source/scale_win.cc",
"source/video_common.cc",
],
hdrs = [
"include/libyuv.h",
],
includes = [
"include",
],
local_defines = [
"AVIF_CODEC_LIBGAV1=1",
"AVIF_LIBYUV_ENABLED=1",
],
visibility = ["//visibility:public"],
)
1 change: 1 addition & 0 deletions modules/libyuv/0.0.0-20250102-47ddac2/overlay/MODULE.bazel
18 changes: 18 additions & 0 deletions modules/libyuv/0.0.0-20250102-47ddac2/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
matrix:
platform:
- debian10
- debian11
- macos
- macos_arm64
- ubuntu2004
- ubuntu2204
- ubuntu2404
- windows
bazel: [7.x, 8.x, rolling]
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@libyuv//:libyuv'
9 changes: 9 additions & 0 deletions modules/libyuv/0.0.0-20250102-47ddac2/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"url": "https://github.com/lemenkov/libyuv/archive/47ddac2996378c34aab9318f0d218303b1d282e7.zip",
"integrity": "sha256-8KNXn4rzNi9MDTgGgJsHIkd5/DXJb/FmDXiS2r3kd0s=",
"strip_prefix": "libyuv-47ddac2996378c34aab9318f0d218303b1d282e7",
"overlay": {
"BUILD.bazel": "sha256-a90k/2hXS14VLVYXXbs941vwiY7K8QaPJw6Htj5oACk=",
"MODULE.bazel": "sha256-w7L36ZqzDTtveq2lFiyiWNfQRqYjWrNGfV1vMJrgXr0="
}
}
17 changes: 17 additions & 0 deletions modules/libyuv/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"homepage": "https://chromium.googlesource.com/libyuv/libyuv",
"maintainers": [
{
"email": "[email protected]",
"github": "Vertexwahn",
"name": "Julian Amann"
}
],
"repository": [
"github:lemenkov/libyuv"
],
"versions": [
"0.0.0-20250102-47ddac2"
],
"yanked_versions": {}
}
Loading