Skip to content

Commit

Permalink
Roll src/third_party/dav1d/libdav1d/ 87f9a81cd..ed63a7459 (104 commits)
Browse files Browse the repository at this point in the history
This roll required a few changes to get working:
- "properties" => "built in options" crossfile configuration change due to Meson deprecation.
- generic config creation never worked, so fixed.
- PPC64 configs were never checked in, so switched to generic.
- copyright header changes for generate_sources.
- Updated readme.chromium with potential issues that can arise.

https://chromium.googlesource.com/external/github.com/videolan/dav1d.git/+log/87f9a81cd770..ed63a7459376

$ git log 87f9a81cd..ed63a7459 --date=short --no-merges --format='%ad %ae %s'
2022-12-09 jamrial dav1d: add an option to skip decoding some frame types
2022-12-08 jamrial picture: support creating and freeing refs without tile data
2022-12-07 gramner x86: Add 10bpc 8x32/32x8 itx AVX-512 (Ice Lake) asm
2022-12-07 gramner x86: Add minor DC-only IDCT optimizations
2022-12-13 gramner getbits: Fix assertion failure
2022-12-13 gramner checkasm: Fix integer overflow in refmvs test
2022-01-26 gramner dav1dplay: Update to new libplacebo API
2022-12-09 gramner Add minor getbits improvements
2022-12-09 gramner Add a separate getbits function for getting a single bit
2022-12-09 gramner Remove redundant zeroing in sequence header parsing
2022-12-09 gramner Set the correct default value of initial_display_delay
2022-12-09 jamrial tools: remove the null last entry in inloop_filters_tbl
2022-12-04 lu_zero Do not assume the picture allocation starts as the left edge
2022-11-21 lu_zero ppc: Allocate the correct temp buffer size
2022-11-21 lu_zero ppc: Do not use static const with vec_splats
2022-11-02 charlie.c.hayden Add info to dav1d_send_data docs
2022-10-30 jbeich build: drop -D_DARWIN_C_SOURCE on macOS/iOS after 6b611d36acab
2022-10-30 jbeich build: drop -D_POSIX_C_SOURCE on non-Linux after 6b611d36acab
2022-06-28 victorien threading: Add a pending list for async task insertion
2022-10-26 martin Implement atomic_compare_exchange_strong in the atomic compat headers
2022-10-06 victorien threading: Fix a race around frame completion (frame-mt)
2022-10-07 sebastian Handle host_machine.system() 'ios' and 'tvos' the same way as 'darwin'
2022-09-23 gramner x86: Add 10-bit 8x8/8x16/16x8/16x16 itx AVX-512 (Ice Lake) asm
2022-09-30 gramner Specify hidden visibility for global data symbol declarations
2022-09-28 gramner build: strip() the result of cc.get_define()
2022-09-26 gramner checkasm: Move printf format string to .rodata on x86
2022-09-26 gramner checkasm: Improve 32-bit parameter clobbering on x86-64
2022-09-26 gramner x86: Fix incorrect 32-bit parameter usage in high bit-depth AVX-512 mc
2022-09-09 martin arm: itx: Add clipping to row_clip_min/max in the 10 bpc codepaths
2022-09-15 gramner x86: Fix overflows in 12bpc AVX2 IDCT/IADST
2022-09-15 gramner x86: Fix overflows in 12bpc AVX2 DC-only IDCT
2022-09-15 gramner x86: Fix clipping in high bit-depth AVX2 4x16 IDCT
2022-03-21 martin Don't use gas-preprocessor with clang-cl for arm targets
2022-06-07 david_conrad Fix checking the reference dimesions for the projection process
2022-06-07 david_conrad Fix calculation of OBMC lap dimensions
2022-06-07 david_conrad Support film grain application whose only effect is clipping to video range
2022-06-07 david_conrad Ignore T.35 metadata if the OBU contains no payload
2022-06-07 david_conrad Fix chroma deblock filter size calculation for lossless
2022-06-07 david_conrad Fix rounding in the calculation of initialSubpelX
2022-06-07 david_conrad Fix overflow when saturating dequantized coefficients clipped to 0
2022-06-08 david_conrad Fix overflow in 8-bit NEON ADST
2022-09-14 martin tools: Allocate the priv structs with proper alignment
2022-09-08 gramner x86: Fix clipping in 10bpc SSE4.1 IDCT asm
2022-09-08 gramner build: Improve Windows linking options
2022-09-08 gramner tools: Improve demuxer probing
2022-08-30 code CI: Disable trimming on some tests
2022-08-30 code CI: Remove git 'safe.directory' config
2022-08-30 code gcovr: Ignore parsing errors
2022-08-30 code crossfiles: Update Android toolchains
2022-08-30 code CI: Update images
(...)
2022-09-01 victorien checkasm: Add short options
2022-09-01 victorien checkasm: Add pattern matching to --test
2022-09-01 victorien checkasm: Remove pattern matching from --bench
2022-08-29 victorien checkasm: Add a --function option
2022-08-30 victorien threading: Fix copy_lpf_progress initialization
2022-08-19 jamrial data: don't overwrite the Dav1dDataProps size value
2022-07-18 gramner Adjust inlining attributes on some functions
2022-07-19 gramner x86: Remove leftover instruction in loopfilter AVX2 asm
2022-06-07 david_conrad Enable pointer authentication in assembly when building arm64e
2022-06-07 david_conrad Don't trash the return stack buffer in the NEON loop filter
2022-07-03 thresh CI: Removed snap package generation
2022-07-06 gramner Eliminate unused C DSP functions at compile time
2022-07-06 gramner cpu: Inline dav1d_get_cpu_flags()
2022-06-22 gramner x86: Add minor loopfilter asm improvements
2022-06-15 gramner checkasm: Speed up signal handling
2022-06-15 gramner checkasm: Improve seed generation on Windows
2022-06-20 gramner ci: Don't specify a specific MacOS version
2022-06-14 gramner x86: Add high bit-depth loopfilter AVX-512 (Ice Lake) asm
2022-06-13 victorien checkasm/lpf: Use operating dimensions
2022-06-03 gramner checkasm: Print the cpu model and cpuid signature on x86
2022-06-03 gramner checkasm: Add a vzeroupper check on x86
2022-06-02 gramner x86: Add a workaround for quirky AVX-512 hardware behavior
2022-05-31 victorien checkasm: Fix uninitialized variable
2022-05-14 code CI: Update coverage collecting
2022-05-05 code CI: Add a build with the minimum requirements
2022-05-05 code CI: Deactivate git 'safe.directory'
2022-03-24 code CI: Update images
2022-05-25 victorien Fix typo
2022-05-19 gramner x86: Add high bit-depth cdef_filter AVX-512 (Ice Lake) asm
2022-05-20 gramner checkasm: Print --help message to stderr instead of stdout
2022-05-20 gramner checkasm: Split cdef test into separate pri/sec/pri+sec parts
2022-05-20 gramner checkasm: Improve benchmarking of functions that modify their input
2022-05-18 b x86/itx_avx2: fix typo
2022-04-22 code CI: Add gcc12 and clang14 builds with mold linker
2022-04-26 code CI: Trigger documentation rebuild if configuration changes
2022-04-24 code meson/doc: Fix doxygen config
2022-04-28 gramner Use a relaxed memory ordering in dav1d_ref_inc()
2022-04-28 gramner Remove redundant code in dav1d_cdf_thread_unref()
2022-04-28 gramner Inline dav1d_ref_inc()
2022-04-24 code x86/itx: Add 32x8 12bpc AVX2 transforms
2022-04-24 code x86/itx: Add 8x32 12bpc AVX2 transforms
2022-04-24 code x86/itx: Deduplicate dconly code
2022-04-23 code lib: Fix typo in documentation
2022-04-07 jamrial obu: don't output invisible but showable key frames more than once
2022-04-07 jamrial obu: check that the frame referenced by existing_frame_idx is showable
2022-04-07 jamrial obu: check refresh_frame_flags is not equal to allFrames on Intra Only frames
2022-03-29 robux4 remove multipass wait from dav1d_decode_frame
2022-04-07 jamrial picture: ensure the new seq header and op param info flags are attached to the next visible picture in display order
2022-03-31 jamrial lib: add a function to query the decoder frame delay
2022-03-31 jamrial lib: split calculating thread count to its own function

Created with:
  roll-dep src/third_party/dav1d/libdav1d

Fixed: 1401571

Change-Id: Ic3cef540a87a2cf411abe6071fd4c9963ea61f75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4114163
Reviewed-by: Wan-Teh Chang <wtc@google.com>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1084574}
  • Loading branch information
dalecurtis authored and Chromium LUCI CQ committed Dec 16, 2022
1 parent 601e2e3 commit b0b5c93
Show file tree
Hide file tree
Showing 20 changed files with 79 additions and 72 deletions.
2 changes: 1 addition & 1 deletion DEPS
Expand Up @@ -1096,7 +1096,7 @@ deps = {
Var('chromium_git') + '/external/github.com/chromium/content_analysis_sdk.git' + '@' + '3d3f3d6f27288d7b0628ae5259238162c5e5ae76',

'src/third_party/dav1d/libdav1d':
Var('chromium_git') + '/external/github.com/videolan/dav1d.git' + '@' + '87f9a81cd770e49394a45deca7a3df41243de00b',
Var('chromium_git') + '/external/github.com/videolan/dav1d.git' + '@' + 'ed63a7459376a21e88b871006574dc2055a2ea35',

'src/third_party/dawn':
Var('dawn_git') + '/dawn.git' + '@' + Var('dawn_revision'),
Expand Down
34 changes: 2 additions & 32 deletions third_party/dav1d/BUILD.gn
Expand Up @@ -17,7 +17,8 @@ if (is_win) {
assert(current_cpu == "x64" && (is_linux || is_chromeos),
"Only Linux X64 MSAN is supported")
platform_config_root = "config/linux-noasm/$current_cpu"
} else if (current_cpu == "riscv64" || current_cpu == "loong64") {
} else if (current_cpu == "riscv64" || current_cpu == "loong64" ||
current_cpu == "ppc64") {
platform_config_root = "config/linux-noasm/generic"
} else {
# Linux configuration files seem to work on Mac, so just reuse them.
Expand Down Expand Up @@ -202,8 +203,6 @@ static_library("dav1d_8bit") {
sources += arm_template_sources
} else if (current_cpu == "arm64") {
sources += arm_template_sources
} else if (current_cpu == "ppc64") {
sources += ppc64_template_sources
}

cflags = dav1d_copts
Expand Down Expand Up @@ -234,8 +233,6 @@ static_library("dav1d_10bit") {
sources += arm_template_sources
} else if (current_cpu == "arm64") {
sources += arm_template_sources
} else if (current_cpu == "ppc64") {
sources += ppc64_template_sources
}

cflags = dav1d_copts
Expand All @@ -249,15 +246,8 @@ if (current_cpu == "x86" || current_cpu == "x64") {
sources = [
"libdav1d/src/x86/cpu.c",
"libdav1d/src/x86/cpu.h",
"libdav1d/src/x86/refmvs_init.c",
]

# x86/msac.h redefines macros in msac.h if x86/msac.h is included and
# HAVE_ASM is 0, so we must exclude msac_init.c if !enable_nasm. Also, it
# is only used for x64.
if (enable_nasm && current_cpu == "x64") {
sources += [ "libdav1d/src/x86/msac_init.c" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
Expand All @@ -273,7 +263,6 @@ if (current_cpu == "x86" || current_cpu == "x64") {
sources = [
"libdav1d/src/arm/cpu.c",
"libdav1d/src/arm/cpu.h",
"libdav1d/src/arm/refmvs_init.c",
]

# These are not template based so should only be built once.
Expand All @@ -296,23 +285,6 @@ if (current_cpu == "x86" || current_cpu == "x64") {

cflags = dav1d_copts

deps = [ ":dav1d_headers" ]
allow_circular_includes_from = [ ":dav1d_headers" ]
}
} else if (current_cpu == "ppc64") {
static_library("dav1d_ppc64") {
sources = [
"libdav1d/src/ppc/cpu.c",
"libdav1d/src/ppc/cpu.h",
]

configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
":dav1d_config",
]
cflags = dav1d_copts

deps = [ ":dav1d_headers" ]
allow_circular_includes_from = [ ":dav1d_headers" ]
}
Expand Down Expand Up @@ -344,7 +316,5 @@ static_library("dav1d") {
}
} else if (current_cpu == "arm" || current_cpu == "arm64") {
deps += [ ":dav1d_arm" ]
} else if (current_cpu == "ppc64") {
deps += [ ":dav1d_ppc64" ]
}
}
5 changes: 4 additions & 1 deletion third_party/dav1d/README.chromium
Expand Up @@ -30,4 +30,7 @@ all the updated configuration files. If not, you'll need to debug the bots :(


-- [ OPEN ISSUES ] ------------------
None at this time.
1. If Windows build fails on Linux, you may need to run:
`build/vs_toolchain.py update` to regenerate FUSE links.
2. If ARM build fails with an error around clock_gettime you likely need to
install gcc-arm-linux-gnueabihf and gcc-aarch64-linux-gnu packages.
4 changes: 4 additions & 0 deletions third_party/dav1d/config/linux-noasm/generic/config.h
Expand Up @@ -27,6 +27,8 @@

#define HAVE_ASM 0

#define HAVE_C11_GENERIC 1

#define HAVE_CLOCK_GETTIME 1

#define HAVE_DLSYM 1
Expand All @@ -38,3 +40,5 @@
#define HAVE_UNISTD_H 1

// #define STACK_ALIGNMENT 32 -- Stack alignment is controlled by Chromium

#define TRIM_DSP_FUNCTIONS 1
4 changes: 4 additions & 0 deletions third_party/dav1d/config/linux-noasm/x64/config.h
Expand Up @@ -27,6 +27,8 @@

#define HAVE_ASM 0

#define HAVE_C11_GENERIC 1

#define HAVE_CLOCK_GETTIME 1

#define HAVE_DLSYM 1
Expand All @@ -38,3 +40,5 @@
#define HAVE_UNISTD_H 1

// #define STACK_ALIGNMENT 32 -- Stack alignment is controlled by Chromium

#define TRIM_DSP_FUNCTIONS 1
6 changes: 6 additions & 0 deletions third_party/dav1d/config/linux/arm/config.h
Expand Up @@ -29,6 +29,8 @@

#define HAVE_AS_FUNC 0

#define HAVE_C11_GENERIC 1

#define HAVE_CLOCK_GETTIME 1

#define HAVE_DLSYM 1
Expand All @@ -40,3 +42,7 @@
// #define HAVE_PTHREAD_GETAFFINITY_NP 1 -- Controlled by Chomium

#define HAVE_UNISTD_H 1

#define PIC 3

#define TRIM_DSP_FUNCTIONS 1
6 changes: 6 additions & 0 deletions third_party/dav1d/config/linux/arm64/config.h
Expand Up @@ -29,6 +29,8 @@

#define HAVE_AS_FUNC 0

#define HAVE_C11_GENERIC 1

#define HAVE_CLOCK_GETTIME 1

#define HAVE_DLSYM 1
Expand All @@ -40,3 +42,7 @@
// #define HAVE_PTHREAD_GETAFFINITY_NP 1 -- Controlled by Chomium

#define HAVE_UNISTD_H 1

#define PIC 3

#define TRIM_DSP_FUNCTIONS 1
4 changes: 4 additions & 0 deletions third_party/dav1d/config/linux/x64/config.h
Expand Up @@ -27,6 +27,8 @@

#define HAVE_ASM 1

#define HAVE_C11_GENERIC 1

#define HAVE_CLOCK_GETTIME 1

#define HAVE_DLSYM 1
Expand All @@ -38,3 +40,5 @@
#define HAVE_UNISTD_H 1

// #define STACK_ALIGNMENT 32 -- Stack alignment is controlled by Chromium

#define TRIM_DSP_FUNCTIONS 1
4 changes: 4 additions & 0 deletions third_party/dav1d/config/linux/x86/config.h
Expand Up @@ -27,6 +27,8 @@

#define HAVE_ASM 1

#define HAVE_C11_GENERIC 1

#define HAVE_CLOCK_GETTIME 1

#define HAVE_DLSYM 1
Expand All @@ -38,3 +40,5 @@
#define HAVE_UNISTD_H 1

// #define STACK_ALIGNMENT 16 -- Stack alignment is controlled by Chromium

#define TRIM_DSP_FUNCTIONS 1
4 changes: 4 additions & 0 deletions third_party/dav1d/config/win/arm64/config.h
Expand Up @@ -29,10 +29,14 @@

#define HAVE_ASM 1

#define HAVE_C11_GENERIC 1

#define HAVE_IO_H 1

// #define STACK_ALIGNMENT 16 -- Stack alignment is controlled by Chromium

#define TRIM_DSP_FUNCTIONS 1

#define UNICODE 1

#define _CRT_DECLARE_NONSTDC_NAMES 1
Expand Down
4 changes: 4 additions & 0 deletions third_party/dav1d/config/win/x64/config.h
Expand Up @@ -29,10 +29,14 @@

#define HAVE_ASM 1

#define HAVE_C11_GENERIC 1

#define HAVE_IO_H 1

// #define STACK_ALIGNMENT 16 -- Stack alignment is controlled by Chromium

#define TRIM_DSP_FUNCTIONS 1

#define UNICODE 1

#define _CRT_DECLARE_NONSTDC_NAMES 1
Expand Down
4 changes: 4 additions & 0 deletions third_party/dav1d/config/win/x86/config.h
Expand Up @@ -29,12 +29,16 @@

#define HAVE_ASM 1

#define HAVE_C11_GENERIC 1

#define HAVE_IO_H 1

#define PREFIX 1

// #define STACK_ALIGNMENT 4 -- Stack alignment is controlled by Chromium

#define TRIM_DSP_FUNCTIONS 1

#define UNICODE 1

#define _CRT_DECLARE_NONSTDC_NAMES 1
Expand Down
2 changes: 1 addition & 1 deletion third_party/dav1d/crossfiles/arm.crossfile
Expand Up @@ -4,7 +4,7 @@ ar = 'llvm-ar'

# Copied from //third_party/ffmpeg's build_ffmpeg.py script. Does not use all
# the cflags listed there since dav1d doesn't currently need such specificity.
[properties]
[built-in options]
c_args = ['-march=armv7-a', '--target=arm-linux-gnueabihf']
c_link_args = ['--target=arm-linux-gnueabihf']

Expand Down
2 changes: 1 addition & 1 deletion third_party/dav1d/crossfiles/arm64.crossfile
Expand Up @@ -4,7 +4,7 @@ ar = 'llvm-ar'

# Copied from //third_party/ffmpeg's build_ffmpeg.py script. Does not use all
# the cflags listed there since dav1d doesn't currently need such specificity.
[properties]
[built-in options]
c_args = ['-march=armv8-a', '--target=aarch64-linux-gnu']
c_link_args = ['--target=aarch64-linux-gnu']

Expand Down
2 changes: 1 addition & 1 deletion third_party/dav1d/crossfiles/linux32.crossfile
Expand Up @@ -2,7 +2,7 @@
c = 'clang'
ar = 'llvm-ar'

[properties]
[built-in options]
c_args = ['-m32']

[host_machine]
Expand Down
30 changes: 5 additions & 25 deletions third_party/dav1d/dav1d_generated.gni
Expand Up @@ -6,6 +6,7 @@

x86_asm_sources = [
"libdav1d/src/x86/cdef16_avx2.asm",
"libdav1d/src/x86/cdef16_avx512.asm",
"libdav1d/src/x86/cdef16_sse.asm",
"libdav1d/src/x86/cdef_avx2.asm",
"libdav1d/src/x86/cdef_avx512.asm",
Expand All @@ -24,11 +25,13 @@ x86_asm_sources = [
"libdav1d/src/x86/ipred_avx512.asm",
"libdav1d/src/x86/ipred_sse.asm",
"libdav1d/src/x86/itx16_avx2.asm",
"libdav1d/src/x86/itx16_avx512.asm",
"libdav1d/src/x86/itx16_sse.asm",
"libdav1d/src/x86/itx_avx2.asm",
"libdav1d/src/x86/itx_avx512.asm",
"libdav1d/src/x86/itx_sse.asm",
"libdav1d/src/x86/loopfilter16_avx2.asm",
"libdav1d/src/x86/loopfilter16_avx512.asm",
"libdav1d/src/x86/loopfilter16_sse.asm",
"libdav1d/src/x86/loopfilter_avx2.asm",
"libdav1d/src/x86/loopfilter_avx512.asm",
Expand All @@ -49,16 +52,7 @@ x86_asm_sources = [
"libdav1d/src/x86/refmvs.asm",
]

x86_template_sources = [
"libdav1d/src/x86/cdef_init_tmpl.c",
"libdav1d/src/x86/filmgrain_init_tmpl.c",
"libdav1d/src/x86/ipred_init_tmpl.c",
"libdav1d/src/x86/itx_init_tmpl.c",
"libdav1d/src/x86/loopfilter_init_tmpl.c",
"libdav1d/src/x86/looprestoration_init_tmpl.c",
"libdav1d/src/x86/mc_init_tmpl.c",
]

x86_template_sources = []
arm32_asm_sources = [
"libdav1d/src/arm/32/cdef.S",
"libdav1d/src/arm/32/cdef16.S",
Expand Down Expand Up @@ -99,21 +93,7 @@ arm64_asm_sources = [
"libdav1d/src/arm/64/refmvs.S",
]

arm_template_sources = [
"libdav1d/src/arm/cdef_init_tmpl.c",
"libdav1d/src/arm/filmgrain_init_tmpl.c",
"libdav1d/src/arm/ipred_init_tmpl.c",
"libdav1d/src/arm/itx_init_tmpl.c",
"libdav1d/src/arm/loopfilter_init_tmpl.c",
"libdav1d/src/arm/looprestoration_init_tmpl.c",
"libdav1d/src/arm/mc_init_tmpl.c",
]

ppc64_template_sources = [
"libdav1d/src/ppc/cdef_init_tmpl.c",
"libdav1d/src/ppc/looprestoration_init_tmpl.c",
]

arm_template_sources = []
template_sources = [
"libdav1d/src/cdef_apply_tmpl.c",
"libdav1d/src/cdef_tmpl.c",
Expand Down
21 changes: 17 additions & 4 deletions third_party/dav1d/generate_configs.py
Expand Up @@ -165,6 +165,19 @@ def GenerateWindowsArm64Config(src_dir):
(r'#define ARCH_AARCH64 0', r'#define ARCH_AARCH64 1')])


def GenerateGenericConfig(src_dir):
generic_dir = 'config/linux-noasm/generic'
if not os.path.exists(generic_dir):
os.makedirs(generic_dir)

shutil.copy(os.path.join(src_dir, 'config.h'), generic_dir)

# Mark architecture as unknown.
RewriteFile(os.path.join(generic_dir, 'config.h'),
[(r'#define ARCH_X86 1', r'#define ARCH_X86 0'),
(r'#define ARCH_X86_64 1', r'#define ARCH_X86_64 0')])


def CopyVersions(src_dir, dest_dir):
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
Expand Down Expand Up @@ -193,8 +206,10 @@ def main():
linux_env['CC'] = 'clang'

GenerateConfig('config/linux/x64', linux_env)
GenerateConfig('config/linux-noasm/x64', linux_env, ['-Denable_asm=false'])
GenerateConfig('config/linux-noasm/generic', linux_env, ['-Denable_asm=false'])

noasm_dir = 'config/linux-noasm/x64'
GenerateConfig(noasm_dir, linux_env, ['-Denable_asm=false'])
GenerateGenericConfig(noasm_dir)

GenerateConfig('config/linux/x86', linux_env,
['--cross-file', '../crossfiles/linux32.crossfile'])
Expand All @@ -203,8 +218,6 @@ def main():
GenerateConfig('config/linux/arm64', linux_env,
['--cross-file', '../crossfiles/arm64.crossfile'])

GenerateConfig('config/linux/ppc64', linux_env)

win_x86_env = SetupWindowsCrossCompileToolchain('x86')
GenerateConfig('config/win/x86', win_x86_env,
['--cross-file', '../crossfiles/win32.crossfile'] + [
Expand Down

0 comments on commit b0b5c93

Please sign in to comment.