audio/mpc: newV split in two halves (newVEven, newVOdd): as one function its native lowering failed register allocation and it ran interpreted

This commit is contained in:
4DBug committed 2026-11-01 18:20:23 -06:00
1 parent 01c044805f
commit 9e7d159af8
5 files changed
+904 -865

No files matched your search

+14 -1
View File
@@ -171,7 +171,9 @@ end
-- mpc_compute_new_V: 32 subband samples Y[y .. y + 31] -> 64 V values at V[o .. o + 63] (the ISO 11172-3 matrixing
-- through Byeong Gi Lee's fast DCT)
local function newV(Y: { number }, y: number, V: { number }, o: number)
-- (two halves: as one function, its native lowering fails register allocation and the whole function runs
-- interpreted)
local function newVEven(Y: { number }, y: number, V: { number }, o: number)
local A00 = Y[y] + Y[y + 31]
local A01 = Y[y + 1] + Y[y + 30]
local A02 = Y[y + 2] + Y[y + 29]
@@ -273,6 +275,12 @@ local function newV(Y: { number }, y: number, V: { number }, o: number)
t = -(A12 + A14 + A15)
V[o + 46] = t - A08
V[o + 42] = t - A10 - A11
end
local function newVOdd(Y: { number }, y: number, V: { number }, o: number)
local A00, A01, A02, A03, A04, A05, A06, A07, A08, A09, A10, A11, A12, A13, A14, A15
local B00, B01, B02, B03, B04, B05, B06, B07, B08, B09, B10, B11, B12, B13, B14, B15
local t
A00 = (Y[y] - Y[y + 31]) * 0.5006030202
A01 = (Y[y + 1] - Y[y + 30]) * 0.5054709315
A02 = (Y[y + 2] - Y[y + 29]) * 0.5154473186
@@ -384,6 +392,11 @@ local function newV(Y: { number }, y: number, V: { number }, o: number)
V[o + 96 - i] = V[o + i]
end
end
local function newV(Y: { number }, y: number, V: { number }, o: number)
newVEven(Y, y, V, o)
newVOdd(Y, y, V, o)
end
export type State = {
version: number,
maxBand: number,