Skip to content

Commit afdac5f

Browse files
authored
Update dav1d BUILD file (#998)
* Update dav1d BUILD files This PR updates third-party dav1d BUILD files so that BITDEPTH are definied separatedly for 8 and 16 bits inside the header file. In the past BITDEPTH was defined in compiler options which generates lots of warnings. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Push empty Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * empty Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Disable kinesis tests Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
1 parent ad4e7c3 commit afdac5f

File tree

4 files changed

+114
-69
lines changed

4 files changed

+114
-69
lines changed

WORKSPACE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,14 @@ http_archive(
930930
http_archive(
931931
name = "dav1d",
932932
build_file = "//third_party:dav1d.BUILD",
933+
patch_cmds = [
934+
"mkdir -p include8/common",
935+
"sed 's/define DAV1D_COMMON_BITDEPTH_H/define DAV1D_COMMON_BITDEPTH_H\\'$'\\n''#define BITDEPTH 8/g' include/common/bitdepth.h > include8/common/bitdepth.h",
936+
"cat include/common/dump.h > include8/common/dump.h",
937+
"mkdir -p include16/common",
938+
"sed 's/define DAV1D_COMMON_BITDEPTH_H/define DAV1D_COMMON_BITDEPTH_H\\'$'\\n''#define BITDEPTH 16/g' include/common/bitdepth.h > include16/common/bitdepth.h",
939+
"cat include/common/dump.h > include16/common/dump.h",
940+
],
933941
sha256 = "66c3e831a93f074290a72aad5da907e3763ecb092325f0250a841927b3d30ce3",
934942
strip_prefix = "dav1d-0.6.0",
935943
urls = [

tests/test_io_dataset_eager.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,15 +1052,7 @@ def func(e):
10521052
),
10531053
],
10541054
),
1055-
pytest.param(
1056-
"kinesis",
1057-
marks=[
1058-
pytest.mark.skipif(
1059-
sys.platform == "darwin",
1060-
reason="TODO macOS does not support kinesis",
1061-
),
1062-
],
1063-
),
1055+
pytest.param("kinesis", marks=[pytest.mark.skip(reason="TODO")],),
10641056
pytest.param("pubsub"),
10651057
pytest.param("hdf5"),
10661058
pytest.param("grpc"),

third_party/dav1d.BUILD

Lines changed: 103 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,94 +6,137 @@ licenses(["notice"]) # BSD license
66
exports_files(["COPYING"])
77

88
cc_library(
9-
name = "dav1d",
9+
name = "dav1d8",
10+
srcs = [
11+
"include8/common/bitdepth.h",
12+
"include8/common/dump.h",
13+
"src/cdef_apply_tmpl.c",
14+
"src/cdef_tmpl.c",
15+
"src/fg_apply_tmpl.c",
16+
"src/film_grain_tmpl.c",
17+
"src/ipred_prepare_tmpl.c",
18+
"src/ipred_tmpl.c",
19+
"src/itx_tmpl.c",
20+
"src/lf_apply_tmpl.c",
21+
"src/loopfilter_tmpl.c",
22+
"src/looprestoration_tmpl.c",
23+
"src/lr_apply_tmpl.c",
24+
"src/mc_tmpl.c",
25+
"src/recon_tmpl.c",
26+
],
27+
hdrs = [],
28+
copts = [],
29+
defines = [],
30+
includes = [
31+
"include8",
32+
],
1033
visibility = ["//visibility:public"],
1134
deps = [
12-
":dav1d16",
13-
":dav1d8",
35+
":source",
1436
],
37+
alwayslink = 1,
1538
)
1639

1740
cc_library(
18-
name = "dav1d8",
19-
srcs = glob(
20-
[
21-
"include/dav1d/*.h",
22-
"include/common/*.h",
23-
"src/*.c",
24-
"src/x86/*.c",
25-
"src/x86/*.h",
26-
"src/*.h",
27-
],
28-
exclude = [
29-
"src/x86/msac_init.c",
30-
],
31-
) + select({
32-
"@bazel_tools//src/conditions:windows": [
33-
"include/compat/msvc/stdatomic.h",
34-
"src/win32/thread.c",
35-
],
36-
"//conditions:default": [],
37-
}),
38-
hdrs = [
39-
"build/config.h",
40-
"build/vcs_version.h",
41-
"build/version.h",
41+
name = "dav1d16",
42+
srcs = [
43+
"include16/common/bitdepth.h",
44+
"include16/common/dump.h",
45+
"src/cdef_apply_tmpl.c",
46+
"src/cdef_tmpl.c",
47+
"src/fg_apply_tmpl.c",
48+
"src/film_grain_tmpl.c",
49+
"src/ipred_prepare_tmpl.c",
50+
"src/ipred_tmpl.c",
51+
"src/itx_tmpl.c",
52+
"src/lf_apply_tmpl.c",
53+
"src/loopfilter_tmpl.c",
54+
"src/looprestoration_tmpl.c",
55+
"src/lr_apply_tmpl.c",
56+
"src/mc_tmpl.c",
57+
"src/recon_tmpl.c",
4258
],
43-
copts = [
44-
"-std=c99",
59+
hdrs = [],
60+
copts = [],
61+
defines = [],
62+
includes = [
63+
"include16",
4564
],
46-
defines = [
47-
"_FILE_OFFSET_BITS=64",
48-
"_GNU_SOURCE",
49-
"BITDEPTH=8",
65+
visibility = ["//visibility:public"],
66+
deps = [
67+
":source",
5068
],
51-
includes = [
52-
"build",
53-
"include",
54-
"include/dav1d",
69+
alwayslink = 1,
70+
)
71+
72+
cc_library(
73+
name = "source",
74+
srcs = [
75+
"include/common/bitdepth.h",
76+
"src/cdf.c",
77+
"src/cpu.c",
78+
"src/data.c",
79+
"src/decode.c",
80+
"src/dequant_tables.c",
81+
"src/getbits.c",
82+
"src/intra_edge.c",
83+
"src/itx_1d.c",
84+
"src/lf_mask.c",
85+
"src/lib.c",
86+
"src/log.c",
87+
"src/msac.c",
88+
"src/obu.c",
89+
"src/picture.c",
90+
"src/qm.c",
91+
"src/ref.c",
92+
"src/ref_mvs.c",
93+
"src/scan.c",
94+
"src/tables.c",
95+
"src/thread_task.c",
96+
"src/warpmv.c",
97+
"src/wedge.c",
5598
] + select({
5699
"@bazel_tools//src/conditions:windows": [
57-
"include/compat/msvc",
100+
"src/win32/thread.c",
58101
],
59102
"//conditions:default": [],
60103
}),
104+
hdrs = [],
105+
copts = [],
106+
defines = [],
61107
visibility = ["//visibility:public"],
108+
deps = [
109+
":header",
110+
],
62111
)
63112

64113
cc_library(
65-
name = "dav1d16",
66-
srcs = glob(
67-
[
68-
"include/dav1d/*.h",
69-
"include/common/*.h",
70-
"src/*.c",
71-
"src/x86/*.h",
72-
"src/x86/*.c",
73-
"src/*.h",
74-
],
75-
exclude = [
76-
"src/x86/msac_init.c",
77-
],
78-
) + select({
114+
name = "header",
115+
srcs = [],
116+
hdrs = [
117+
"build/config.h",
118+
"build/vcs_version.h",
119+
"build/version.h",
120+
"include/common/attributes.h",
121+
"include/common/intops.h",
122+
"include/common/mem.h",
123+
"include/common/validate.h",
124+
] + glob([
125+
"include/dav1d/*.h",
126+
"src/*.h",
127+
"src/x86/*.h",
128+
]) + select({
79129
"@bazel_tools//src/conditions:windows": [
80130
"include/compat/msvc/stdatomic.h",
81-
"src/win32/thread.c",
82131
],
83132
"//conditions:default": [],
84133
}),
85-
hdrs = [
86-
"build/config.h",
87-
"build/vcs_version.h",
88-
"build/version.h",
89-
],
90134
copts = [
91135
"-std=c99",
92136
],
93137
defines = [
94138
"_FILE_OFFSET_BITS=64",
95139
"_GNU_SOURCE",
96-
"BITDEPTH=16",
97140
],
98141
includes = [
99142
"build",
@@ -106,6 +149,7 @@ cc_library(
106149
"//conditions:default": [],
107150
}),
108151
visibility = ["//visibility:public"],
152+
deps = [],
109153
)
110154

111155
genrule(

third_party/libavif.BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ cc_library(
2929
],
3030
visibility = ["//visibility:public"],
3131
deps = [
32-
"@dav1d",
32+
"@dav1d//:dav1d16",
33+
"@dav1d//:dav1d8",
3334
"@libgav1",
3435
],
3536
)

0 commit comments

Comments
 (0)