struct InRange
: Add type that enforces its value is within a const generic range
#1236
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.
fn decode_coefs
is slow #1180.Use it, for now, to optimize
struct SegmentId
(already similarly optimized, but not generically) andfn get_skip_ctx
's return value.Note that we need this for
fn get_skip_ctx
because it is not inlined, and thus the bounds checks usingsctx
aren't removed infn decode_coefs
. It is not inlined becausefn get_skip_ctx
is notBitDepth
-generic, butfn decode_coefs
is. I thinkdav1d
still hadfn get_skip_ctx
inlined because it is manually duplicated with the templating system. But if LLVM thinks it is better not to inline this even with an#[inline]
or even an#[inline(always)]
, and we're still able to propagate information through the return type, I'm inclined to leave it un-inlined.