mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-06 05:28:31 +09:00
did it fix it?
This commit is contained in:
10
it2taud.py
10
it2taud.py
@@ -311,10 +311,12 @@ def _it214_decompress_block(payload: bytes, num_samples: int,
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
elif width < init_width:
|
elif width < init_width:
|
||||||
# Mid form: top `range_count` representable values are escape codes
|
# Mid form: escape codes are in the top half of the unsigned range.
|
||||||
border = (1 << width) - range_count
|
# border = (2^(width-1)) - range_count (= (0x100 >> (9-width)) - 8 per reference).
|
||||||
if v >= border:
|
# Escape if v > border; new width = v - border (adjusted for skip-over-self).
|
||||||
new_w = (v - border) + 1 # 1..range_count
|
border = (1 << (width - 1)) - range_count
|
||||||
|
if v > border:
|
||||||
|
new_w = v - border # 1..range_count
|
||||||
if new_w >= width:
|
if new_w >= width:
|
||||||
new_w += 1
|
new_w += 1
|
||||||
width = new_w
|
width = new_w
|
||||||
|
|||||||
Reference in New Issue
Block a user