This commit is contained in:
minjaesong
2026-04-29 15:49:57 +09:00
parent 737b1cebe7
commit d33484c3c8

View File

@@ -327,9 +327,11 @@ def _it214_decompress_block(payload: bytes, num_samples: int,
width = (v & (top_bit - 1)) + 1 width = (v & (top_bit - 1)) + 1
continue continue
# Real sample delta. For full-form the top bit was the escape flag so the # Delta is always cast to the native sample type regardless of current bit-width.
# signed delta is in the lower (init_width-1) bits — same as C's (int8)value. # IT SDK: d1 += (signed char)value — i.e. always 8-bit (or 16-bit) signed cast.
delta = _sign_extend(v, min(width, init_width - 1)) # Upper-half short-form values (v > escape midpoint) are larger *positive* deltas,
# not negatives; _sign_extend(v, width) would wrongly negate them.
delta = _sign_extend(v, init_width - 1)
if is_16bit: if is_16bit:
d1 = _wrap16(d1 + delta) d1 = _wrap16(d1 + delta)
if is_it215: if is_it215: