CCSDS 121.0-B-3 Lossless Data Compression (Rice/Golomb coding)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

pus: rename test_ functions, fix service_type doc (merlint E330/E410)

+4 -11
+1 -2
lib/rice.ml
··· 16 16 17 17 let config ?(block_size = 16) ?(bits_per_sample = 16) ?rsi () = 18 18 if block_size < 8 || block_size > 64 then 19 - invalid_arg 20 - (Fmt.str "block_size must be in 8..64, got %d" block_size); 19 + invalid_arg (Fmt.str "block_size must be in 8..64, got %d" block_size); 21 20 if bits_per_sample < 1 || bits_per_sample > 32 then 22 21 invalid_arg 23 22 (Fmt.str "bits_per_sample must be in 1..32, got %d" bits_per_sample);
+1 -3
test/interop/libaec/test.ml
··· 17 17 18 18 let hex_of_bytes b = 19 19 let buf = Buffer.create (Bytes.length b * 2) in 20 - Bytes.iter 21 - (fun c -> Buffer.add_string buf (Fmt.str "%02x" (Char.code c))) 22 - b; 20 + Bytes.iter (fun c -> Buffer.add_string buf (Fmt.str "%02x" (Char.code c))) b; 23 21 Buffer.contents buf 24 22 25 23 type vector = {
+2 -6
test/test_rice.ml
··· 141 141 samples; 142 142 let cfg = Rice.config ~block_size:16 ~bits_per_sample:bps () in 143 143 let result = roundtrip ~bps cfg buf in 144 - Alcotest.(check bytes_eq) 145 - (Fmt.str "bps=%d roundtrip" bps) 146 - buf result) 144 + Alcotest.(check bytes_eq) (Fmt.str "bps=%d roundtrip" bps) buf result) 147 145 [ 8; 16; 24; 32 ] 148 146 149 147 (** 8. Known test vector: compress [0,1,2,...,15] with unit delay predictor. We ··· 273 271 ((max_val lsr (j * 8)) land 0xFF) 274 272 done; 275 273 let rmax = roundtrip ~bps cfg bufmax in 276 - Alcotest.(check bytes_eq) 277 - (Fmt.str "single max, bps=%d" bps) 278 - bufmax rmax) 274 + Alcotest.(check bytes_eq) (Fmt.str "single max, bps=%d" bps) bufmax rmax) 279 275 [ 1; 2; 4; 8; 12; 16; 24; 32 ] 280 276 281 277 (** Edge case: maximum sample value (2^bps - 1) for a block. *)