()
| 543 | |
| 544 | |
| 545 | def test_range_coder_encode2(): |
| 546 | # Use the same concrete entropy model as in the previous example: |
| 547 | probabilities = np.array([0.1, 0.6, 0.3], dtype=np.float64) |
| 548 | model = constriction.stream.model.Categorical(probabilities, perfect=False) |
| 549 | |
| 550 | # Encode an example message using the above `model` for all symbols: |
| 551 | symbols = np.array([0, 2, 1, 2, 0, 2, 0, 2, 1], dtype=np.int32) |
| 552 | encoder = constriction.stream.queue.RangeEncoder() |
| 553 | encoder.encode(symbols, model) |
| 554 | assert np.all(encoder.get_compressed() == |
| 555 | np.array([369323576], dtype=np.uint32)) |
| 556 | |
| 557 | |
| 558 | def test_range_coder_encode3(): |
nothing calls this directly
no test coverage detected