diff --git a/src/structs/lepton_decoder.rs b/src/structs/lepton_decoder.rs index 4a25a614..99d86e03 100644 --- a/src/structs/lepton_decoder.rs +++ b/src/structs/lepton_decoder.rs @@ -475,7 +475,7 @@ fn decode_edge( decode_one_edge::( model_per_color, bool_reader, - &curr_horiz_pred.to_array(), + &curr_horiz_pred, here_mut, qt, pt, @@ -486,7 +486,7 @@ fn decode_edge( decode_one_edge::( model_per_color, bool_reader, - &curr_vert_pred.to_array(), + &curr_vert_pred, here_mut, qt, pt, @@ -504,7 +504,7 @@ fn decode_edge( fn decode_one_edge( model_per_color: &mut ModelPerColor, bool_reader: &mut VPXBoolReader, - pred: &[i32; 8], + pred: &i32x8, here_mut: &mut AlignedBlock, qt: &QuantizationTables, pt: &ProbabilityTables, @@ -529,7 +529,7 @@ fn decode_one_edge( let mut coord_tr = delta; - for lane in 0..7 { + for lane in 1..8 { if num_non_zeros_edge == 0 { break; } diff --git a/src/structs/lepton_encoder.rs b/src/structs/lepton_encoder.rs index 5ef16e46..2f7fa476 100644 --- a/src/structs/lepton_encoder.rs +++ b/src/structs/lepton_encoder.rs @@ -500,7 +500,7 @@ fn encode_edge( here_tr, model_per_color, bool_writer, - &curr_horiz_pred.to_array(), + &curr_horiz_pred, qt, pt, num_non_zeros_bin, @@ -512,7 +512,7 @@ fn encode_edge( here_tr, model_per_color, bool_writer, - &curr_vert_pred.to_array(), + &curr_vert_pred, qt, pt, num_non_zeros_bin, @@ -538,7 +538,7 @@ fn encode_one_edge( block: &AlignedBlock, model_per_color: &mut ModelPerColor, bool_writer: &mut VPXBoolWriter, - pred: &[i32; 8], + pred: &i32x8, qt: &QuantizationTables, pt: &ProbabilityTables, num_non_zeros_bin: u8, @@ -586,7 +586,7 @@ fn encode_one_edge( let mut coord_tr = delta; - for lane in 0..7 { + for lane in 1..8 { if num_non_zeros_edge == 0 { break; } diff --git a/src/structs/probability_tables.rs b/src/structs/probability_tables.rs index 9bd50534..db1ee8b7 100644 --- a/src/structs/probability_tables.rs +++ b/src/structs/probability_tables.rs @@ -209,7 +209,7 @@ impl ProbabilityTables { &self, qt: &QuantizationTables, lane: usize, - pred: &[i32; 8], + pred: &i32x8, ) -> i32 { if !ALL_PRESENT && ((HORIZONTAL && !self.above_present) || (!HORIZONTAL && !self.left_present)) @@ -217,7 +217,7 @@ impl ProbabilityTables { return 0; } - pred[lane + 1] / qt.get_quantization_table_divisors::()[lane + 1].get() + pred.as_array_ref()[lane] / qt.get_quantization_table_divisors::()[lane].get() } pub fn adv_predict_dc_pix(