Skip to content

Commit a904088

Browse files
committed
better to iterate columns in inner loop
1 parent 770a5a2 commit a904088

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/decoder/lossless.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ impl<R: Read> Decoder<R> {
130130
}
131131

132132
// calculate rows, using left pixel as predictor
133-
for mcu_x in 1..width {
134-
for mcu_y in 0..height {
133+
for mcu_y in 0..height {
134+
for mcu_x in 1..width {
135135
let diff = differences[i][mcu_y * width + mcu_x];
136136
let prediction = results[i][mcu_y * width + mcu_x - 1] as i32;
137137
let result = ((prediction + diff) & 0xFFFF) as u16; // modulo 2^16

0 commit comments

Comments
 (0)