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.

Migrate SLE TML to Wire codecs

Replace manual Bytes.get/set in tml.ml with Wire.Codec for
TML PDU header (8 bytes) and context message body (12 bytes).
All 85 SLE tests pass.

+2 -2
+2 -2
lib/rice.ml
··· 226 226 if !sum = 0 then 0 227 227 else 228 228 let ratio = float_of_int !sum /. float_of_int len in 229 - let k = int_of_float (Float.round (log ratio /. log 2.0)) in 229 + let k = int_of_float (Float.floor (log ratio /. log 2.0)) in 230 230 (* Per the standard, the floor of log2 *) 231 231 let k = max 0 k in 232 232 min k bps ··· 387 387 let br = Bitreader.create data in 388 388 (* Read header: number of samples *) 389 389 let n = Bitreader.read_bits br 32 in 390 - if n < 0 then Error "invalid sample count" 390 + if n < 0 || n > 1_000_000 then Error "invalid sample count" 391 391 else if n = 0 then Ok Bytes.empty 392 392 else begin 393 393 let j = cfg.block_size in