Skip to content

Commit

Permalink
fn Lossless::from_array: Add a comment explaining why it's not opti…
Browse files Browse the repository at this point in the history
…mized as much as possible.
  • Loading branch information
kkysen committed Jun 21, 2024
1 parent b30e31c commit 2720efd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/dav1d/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2128,6 +2128,10 @@ impl Lossless {
}

pub fn from_array(a: [bool; RAV1D_MAX_SEGMENTS as usize]) -> Self {
// This could be further optimized quite a bit
// (https://stackoverflow.com/questions/8461126/how-to-create-a-byte-out-of-8-bool-values-and-vice-versa#answer-51750902),
// but since this is only called in `DRav1d` conversions and `mod obu`,
// neither of which are hot, the simpler, more readable code should suffice.
let mut this = Self::empty();
let mut i = 0;
while i < RAV1D_MAX_SEGMENTS {
Expand Down

0 comments on commit 2720efd

Please sign in to comment.