Skip to content

Commit 717a0d6

Browse files
authored
Enable libgav1 support for avif image format (#993)
This PR enables libgav1 support for avif image format Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
1 parent 4d22eaa commit 717a0d6

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

WORKSPACE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,3 +937,10 @@ http_archive(
937937
"https://github.com/videolan/dav1d/archive/0.6.0.tar.gz",
938938
],
939939
)
940+
941+
new_git_repository(
942+
name = "libgav1",
943+
build_file = "//third_party:libgav1.BUILD",
944+
commit = "6ab7d65a68350ed4ec6aaabfa18715b2d76a231c",
945+
remote = "https://chromium.googlesource.com/codecs/libgav1",
946+
)

third_party/libavif.BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ cc_library(
1414
],
1515
exclude = [
1616
"src/codec_aom.c",
17-
"src/codec_libgav1.c",
1817
"src/codec_rav1e.c",
1918
],
2019
),
2120
hdrs = [],
2221
defines = [
2322
#"AVIF_CODEC_AOM=1",
2423
"AVIF_CODEC_DAV1D=1",
25-
#"AVIF_CODEC_LIBGAV1=1",
24+
"AVIF_CODEC_LIBGAV1=1",
2625
#"AVIF_CODEC_RAV1E=1",
2726
],
2827
includes = [
@@ -31,5 +30,6 @@ cc_library(
3130
visibility = ["//visibility:public"],
3231
deps = [
3332
"@dav1d",
33+
"@libgav1",
3434
],
3535
)

third_party/libgav1.BUILD

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Description:
2+
# libgav1 decoder for AVIF library
3+
4+
licenses(["notice"]) # Apache license
5+
6+
exports_files(["LICENSE"])
7+
8+
cc_library(
9+
name = "libgav1",
10+
srcs = glob(
11+
[
12+
"src/**/*.cc",
13+
"src/**/*.h",
14+
],
15+
),
16+
hdrs = glob([
17+
"src/**/*.inc",
18+
]),
19+
defines = [
20+
"LIBGAV1_MAX_BITDEPTH=8",
21+
],
22+
includes = [
23+
"src",
24+
],
25+
visibility = ["//visibility:public"],
26+
deps = [
27+
"@com_google_absl//absl/algorithm",
28+
"@com_google_absl//absl/container:inlined_vector",
29+
"@com_google_absl//absl/synchronization",
30+
"@com_google_absl//absl/types:optional",
31+
"@com_google_absl//absl/types:span",
32+
],
33+
)

0 commit comments

Comments
 (0)