-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
struct {D,R}av1d{Sequence,Frame}Header
: Replace Rav1dRef
s with `O…
…ption<Arc<DRav1d<_, _>>>`s (#663) As these types are heavily used unlike the other `Rav1dRef`ed types, `impl Deref for DRav1d` is added, `deref`ing to `R` as that's the type used primarily in Rust. And to simplify uses and avoid triple derefs (including an `Arc` deref and `Option::unwrap`) at use sites, a `let {frame,seq}_hdr = &***{f,c}.{frame,seq}_hdr.as_ref().unwrap();` is refactored out in each `fn` where it's used. Furthermore, similarly to #661, `.update_rav1d()`s are skipped. Although these types are indeed read, they are meant to be read-only, so this should be okay to do. Unlike the previous `Arc`ified types in #659 and #661, these `Rav1dRef`s were pooled, which the `Arc` replacement is not. However, those pools were not thread-local, so it's not clear if it is a perf regression to remove them (we'll check). Either way, the API of `Arc` should be similar enough to a pooled `Arc` (e.x. [`refpool`](https://docs.rs/refpool)) that we can switch to it later if perf demands it.
- Loading branch information
Showing
17 changed files
with
623 additions
and
712 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.