for i in 0..31 {
offs[i + 1] = offs[i] + counts[i];
}
- let mut dst = vec![Pixel16(0); arr.len()];
+ let mut dst = [Pixel16(0); 16];
+ assert!(dst.len() >= arr.len());
for pix in arr.iter() {
let (r, g, b) = pix.unpack();
let idx = match component {
dst[offs[idx]] = *pix;
offs[idx] += 1;
}
- arr.copy_from_slice(dst.as_slice());
+ let len = arr.len();
+ arr.copy_from_slice(&dst[..len]);
}
fn max_dist_component(min: &Self, max: &Self) -> usize {
let (r0, g0, b0) = max.unpack();
};
//test_encoding_to_file(&dec_config, &enc_config, enc_params);
test_encoding_md5(&dec_config, &enc_config, enc_params,
- &[0x8f0d3f66, 0xb91a6ee5, 0x59e4933e, 0x59c6fb0b]);
+ &[0x0fc27a11, 0x04337f5d, 0xb8037362, 0xc4f69d8b]);
}
}