Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mcroomp committed Sep 28, 2024
1 parent 95aaddf commit a520f79
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/structs/lepton_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ pub fn read_coefficient_block<const ALL_PRESENT: bool, R: Read>(

// read how many of these are non-zero, which is used both
// to terminate the loop early and as a predictor for the model
let num_non_zeros_7x7 = model_per_color
.read_non_zero_7x7_count(bool_reader, num_non_zeros_7x7_context_bin)?;
let num_non_zeros_7x7 =
model_per_color.read_non_zero_7x7_count(bool_reader, num_non_zeros_7x7_context_bin)?;

if num_non_zeros_7x7 > 49 {
// most likely a stream or model synchronization error
Expand Down Expand Up @@ -278,13 +278,12 @@ pub fn read_coefficient_block<const ALL_PRESENT: bool, R: Read>(
for (zig49, &coord_tr) in UNZIGZAG_49_TR.iter().enumerate() {
let best_prior_bit_length = u16_bit_length(best_priors[coord_tr as usize]);

let coef = model_per_color
.read_coef(
bool_reader,
zig49,
num_non_zeros_bin,
best_prior_bit_length as usize,
)?;
let coef = model_per_color.read_coef(
bool_reader,
zig49,
num_non_zeros_bin,
best_prior_bit_length as usize,
)?;

if coef != 0 {
// here we calculate the furthest x and y coordinates that have non-zero coefficients
Expand Down Expand Up @@ -340,13 +339,12 @@ pub fn read_coefficient_block<const ALL_PRESENT: bool, R: Read>(
let q0 = qt.get_quantization_table()[0] as i32;
let predicted_dc = pt.adv_predict_dc_pix::<ALL_PRESENT>(&raster, q0, &neighbor_data, features);

let coef = model
.read_dc(
bool_reader,
color_index,
predicted_dc.uncertainty,
predicted_dc.uncertainty2,
)?;
let coef = model.read_dc(
bool_reader,
color_index,
predicted_dc.uncertainty,
predicted_dc.uncertainty2,
)?;

output.set_dc(ProbabilityTables::adv_predict_or_unpredict_dc(
coef,
Expand Down

0 comments on commit a520f79

Please sign in to comment.