()
| 114 | use super::*; |
| 115 | |
| 116 | fn make_codec() -> Sq8Codec { |
| 117 | let vecs: Vec<Vec<f32>> = (0..50) |
| 118 | .map(|i| vec![i as f32 * 0.1, -(i as f32) * 0.05, 1.0 + i as f32 * 0.02]) |
| 119 | .collect(); |
| 120 | let refs: Vec<&[f32]> = vecs.iter().map(|v| v.as_slice()).collect(); |
| 121 | Sq8Codec::calibrate(&refs, 3) |
| 122 | } |
| 123 | |
| 124 | /// `encode` round-trip: packed_bits in the UQV must match the raw |
| 125 | /// `quantize` output from the underlying codec. |