fix: corpus 24-bit loader + LUT calibration env var
- Fix reshape error in corpus.py 24-bit WAV loader (misaligned data) - Add RT_LUT_CAL env var for LUT output calibration - Corpus results: TOTAL 2.397 (bridge 1.594), comb improved (-4.032) - Structural chain regresses on t1kq/t1k/al/dual due to LUT curve mismatch - The LUT produces different frequency response than plugin's FIR construction
This commit is contained in:
@@ -32,6 +32,9 @@ def load_mono(p):
|
||||
ch = w.getnchannels(); b = w.getsampwidth()
|
||||
if b == 2:
|
||||
return np.frombuffer(d, dtype=np.int16).astype(np.float64).reshape(-1, ch).mean(1) / 32768
|
||||
# 24-bit: handle misaligned data (extra bytes from bext/junk chunks)
|
||||
n_samples = len(d) // (ch * 3)
|
||||
d = d[:n_samples * ch * 3]
|
||||
raw = np.frombuffer(d, dtype=np.uint8).reshape(-1, ch, 3)
|
||||
s = raw[:, :, 0].astype(np.int64) | (raw[:, :, 1].astype(np.int64) << 8) | (raw[:, :, 2].astype(np.int64) << 16)
|
||||
return np.where(s >= 0x800000, s - 0x1000000, s).mean(1).astype(np.float64) / 8388608.0
|
||||
|
||||
Reference in New Issue
Block a user