Skip to content

Commit

Permalink
keep simd type
Browse files Browse the repository at this point in the history
  • Loading branch information
mcroomp committed Jun 11, 2024
1 parent 5714798 commit 89424af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/structs/lepton_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ fn decode_edge<R: Read, const ALL_PRESENT: bool>(
decode_one_edge::<R, ALL_PRESENT, true>(
model_per_color,
bool_reader,
&curr_horiz_pred.to_array(),
&curr_horiz_pred,
here_mut,
qt,
pt,
Expand All @@ -486,7 +486,7 @@ fn decode_edge<R: Read, const ALL_PRESENT: bool>(
decode_one_edge::<R, ALL_PRESENT, false>(
model_per_color,
bool_reader,
&curr_vert_pred.to_array(),
&curr_vert_pred,
here_mut,
qt,
pt,
Expand All @@ -504,7 +504,7 @@ fn decode_edge<R: Read, const ALL_PRESENT: bool>(
fn decode_one_edge<R: Read, const ALL_PRESENT: bool, const HORIZONTAL: bool>(
model_per_color: &mut ModelPerColor,
bool_reader: &mut VPXBoolReader<R>,
pred: &[i32; 8],
pred: &i32x8,
here_mut: &mut AlignedBlock,
qt: &QuantizationTables,
pt: &ProbabilityTables,
Expand All @@ -529,7 +529,7 @@ fn decode_one_edge<R: Read, const ALL_PRESENT: bool, const HORIZONTAL: bool>(

let mut coord_tr = delta;

for lane in 0..7 {
for lane in 1..8 {
if num_non_zeros_edge == 0 {
break;
}
Expand Down
8 changes: 4 additions & 4 deletions src/structs/lepton_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ fn encode_edge<W: Write, const ALL_PRESENT: bool>(
here_tr,
model_per_color,
bool_writer,
&curr_horiz_pred.to_array(),
&curr_horiz_pred,
qt,
pt,
num_non_zeros_bin,
Expand All @@ -512,7 +512,7 @@ fn encode_edge<W: Write, const ALL_PRESENT: bool>(
here_tr,
model_per_color,
bool_writer,
&curr_vert_pred.to_array(),
&curr_vert_pred,
qt,
pt,
num_non_zeros_bin,
Expand All @@ -538,7 +538,7 @@ fn encode_one_edge<W: Write, const ALL_PRESENT: bool, const HORIZONTAL: bool>(
block: &AlignedBlock,
model_per_color: &mut ModelPerColor,
bool_writer: &mut VPXBoolWriter<W>,
pred: &[i32; 8],
pred: &i32x8,
qt: &QuantizationTables,
pt: &ProbabilityTables,
num_non_zeros_bin: u8,
Expand Down Expand Up @@ -586,7 +586,7 @@ fn encode_one_edge<W: Write, const ALL_PRESENT: bool, const HORIZONTAL: bool>(

let mut coord_tr = delta;

for lane in 0..7 {
for lane in 1..8 {
if num_non_zeros_edge == 0 {
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/structs/probability_tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@ impl ProbabilityTables {
&self,
qt: &QuantizationTables,
lane: usize,
pred: &[i32; 8],
pred: &i32x8,
) -> i32 {
if !ALL_PRESENT
&& ((HORIZONTAL && !self.above_present) || (!HORIZONTAL && !self.left_present))
{
return 0;
}

pred[lane + 1] / qt.get_quantization_table_divisors::<HORIZONTAL>()[lane + 1].get()
pred.as_array_ref()[lane] / qt.get_quantization_table_divisors::<HORIZONTAL>()[lane].get()
}

pub fn adv_predict_dc_pix<const ALL_PRESENT: bool>(
Expand Down

0 comments on commit 89424af

Please sign in to comment.