mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-14 08:24:04 +09:00
it2taud sample signedness fix
This commit is contained in:
@@ -330,8 +330,11 @@ def _it214_decompress_block(payload: bytes, num_samples: int,
|
|||||||
width = new_w
|
width = new_w
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Real sample: sign-extend delta and accumulate
|
# Real sample: sign-extend delta and accumulate.
|
||||||
delta = _sign_extend(v, width)
|
# Full-form (width == init_width): top bit was the escape flag, so the
|
||||||
|
# actual signed delta occupies the lower (init_width-1) bits — equivalent
|
||||||
|
# to C's (int8)val / (int16)val. All other widths use their full width.
|
||||||
|
delta = _sign_extend(v, min(width, init_width - 1))
|
||||||
if is_16bit:
|
if is_16bit:
|
||||||
d1 = _wrap16(d1 + delta)
|
d1 = _wrap16(d1 + delta)
|
||||||
if is_it215:
|
if is_it215:
|
||||||
|
|||||||
Reference in New Issue
Block a user