Try sorting
This commit is contained in:
@@ -116,7 +116,10 @@ impl BlockQ4KRle {
|
|||||||
///
|
///
|
||||||
/// The `d`, `dmin`, and `scales` fields are always copied verbatim.
|
/// The `d`, `dmin`, and `scales` fields are always copied verbatim.
|
||||||
pub fn encode(block: &BlockQ4K) -> BlockQ4KRle {
|
pub fn encode(block: &BlockQ4K) -> BlockQ4KRle {
|
||||||
let raw = &block.qs;
|
let mut raw = Vec::from(&block.qs);
|
||||||
|
|
||||||
|
// Sort the raw numbers
|
||||||
|
raw.sort();
|
||||||
|
|
||||||
// Scan the 128-byte raw payload for runs of equal bytes.
|
// Scan the 128-byte raw payload for runs of equal bytes.
|
||||||
let mut pairs: Vec<(u8, u8)> = Vec::with_capacity(64);
|
let mut pairs: Vec<(u8, u8)> = Vec::with_capacity(64);
|
||||||
|
|||||||
Reference in New Issue
Block a user