rerun icon indicating copy to clipboard operation
rerun copied to clipboard

Clean up our dav1d-rs/rav1d forks

Open emilk opened this issue 1 year ago • 1 comments

History

In the beginning there was dav1d; a C-library for decoding AV1 video.

dav1d-rs are bindings for the C-library dav1d, so one can use dav1d from Rust.

rav1d is a Rust-port of dav1d. Despite being written in Rust, it does not have a Rust API (https://github.com/memorysafety/rav1d/issues/1252). It only provides a C API (so it can be a drop-in replacement for dav1d`).

We want to be pure Rust as far as possible, so we would prefer not to use dav1d, and instead use rav1d.

@jprochazk put together https://github.com/rerun-io/rav1d-rs to solve this. It is a fork of BOTH rav1d AND dav1d-rs.

In essence, rav1d-rs gets dav1d-rs to talk to rav1d instead of dav1d, making the whole things pure Rust (except for some asm in rav1d).

Now, this is all very confusing, so just to iterate:

  • dav1d: C library to decode AV1 (we don't want this)
  • rav1d: Rust library to decode AV1
  • dav1d-rs: Rust binding for dav1d
  • rav1d-rs: Our Rust bindings for rav1d

Options

  • Option 1: keep working on rav1d-rs
  • Option 2: add proper Rust bindings to rav1d instead (fork and upstream)

Option 1: keep working on rav1d-rs

https://github.com/rerun-io/rav1d-rs is a bit of a mess:

  • It is a fork of dav1d-rs
  • It also has a full copy of the rav1s source code (why? can we use the published crate instead?)
  • It's unclear what parts of dav1d-rs and rav1d has been modified in rav1d-rs
  • It has a bunch of big video test files that we should move to git lfs and rewrite history

I'd like to:

  • Have rav1d-rs be a clone of dav1d-rs OR rav1d, but not both, as that makes diffing very hard
  • Follow https://github.com/rerun-io/rerun_template/
  • Remove binary files from its history
  • Clean up and publish

Option 2: fork rav1d and add Rust bindings to it

We can fork rav1d and add Rust bindings to it, i.e. do:

  • https://github.com/memorysafety/rav1d/issues/1252

I don't know how much work this would be, but this definitely would be the nicest route (though not necessarily the easiest). We could upstream the fix, or keep using our own fork if they are not welcomed (or merged/published quick enough).

emilk avatar Oct 03 '24 06:10 emilk

Good news everyone! I took @jprochazk's code and just added it to rav1d, and it works:

https://github.com/memorysafety/rav1d/pull/1362

This means we don't need our hacky https://github.com/rerun-io/rav1d-rs

Instead we either get the above PR merged, or we publish our own rav1d fork.

emilk avatar Oct 03 '24 16:10 emilk

Closed in favor of:

  • https://github.com/rerun-io/rerun/issues/7588

emilk avatar Oct 04 '24 01:10 emilk