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

Enable (n)asm rav1d on Mac & Windows via nasm feature #7694

Merged
merged 7 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
3 changes: 2 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4758,14 +4758,15 @@ dependencies = [
[[package]]
name = "rav1d"
version = "1.0.0"
source = "git+https://github.com/rerun-io/rav1d?branch=emilk/dav1d-interface#d3acfb077eac7759f94279ec9a81edd7d0c409ed"
source = "git+https://github.com/rerun-io/rav1d?rev=a9059f6a02e68cf2aba3795cc370c72f695c4730#a9059f6a02e68cf2aba3795cc370c72f695c4730"
dependencies = [
"assert_matches",
"atomig",
"av-data",
"bitflags 2.6.0",
"cc",
"cfg-if",
"cfg_aliases 0.2.1",
"libc",
"nasm-rs",
"parking_lot",
Expand Down
10 changes: 6 additions & 4 deletions crates/store/re_video/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ av1 = ["dep:dav1d"]

## Enable faster native video decoding with assembly.
## You need to install [nasm](https://nasm.us/) to compile with this feature.
# TODO(#7671): this feature flag currently does nothing
# nasm = ["dav1d?/default"] # The default feature set of dav1d has asm enabled
nasm = [] ## TODO(#7671): fix Linux build
# TODO(#7671): this feature flag currently does nothing on Linux.
nasm = [
# The default feature set of our dav1d fork has asm for linux enabled.
"dav1d?/default",
Wumpf marked this conversation as resolved.
Show resolved Hide resolved
]

[dependencies]
re_log.workspace = true
Expand All @@ -52,7 +54,7 @@ thiserror.workspace = true
# If this package fails to build, install `nasm` locally, or build through `pixi`.
# See https://github.com/rerun-io/rav1d/pull/1
# TODO(#7588): publish this fork of rav1d
dav1d = { git = "https://github.com/rerun-io/rav1d", branch = "emilk/dav1d-interface", package = "rav1d", optional = true, default-features = false, features = [
dav1d = { git = "https://github.com/rerun-io/rav1d", rev = "a9059f6a02e68cf2aba3795cc370c72f695c4730", package = "rav1d", optional = true, default-features = false, features = [
# We opt-out of wasm features so we don't need `nasm` installed. It's still pretty fast.
"bitdepth_8",
] }
Expand Down
4 changes: 2 additions & 2 deletions crates/store/re_video/src/decode/av1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ impl SyncDav1dDecoder {
pub fn new() -> Result<Self> {
re_tracing::profile_function!();

// TODO(#7671): enable this warning again when the `nasm` feature actually does something
// TODO(#7671): enable this warning again on Linux when the `nasm` feature actually does something
#[allow(clippy::overly_complex_bool_expr)]
if false && !cfg!(feature = "nasm") {
if !cfg!(target_os = "linux") && !cfg!(feature = "nasm") {
re_log::warn_once!(
"NOTE: native AV1 video decoder is running extra slowly. \
Speed it up by compiling Rerun with the `nasm` feature enabled. \
Expand Down
2 changes: 1 addition & 1 deletion crates/top/rerun-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ default = ["native_viewer", "web_viewer"]

## Enable faster native video decoding with assembly.
## You need to install [nasm](https://nasm.us/) to compile with this feature.
# TODO(#7671): this feature flag currently does nothing
# TODO(#7671): this feature flag currently does nothing on linux.
nasm = ["rerun/nasm"]

## Support spawning a native viewer.
Expand Down
2 changes: 1 addition & 1 deletion crates/top/rerun/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ log = ["dep:env_logger", "dep:log"]

## Enable faster native video decoding with assembly.
## You need to install [nasm](https://nasm.us/) to compile with this feature.
# TODO(#7671): this feature flag currently does nothing
# TODO(#7671): this feature flag currently does nothing on linux.
nasm = ["re_video/nasm"]

## Support spawning a native viewer.
Expand Down
2 changes: 1 addition & 1 deletion rerun_py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extension-module = ["pyo3/extension-module"]

## Enable faster native video decoding with assembly.
## You need to install [nasm](https://nasm.us/) to compile with this feature.
# TODO(#7671): this feature flag currently does nothing
# TODO(#7671): this feature flag currently does nothing on linux.
nasm = ["re_video/nasm"]

## Support serving a web viewer over HTTP with `serve()`.
Expand Down
Loading