struct {D,R}av1d{Sequence,Frame}Header
: Replace Rav1dRef
s with Option<Arc<DRav1d<_, _>>>
s
#663
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As these types are heavily used unlike the other
Rav1dRef
ed types,impl Deref for DRav1d
is added,deref
ing toR
as that's the type used primarily in Rust.And to simplify uses and avoid triple derefs (including an
Arc
deref andOption::unwrap
) at use sites, alet {frame,seq}_hdr = &***{f,c}.{frame,seq}_hdr.as_ref().unwrap();
is refactored out in eachfn
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, theseRav1dRef
s were pooled, which theArc
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 ofArc
should be similar enough to a pooledArc
(e.x.refpool
) that we can switch to it later if perf demands it.