audio perf: resample planar history + shared dot loop, mdct inverse fused unfold + fft index hoisting, AudioOps strided loops / remix term lists, wav sample loops, SILK LPC in locals, upvalue hoisting (Celt, Mpa), --!optimize 2 on every audio module; tools/bench_audio.luau

This commit is contained in:
4DBug committed 2026-11-01 19:00:38 -06:00
1 parent 01c044805f
commit 051aca5b74
98 files changed
+707 -171

No files matched your search

+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Aac/Tables: the AAC-LC tables of ISO/IEC 14496-3 (subpart 4, Annex 4.A): Huffman codebooks, scalefactor
-- band offsets, TNS band limits. Transcribed from FFmpeg libavcodec/aactab.c (tables of the standard, no code; see
-- licenses/NOTICE.md). Generated; do not edit.
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Aac: AAC-LC decoder (ISO/IEC 14496-3 subpart 4, ISO/IEC 13818-7): AudioSpecificConfig, ADTS, raw_data_block.
-- Written from the standard; no third-party code. HE-AAC decodes its AAC-LC core at the core rate. Not supported: Main
-- prediction, LTP, SSR, coupling channels, 960-sample frames, ER / USAC (UNSUPPORTED).
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Ac3/Tables: transcribed from ATSC A/52:2018 section 7.2.3 (bit allocation tables) and section 5.4 (frame
-- sizes); masktab is derived from bndtab / bndsz. No third-party code.
local T = {}
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Ac3: AC-3 (Dolby Digital, ATSC A/52) syncframes: syncinfo / BSI, CRC check and decoder.
-- Written from ATSC A/52:2018; no third-party code. E-AC-3 (bsid 11 .. 16) and bsid 9 / 10 are UNSUPPORTED.
local Err = require("@rosetta/core/Err")
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Adpcm/Decoder: the streaming Types.Decoder over packetised ADPCM (ADX, VAG, BRSTM, raw IMA) with exact seeking.
-- New in rosetta.
local Err = require("@rosetta/core/Err")
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Alac: Apple Lossless (ALAC) decoder and encoder.
-- Written from the ALAC format as Apple published it; no third-party code. ALAC stores C L R ... for 3+ channels; the
-- API uses WAV order.
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Ape: the Monkey's Audio codec (.ape), file versions 3.95 and later.
-- Ported from the Monkey's Audio SDK 13.28 (Matthew T. Ashland, BSD 3-clause since v10, licenses/monkeys-audio-LICENSE.txt):
-- APEHeader.cpp, APEInfo / APEDecompress.cpp. Not supported: pre-3.95 (UNSUPPORTED), the pre-8.50 "interim" 24-bit re-decode.
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/ApeTag: APEv1 / APEv2 tags -> Types.Tags.
-- From the APEv2 specification (wiki.hydrogenaud.io); no third-party code. Items + a 32-byte "APETAGEX" footer, optional
-- 32-byte header (APEv2), before an optional ID3v1 tag.
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Flac: FLAC frames without the container (frame header, subframes, CRC-8 / CRC-16) and the frame encoder.
-- Absorbed from flac-luau 7083d0d; the encoder is new.
local Flac = {
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Hively/Load: AHX ("THX\0".."THX\2") and HivelyTracker ("HVL\0", "HVL\1") module files -> Tune.
-- Ported from hvl2wav replay.c 1.9 (hvl_load_ahx / hvl_reset; BSD-3-Clause, (c) 2006-2018 Pete Gordon;
-- licenses/hivelytracker-LICENSE.txt), with bounds checks the C code does not have.
@@ -1,5 +1,6 @@
--!strict
--!native
--!optimize 2
-- codecs/audio/Hively/Player: the AHX / HivelyTracker replayer and integer mixer, as hvl2wav's replay.c 1.9 computes them.
-- Ported from HivelyTracker (BSD-3-Clause, (c) 2006-2018 Pete Gordon; licenses/hivelytracker-LICENSE.txt). Where the C
-- code reads outside its arrays on bad data this port clamps instead.
@@ -1,5 +1,6 @@
--!strict
--!native
--!optimize 2
-- codecs/audio/Hively/Tables: the AHX / HivelyTracker replayer's waveform, panning, vibrato and period tables.
-- Ported from hvl2wav replay.c 1.9 (BSD-3-Clause, (c) 2006-2018 Pete Gordon; licenses/hivelytracker-LICENSE.txt) as
-- built on 64-bit Linux (`long` is 64-bit: the noise generator's shifts do not wrap at 32 bits).
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Hively: the AHX / HivelyTracker engine (loader, replayer, waveform tables, render glue).
-- A port of hvl2wav replay.c 1.9 (BSD-3-Clause, (c) 2006-2018 Pete Gordon; licenses/hivelytracker-LICENSE.txt); at
-- hvl2wav's settings the output equals its 16-bit samples / 32768. hvl2wav pads a 44.1 kHz speed-multiplier-4 frame to
+53 -35
View File
@@ -83,76 +83,94 @@ end
local function pass(p: number, ido: number, l1: number, ar: { number }, ai: { number }, br: { number }, bi: { number }, tr: { number }, ti: { number }, cr: { number }, ci: { number })
local lp = ido * l1
if p == 4 then
local ido2, ido3, lp2, lp3 = 2 * ido, 3 * ido, 2 * lp, 3 * lp
for k = 0, l1 - 1 do
for i = 0, ido - 1 do
local s = 1 + i + ido * 4 * k
local s = 1 + ido * 4 * k
local d = 1 + ido * k
do -- i = 0: no twiddle
local a0r, a0i = ar[s], ai[s]
local a1r, a1i = ar[s + ido], ai[s + ido]
local a2r, a2i = ar[s + 2 * ido], ai[s + 2 * ido]
local a3r, a3i = ar[s + 3 * ido], ai[s + 3 * ido]
local a2r, a2i = ar[s + ido2], ai[s + ido2]
local a3r, a3i = ar[s + ido3], ai[s + ido3]
local t0r, t0i = a0r + a2r, a0i + a2i
local t1r, t1i = a0r - a2r, a0i - a2i
local t2r, t2i = a1r + a3r, a1i + a3i
local t3r, t3i = a1r - a3r, a1i - a3i
br[d], bi[d] = t0r + t2r, t0i + t2i
br[d + lp], bi[d + lp] = t1r + t3i, t1i - t3r
br[d + lp2], bi[d + lp2] = t0r - t2r, t0i - t2i
br[d + lp3], bi[d + lp3] = t1r - t3i, t1i + t3r
end
for i1 = 2, ido do -- i = i1 - 1
s += 1
d += 1
local a0r, a0i = ar[s], ai[s]
local a1r, a1i = ar[s + ido], ai[s + ido]
local a2r, a2i = ar[s + ido2], ai[s + ido2]
local a3r, a3i = ar[s + ido3], ai[s + ido3]
local t0r, t0i = a0r + a2r, a0i + a2i
local t1r, t1i = a0r - a2r, a0i - a2i
local t2r, t2i = a1r + a3r, a1i + a3i
local t3r, t3i = a1r - a3r, a1i - a3i
local d = 1 + i + ido * k
br[d], bi[d] = t0r + t2r, t0i + t2i
local y1r, y1i = t1r + t3i, t1i - t3r
local y2r, y2i = t0r - t2r, t0i - t2i
local y3r, y3i = t1r - t3i, t1i + t3r
if i == 0 then
br[d + lp], bi[d + lp] = y1r, y1i
br[d + 2 * lp], bi[d + 2 * lp] = y2r, y2i
br[d + 3 * lp], bi[d + 3 * lp] = y3r, y3i
else
local w1r, w1i = tr[i + 1], ti[i + 1]
local w2r, w2i = tr[ido + i + 1], ti[ido + i + 1]
local w3r, w3i = tr[2 * ido + i + 1], ti[2 * ido + i + 1]
br[d + lp], bi[d + lp] = y1r * w1r - y1i * w1i, y1r * w1i + y1i * w1r
br[d + 2 * lp], bi[d + 2 * lp] = y2r * w2r - y2i * w2i, y2r * w2i + y2i * w2r
br[d + 3 * lp], bi[d + 3 * lp] = y3r * w3r - y3i * w3i, y3r * w3i + y3i * w3r
end
local w1r, w1i = tr[i1], ti[i1]
local w2r, w2i = tr[ido + i1], ti[ido + i1]
local w3r, w3i = tr[ido2 + i1], ti[ido2 + i1]
br[d + lp], bi[d + lp] = y1r * w1r - y1i * w1i, y1r * w1i + y1i * w1r
br[d + lp2], bi[d + lp2] = y2r * w2r - y2i * w2i, y2r * w2i + y2i * w2r
br[d + lp3], bi[d + lp3] = y3r * w3r - y3i * w3i, y3r * w3i + y3i * w3r
end
end
elseif p == 2 then
for k = 0, l1 - 1 do
for i = 0, ido - 1 do
local s = 1 + i + ido * 2 * k
local s = 1 + ido * 2 * k
local d = 1 + ido * k
do
local a0r, a0i = ar[s], ai[s]
local a1r, a1i = ar[s + ido], ai[s + ido]
br[d], bi[d] = a0r + a1r, a0i + a1i
br[d + lp], bi[d + lp] = a0r - a1r, a0i - a1i
end
for i1 = 2, ido do
s += 1
d += 1
local a0r, a0i = ar[s], ai[s]
local a1r, a1i = ar[s + ido], ai[s + ido]
local d = 1 + i + ido * k
br[d], bi[d] = a0r + a1r, a0i + a1i
local yr, yi = a0r - a1r, a0i - a1i
if i == 0 then
br[d + lp], bi[d + lp] = yr, yi
else
local wr, wi = tr[i + 1], ti[i + 1]
br[d + lp], bi[d + lp] = yr * wr - yi * wi, yr * wi + yi * wr
end
local wr, wi = tr[i1], ti[i1]
br[d + lp], bi[d + lp] = yr * wr - yi * wi, yr * wi + yi * wr
end
end
elseif p == 3 then
local c = 0.86602540378443864676 -- sin(pi / 3)
local ido2, lp2 = 2 * ido, 2 * lp
for k = 0, l1 - 1 do
for i = 0, ido - 1 do
local s = 1 + i + ido * 3 * k
local s = ido * 3 * k
local d = ido * k
for i1 = 1, ido do
s += 1
d += 1
local a0r, a0i = ar[s], ai[s]
local a1r, a1i = ar[s + ido], ai[s + ido]
local a2r, a2i = ar[s + 2 * ido], ai[s + 2 * ido]
local a2r, a2i = ar[s + ido2], ai[s + ido2]
local tr_, ti_ = a1r + a2r, a1i + a2i
local sr, si = a1r - a2r, a1i - a2i
local d = 1 + i + ido * k
br[d], bi[d] = a0r + tr_, a0i + ti_
local mr, mi = a0r - 0.5 * tr_, a0i - 0.5 * ti_
local y1r, y1i = mr + c * si, mi - c * sr
local y2r, y2i = mr - c * si, mi + c * sr
if i == 0 then
if i1 == 1 then
br[d + lp], bi[d + lp] = y1r, y1i
br[d + 2 * lp], bi[d + 2 * lp] = y2r, y2i
br[d + lp2], bi[d + lp2] = y2r, y2i
else
local w1r, w1i = tr[i + 1], ti[i + 1]
local w2r, w2i = tr[ido + i + 1], ti[ido + i + 1]
local w1r, w1i = tr[i1], ti[i1]
local w2r, w2i = tr[ido + i1], ti[ido + i1]
br[d + lp], bi[d + lp] = y1r * w1r - y1i * w1i, y1r * w1i + y1i * w1r
br[d + 2 * lp], bi[d + 2 * lp] = y2r * w2r - y2i * w2i, y2r * w2i + y2i * w2r
br[d + lp2], bi[d + lp2] = y2r * w2r - y2i * w2i, y2r * w2i + y2i * w2r
end
end
end
+35 -9
View File
@@ -108,16 +108,42 @@ function Mdct.forward(plan: Plan, x: { number }, xi: number, out: { number }, oi
end
function Mdct.inverse(plan: Plan, inp: { number }, ii: number, is: number?, y: { number }, yi: number, scale: number?)
local m = plan.m
local q, m = plan.n // 4, plan.m
local h = m // 2
local c = plan.c
Mdct.dct4(plan, inp, ii, is or 1, c, 1, 1, scale)
-- unfold: y = (C2, -C2 reversed, -C1 reversed, -C1)
for j = 0, h - 1 do
y[yi + j] = c[h + j + 1]
y[yi + h + j] = -c[m - j]
y[yi + m + j] = -c[h - j]
y[yi + 3 * h + j] = -c[j + 1]
local re, im, twc, tws = plan.re, plan.im, plan.twc, plan.tws
local us = is or 1
local sc = scale or 1
for p = 0, q - 1 do
local a, b = inp[ii + 2 * p * us], inp[ii + (m - 1 - 2 * p) * us]
local c, s = twc[p + 1], tws[p + 1]
re[p + 1] = a * c + b * s
im[p + 1] = b * c - a * s
end
Fft.forward(plan.fft, re, im)
-- the DCT-IV output C[j] (j = 2k and M - 1 - 2k) unfolded into y = (C2, -C2 reversed, -C1 reversed, -C1):
-- y[3h - 1 - j] = -C[j]; y[3h + j] = -C[j] (j < h), y[j - h] = C[j] (j >= h)
local b3 = yi + 3 * h
for k = 0, q - 1 do
local c, s = twc[k + 1], tws[k + 1]
local tr, ti = re[k + 1], im[k + 1]
local e = (tr * c + ti * s) * sc -- C[2k]
local o = -(ti * c - tr * s) * sc -- C[M - 1 - 2k]
local j = 2 * k
if j < h then
y[b3 - 1 - j] = -e
y[b3 + j] = -e
else
y[j - h + yi] = e
y[b3 - 1 - j] = -e
end
j = m - 1 - j
if j < h then
y[b3 - 1 - j] = -o
y[b3 + j] = -o
else
y[j - h + yi] = o
y[b3 - 1 - j] = -o
end
end
end
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/MidiRender: the MIDI tempo map, event timeline and the Decoder that plays a Midi through SoundFont.
-- Lengths as python mido computes them. Format 0 / 1: one tempo map from every track, tracks merged (ties keep track
-- order); format 2: each track is its own song, played one after another.
+20
View File
@@ -156,6 +156,7 @@ end
-- layer III side info (L3_read_side_info): fills GR_*, returns main_data_begin or -1
local function readSideInfo(h1: number, h2: number, h3: number): number
local GR_NLONG, GR_NSHORT, GR_RC, GR_SBG, GR_SFB, GR_TS = GR_NLONG, GR_NSHORT, GR_RC, GR_SBG, GR_SFB, GR_TS
local mono = band(h3, 0xC0) == 0xC0
local mpeg1 = band(h1, 8) ~= 0
local srIdx = band(rshift(h2, 2), 3) + (band(rshift(h1, 3), 1) + band(rshift(h1, 4), 1)) * 3
@@ -254,6 +255,7 @@ end
-- L3_read_scalefactors + L3_decode_scalefactors -> SCF[0 .. nLong + nShort)
local function decodeScalefactors(h1: number, h3: number, istOff: number, gr: number, ch: number)
local GR_SBG, ISCF, IST, SCFSIZE = GR_SBG, ISCF, IST, SCFSIZE
local mpeg1 = band(h1, 8) ~= 0
local nLong, nShort = GR_NLONG[gr], GR_NSHORT[gr]
local part = ((if nShort ~= 0 then 1 else 0) + (if nLong == 0 then 1 else 0)) * 28
@@ -335,6 +337,7 @@ end
-- layer III Huffman decoding (L3_huffman) into GRBUF[dst ..], reads MAIN through a 32-bit cache
local function huffman(dst: number, gr: number, limit: number)
local GRBUF, SCF, SFB = GRBUF, SCF, SFB
local b = bsBuf
local one = 0.0
local ireg = 0
@@ -482,6 +485,7 @@ end
-- L3_midside_stereo on GRBUF[left .. left + n) and its right channel at + 576
local function midside(left: number, n: number)
local GRBUF = GRBUF
for i = left * 4, (left + n - 1) * 4, 4 do
local a, c = rf(GRBUF, i), rf(GRBUF, i + 2304)
wf(GRBUF, i, a + c)
@@ -490,6 +494,7 @@ local function midside(left: number, n: number)
end
local function intensityStereo(h1: number, h3: number, gr: number)
local GRBUF, IST, MAXB = GRBUF, IST, MAXB
local mpeg1 = band(h1, 8) ~= 0
local ms = band(h3, 0x20) ~= 0
local nLong, nShort = GR_NLONG[gr], GR_NSHORT[gr]
@@ -559,6 +564,7 @@ local function intensityStereo(h1: number, h3: number, gr: number)
end
local function reorder(g: number, sfb: number)
local GRBUF, SYN = GRBUF, SYN
local src, dst = g, 0
while true do
local len = ru8(SFB, sfb)
@@ -586,6 +592,7 @@ for i = 0, 7 do
end
local function antialias(g: number, nbands: number)
local GRBUF = GRBUF
local o = g * 4
for _ = 1, nbands do
for i = 0, 7 do
@@ -627,6 +634,7 @@ end
-- L3_imdct36: GRBUF[g ..], OVL[ov ..] (float indices), window W (1-based, 18 values)
local function imdct36(g: number, ov: number, W: { number }, nbands: number)
local GRBUF = GRBUF
local w0 = W[1]
local w1 = W[2]
local w2 = W[3]
@@ -739,6 +747,7 @@ end
-- mp3d_DCT_II (scalar path) over the n time slots of a channel at GRBUF[g ..]: t[4][8] in locals
local function dctII(g: number, n: number)
local GRBUF = GRBUF
for k = 0, n - 1 do
local y = (g + k) * 4
local t0_0, t1_0, t2_0, t3_0
@@ -989,6 +998,7 @@ end
-- L3_imdct12: x = TMP f32 index (stride 3), dst buffer + float index, ov = OVL float index
local function imdct12(x: number, dst: buffer, d: number, ov: number)
local TMP = TMP
local xb = x * 4
local x0, x3, x6, x9, x12, x15 =
rf(TMP, xb), rf(TMP, xb + 12), rf(TMP, xb + 24), rf(TMP, xb + 36), rf(TMP, xb + 48), rf(TMP, xb + 60)
@@ -1017,6 +1027,7 @@ local function imdct12(x: number, dst: buffer, d: number, ov: number)
end
local function imdctShort(g: number, ov: number, nbands: number)
local GRBUF = GRBUF
for _ = 1, nbands do
bcopy(TMP, 0, GRBUF, g * 4, 72)
bcopy(GRBUF, g * 4, OVL, ov * 4, 24)
@@ -1085,6 +1096,7 @@ end
-- mp3d_synth_pair: z = SYN float index, dst = PCM float index
local function synthPair(dst: number, nch: number, z: number)
local SYN = SYN
local zb = z * 4
local a = (rf(SYN, zb + 14 * 256) - rf(SYN, zb)) * 29
a += (rf(SYN, zb + 1 * 256) + rf(SYN, zb + 13 * 256)) * 213
@@ -1109,6 +1121,7 @@ end
-- mp3d_synth: two time slots of 32 subbands -> 64 samples per channel
local function synth(xl: number, dstl: number, nch: number, lins: number)
local GRBUF, SYN, WINT = GRBUF, SYN, WINT
local xr = xl + 576 * (nch - 1)
local dstr = dstl + (nch - 1)
local zlin = lins + 15 * 64
@@ -1216,6 +1229,7 @@ local function synth(xl: number, dstl: number, nch: number, lins: number)
end
local function synthGranule(nbands: number, nch: number, pcm: number)
local SYN = SYN
for ch = 0, nch - 1 do
dctII(576 * ch, nbands)
end
@@ -1241,6 +1255,7 @@ local ALLOC_L2M1_LOW = { 44, 4, 2, 44, 3, 10 }
local totalBands, stereoBands = 0, 0
local function l12ReadScaleInfo(h1: number, h2: number, h3: number, kbpsHdr: number)
local BA = BA
local mode = rshift(h3, 6)
local sb = if mode == 3 then 0 elseif mode == 1 then band(rshift(h3, 4), 3) * 4 + 4 else 32
local layer1 = band(h1, 6) == 6
@@ -1331,6 +1346,7 @@ local function l12Dequantize(g: number, groupSize: number): number
end
local function l12ApplyScf(scfOff: number)
local GRBUF = GRBUF
local sb, tb = stereoBands, totalBands
bcopy(GRBUF, (576 + sb * 18) * 4, GRBUF, sb * 18 * 4, (tb - sb) * 18 * 4)
for i = 0, tb - 1 do
@@ -1389,6 +1405,7 @@ function Core.upmix(pcm: buffer, n: number)
end
function Core.decodeFrame(st: State, b: buffer, off: number, size: number, pcm: buffer): number
local FRAME, GRBUF, MAIN = FRAME, GRBUF, MAIN
if size < 4 or size > MAX_FRAME or off < 0 or off + size > buffer.len(b) then
st.needReset = true
return 0
@@ -1476,6 +1493,7 @@ function Core.decodeFrame(st: State, b: buffer, off: number, size: number, pcm:
end
function Core.probeL3(b: buffer, off: number, size: number): (number, number, number)
local FRAME = FRAME
local n = min(size, 64)
if size < 4 or off + n > buffer.len(b) then
return -1, 0, 0
@@ -1500,6 +1518,7 @@ end
-- Layer I / II: minimp3 drops a frame that needs more bits than it has
function Core.probeL12(b: buffer, off: number, size: number): boolean
local FRAME = FRAME
if size < 4 or size > MAX_FRAME or off + size > buffer.len(b) then
return false
end
@@ -1533,6 +1552,7 @@ end
-- mp3dec_check_vbrtag on the frame b[off, off + size): 0 = no tag, -1 = a Xing / Info tag without a frame
-- count, 1 = tag; then frames, encoder delay + 529, padding - 529 (both 0 without a LAME extension)
function Core.vbrTag(b: buffer, off: number, size: number): (number, number, number, number)
local FRAME = FRAME
if size < 12 or size > MAX_FRAME or off + size > buffer.len(b) then
return 0, 0, 0, 0
end
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Mpa/EncTables: the synthesis window D and the layer III Huffman trees of ISO/IEC 11172-3, from PDMP3
-- (public domain / unlicense, Krister Lagerstrom and contributors: licenses/PDMP3-UNLICENSE.txt). Tree entries with a
-- high byte are nodes (high byte: left offset, low byte: right offset), else leaves (x << 4 | y; count1: v w x y bits).
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Mpa/Tables: constant tables of minimp3 (https://github.com/lieff/minimp3, CC0), generated by tools/gen_tables.py.
-- Every list is flattened row-major and 0-based (t[0] is the first element), like the C arrays.
local T = {}
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Mpa: MPEG audio layers I / II / III (ISO/IEC 11172-3, 13818-3, MPEG-2.5) without the file around it.
-- Core is a port of minimp3 by lieff (CC0, licenses/minimp3-CC0.txt), absorbed from mp3-luau c755bbf; the layer II / III
-- encoders are new.
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Musepack/Tables: the Musepack SV7 / SV8 Huffman tables, synthesis window and requantisation constants.
-- Ported from libmpcdec (musepack_src_r475: huffman.c, synth_filter.c, requant.c, mpc_bits_reader.c; BSD-3-Clause,
-- (c) The Musepack Development Team, licenses/libmpcdec-BSD.txt). Huffman tables: flat { code, length, value, ... }
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Musepack: Musepack (MPC) stream versions 7 and 8.
-- A port of libmpcdec (musepack_src_r475: mpc_demux.c, streaminfo.c, mpc_decoder.c; BSD-3-Clause, (c) The Musepack
-- Development Team, licenses/libmpcdec-BSD.txt), gapless like libmpcdec. SV4 - SV6 are UNSUPPORTED.
+23
View File
@@ -193,6 +193,7 @@ local function laplaceDecode(dec: RD.Dec, fs: number, decay: number): number
end
local function unquantCoarseEnergy(st: any, start: number, endb: number, intra: boolean, dec: RD.Dec, C: number, LM: number)
local E_PROB = E_PROB
local oldE = st.oldBandE
local probBase = LM * 84 + (if intra then 42 else 0) -- e_prob_model[LM][intra], 0-based
local coef, beta
@@ -276,6 +277,7 @@ end
-- bit allocation (rate.c)
local function bits2pulses(bandI: number, LM: number, bits: number): number
local CACHE_BITS = CACHE_BITS
local base = CACHE_INDEX[(LM + 1) * NB_EBANDS + bandI + 1]
local lo, hi = 0, CACHE_BITS[base + 1]
bits -= 1
@@ -312,6 +314,7 @@ end
-- clt_compute_allocation + interp_bits2pulses (decoder side)
local function computeAllocation(start: number, endb: number, offsets: { number }, cap: { number }, allocTrim: number,
total: number, pulses: { number }, ebits: { number }, finePriority: { number }, C: number, LM: number, ec: RD.Dec)
local ALLOC, EB, LOG2_FRAC_TABLE = ALLOC, EB, LOG2_FRAC_TABLE
total = imax(total, 0)
local len = NB_EBANDS
local skipStart = start
@@ -541,6 +544,7 @@ end
-- PVQ (cwrs.c, vq.c)
local function cwrsi(n: number, k: number, i: number, iy: { number }): number
local U = U
local yy = 0
local idx = 1
local p, k0, val
@@ -618,6 +622,7 @@ local function cwrsi(n: number, k: number, i: number, iy: { number }): number
end
local function expRotation1(X: number, len: number, stride: number, c: number, s: number)
local W = W
local ms = -s
local p = X + 1
for _ = 0, len - stride - 1 do
@@ -672,6 +677,7 @@ local function expRotation(X: number, len: number, dir: number, stride: number,
end
local function renormaliseVector(X: number, N: number, gain: number)
local W = W
local E = 1e-15
for i = X + 1, X + N do
local v = W[i]
@@ -684,6 +690,7 @@ local function renormaliseVector(X: number, N: number, gain: number)
end
local function algUnquant(X: number, N: number, K: number, spread: number, B: number, dec: RD.Dec, gain: number): number
local U = U
local iy = IY
local ft = U[N * UK + K + 1] + U[N * UK + K + 2]
local Ryy = cwrsi(N, K, decUint(dec, ft), iy)
@@ -734,6 +741,7 @@ local ctx: Ctx = {
}
local function haar1(X: number, N0: number, stride: number)
local W = W
N0 = rshift(N0, 1)
local s = 0.70710678
for i = 0, stride - 1 do
@@ -749,6 +757,7 @@ local function haar1(X: number, N0: number, stride: number)
end
local function deinterleaveHadamard(X: number, N0: number, stride: number, hadamard: boolean)
local W = W
local N = N0 * stride
local tmp = TMP
if hadamard then
@@ -772,6 +781,7 @@ local function deinterleaveHadamard(X: number, N0: number, stride: number, hadam
end
local function interleaveHadamard(X: number, N0: number, stride: number, hadamard: boolean)
local W = W
local N = N0 * stride
local tmp = TMP
if hadamard then
@@ -810,6 +820,7 @@ local function computeQn(N: number, b: number, offset: number, pulseCap: number,
end
local function computeTheta(N: number, b: number, B: number, B0: number, LM: number, stereo: boolean, fill: number)
local ctx = ctx
local i = ctx.i
local ec = ctx.ec
local pulseCap = LOGN[i + 1] + LM * 8
@@ -889,6 +900,7 @@ local function computeTheta(N: number, b: number, B: number, B0: number, LM: num
end
local function quantBandN1(X: number, Y: number, lowbandOut: number): number
local W, ctx = W, ctx
local x = X
local ec = ctx.ec
for _ = 0, (if Y >= 0 then 1 else 0) do
@@ -907,6 +919,7 @@ local function quantBandN1(X: number, Y: number, lowbandOut: number): number
end
local function quantPartition(X: number, N: number, b: number, B: number, lowband: number, LM: number, gain: number, fill: number): number
local CACHE_BITS, W, ctx = CACHE_BITS, W, ctx
local i = ctx.i
local B0 = B
local cm = 0
@@ -999,6 +1012,7 @@ end
local function quantBand(X: number, N: number, b: number, B: number, lowband: number, LM: number, lowbandOut: number,
gain: number, lowbandScratch: number, fill: number): number
local BIT_INTERLEAVE, W = BIT_INTERLEAVE, W
local N0 = N
local NB = N
local B0 = B
@@ -1069,6 +1083,7 @@ local function quantBand(X: number, N: number, b: number, B: number, lowband: nu
end
local function stereoMerge(X: number, Y: number, mid: number, N: number)
local W = W
local xp, side = 0, 0
for j = 1, N do
local y = W[Y + j]
@@ -1097,6 +1112,7 @@ end
local function quantBandStereo(X: number, Y: number, N: number, b: number, B: number, lowband: number, LM: number,
lowbandOut: number, lowbandScratch: number, fill: number): number
local W, ctx = W, ctx
if N == 1 then
return quantBandN1(X, Y, lowbandOut)
end
@@ -1169,6 +1185,7 @@ local function quantAllBands(start: number, endb: number, hasY: boolean, N: numb
pulses: { number }, shortBlocks: boolean, spread: number, dualStereo: boolean, intensity: number,
tfRes: { number }, totalBits: number, balance: number, ec: RD.Dec, LM: number, codedBands: number,
seed: number, disableInv: boolean): number
local EB, W, ctx = EB, W, ctx
local M = lshift(1, LM)
local B = if shortBlocks then M else 1
local normOffset = M * EB[start + 1]
@@ -1278,6 +1295,7 @@ end
local function antiCollapse(st: any, C: number, size: number, LM: number, start: number, endb: number,
collapse: { number }, pulses: { number }, seed: number)
local EB = EB
local logE, prev1logE, prev2logE = st.oldBandE, st.oldLogE, st.oldLogE2
for i = start, endb - 1 do
local N0 = EB[i + 2] - EB[i + 1]
@@ -1318,6 +1336,7 @@ local function antiCollapse(st: any, C: number, size: number, LM: number, start:
end
local function denormaliseBands(X: number, freq: { number }, logE: { number }, eoff: number, start: number, endb: number, M: number, silence: boolean)
local EB = EB
local N = M * SHORT_MDCT
local bound = M * EB[endb + 1]
if silence then
@@ -1349,6 +1368,7 @@ local function denormaliseBands(X: number, freq: { number }, logE: { number }, e
end
local function celtSynthesis(st: any, C: number, CC: number, start: number, effEnd: number, isTransient: boolean, LM: number, silence: boolean, N: number)
local FREQ2, WINDOW = FREQ2, WINDOW
local M = lshift(1, LM)
local B, NB, shift
if isTransient then
@@ -1396,6 +1416,7 @@ end
-- comb_filter, in place on mem (1-based base index of sample 0)
local function combFilter(mem: { number }, base: number, T0: number, T1: number, N: number, g0: number, g1: number,
tapset0: number, tapset1: number, overlap: number)
local COMB_GAINS = COMB_GAINS
if g0 == 0 and g1 == 0 then
return
end
@@ -1527,6 +1548,7 @@ Celt.reset = resetState
-- noise-based concealment (celt_decode_lost, FRAME_PLC_NOISE)
local function decodeLost(st: any, N: number, LM: number)
local EB = EB
local C = st.channels
local start = st.start
local endb = st["end"]
@@ -1582,6 +1604,7 @@ end
-- celt_decode_with_ec (buf nil or len <= 1 conceals)
function Celt.decode(st: any, buf: buffer?, off: number, len: number, pcm: { number }, pbase: number, frameSize: number,
dec: RD.Dec?, accum: boolean): number
local EB = EB
local CC = st.channels
local C = st.stream_channels
local start = st.start
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Opus/CeltTables: from libopus celt/static_modes_float.h and celt/quant_bands.c (BSD, licenses/).
return {
logN400 = {
+39 -22
View File
@@ -1316,35 +1316,52 @@ local function decodeCore(ch: any, ctrl: any, xq: { number }, xo: number, pulses
A_Q12_tmp[6], A_Q12_tmp[7], A_Q12_tmp[8], A_Q12_tmp[9], A_Q12_tmp[10]
local wide = order == 16
local a10, a11, a12, a13, a14, a15 = A_Q12_tmp[11], A_Q12_tmp[12], A_Q12_tmp[13], A_Q12_tmp[14], A_Q12_tmp[15], A_Q12_tmp[16]
-- the last 16 sLPC_Q14 values in locals, newest first (s1 = sLPC_Q14[MAX_LPC_ORDER + i - 1] in C)
local s1, s2, s3, s4, s5, s6, s7, s8 = sLPC_Q14[16], sLPC_Q14[15], sLPC_Q14[14], sLPC_Q14[13], sLPC_Q14[12], sLPC_Q14[11], sLPC_Q14[10], sLPC_Q14[9]
local s9, s10, s11, s12, s13, s14, s15, s16 = sLPC_Q14[8], sLPC_Q14[7], sLPC_Q14[6], sLPC_Q14[5], sLPC_Q14[4], sLPC_Q14[3], sLPC_Q14[2], sLPC_Q14[1]
local half = order // 2
for i = 1, subfr_length do
local j = 16 + i -- 1-based index of sLPC_Q14[MAX_LPC_ORDER + i - 1 (C)] + 1
local pred = order // 2
pred += (sLPC_Q14[j - 1] * a0) // 65536
pred += (sLPC_Q14[j - 2] * a1) // 65536
pred += (sLPC_Q14[j - 3] * a2) // 65536
pred += (sLPC_Q14[j - 4] * a3) // 65536
pred += (sLPC_Q14[j - 5] * a4) // 65536
pred += (sLPC_Q14[j - 6] * a5) // 65536
pred += (sLPC_Q14[j - 7] * a6) // 65536
pred += (sLPC_Q14[j - 8] * a7) // 65536
pred += (sLPC_Q14[j - 9] * a8) // 65536
pred += (sLPC_Q14[j - 10] * a9) // 65536
local pred = half
pred += (s1 * a0) // 65536
pred += (s2 * a1) // 65536
pred += (s3 * a2) // 65536
pred += (s4 * a3) // 65536
pred += (s5 * a4) // 65536
pred += (s6 * a5) // 65536
pred += (s7 * a6) // 65536
pred += (s8 * a7) // 65536
pred += (s9 * a8) // 65536
pred += (s10 * a9) // 65536
if wide then
pred += (sLPC_Q14[j - 11] * a10) // 65536
pred += (sLPC_Q14[j - 12] * a11) // 65536
pred += (sLPC_Q14[j - 13] * a12) // 65536
pred += (sLPC_Q14[j - 14] * a13) // 65536
pred += (sLPC_Q14[j - 15] * a14) // 65536
pred += (sLPC_Q14[j - 16] * a15) // 65536
pred += (s11 * a10) // 65536
pred += (s12 * a11) // 65536
pred += (s13 * a12) // 65536
pred += (s14 * a13) // 65536
pred += (s15 * a14) // 65536
pred += (s16 * a15) // 65536
end
pred = i32(pred)
local v = addSat32(presArr[presOff + i], lshiftSat32(pred, 4))
sLPC_Q14[j] = v
s16 = s15
s15 = s14
s14 = s13
s13 = s12
s12 = s11
s11 = s10
s10 = s9
s9 = s8
s8 = s7
s7 = s6
s6 = s5
s5 = s4
s4 = s3
s3 = s2
s2 = s1
s1 = v
xq[pxq + i - 1] = sat16((mulww(v, Gain_Q10) + 128) // 256)
end
for i = 1, 16 do
sLPC_Q14[i] = sLPC_Q14[subfr_length + i]
end
sLPC_Q14[16], sLPC_Q14[15], sLPC_Q14[14], sLPC_Q14[13], sLPC_Q14[12], sLPC_Q14[11], sLPC_Q14[10], sLPC_Q14[9] = s1, s2, s3, s4, s5, s6, s7, s8
sLPC_Q14[8], sLPC_Q14[7], sLPC_Q14[6], sLPC_Q14[5], sLPC_Q14[4], sLPC_Q14[3], sLPC_Q14[2], sLPC_Q14[1] = s9, s10, s11, s12, s13, s14, s15, s16
pexc += subfr_length
pxq += subfr_length
end
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Opus: the Opus codec (RFC 6716) without its container.
-- A port of the libopus 1.6 decoder (BSD, licenses/libopus-BSD.txt), absorbed from opus-luau dd2b4e5; the CELT encoder is new.
local Opus = {
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Pcm: PCM plumbing shared by audio formats: raw sample formats, streaming Decoders, encoder input sources.
local Err = require("@rosetta/core/Err")
local Bytes = require("@rosetta/core/Bytes")
+70 -34
View File
@@ -105,7 +105,7 @@ type State = {
f: Filter,
step: number, -- M = from / g: the input advance per output frame, in units of 1 / L
L: number, -- to / g
hist: { number },
hist: { { number } }, -- per channel: input frame base + i - 1 at [i]
histFrames: number,
base: number,
inFrames: number,
@@ -115,6 +115,16 @@ type State = {
flush: any,
}
-- dot(x, xi, h, hi, n): sum of x[xi + k] * h[hi + k] for k = 0 .. n - 1, in that order
local function dot(x: { number }, xi: number, h: { number }, hi: number, n: number): number
local acc = 0
local d = xi - hi
for k = hi, hi + n - 1 do
acc += x[k + d] * h[k]
end
return acc
end
local function run(st: State, limitOut: number, out: buffer?): (buffer, number)
local f = st.f
local taps, half, h = f.taps, f.half, f.h
@@ -140,61 +150,78 @@ local function run(st: State, limitOut: number, out: buffer?): (buffer, number)
local b = if out and buffer.len(out) >= bytes then out else buffer.create(bytes)
local exact = f.exact
local phases = f.phases
local x0, x1 = hist[1], hist[2]
local o = 0
for j = j0, jmax - 1 do
local num = j * M
local ip = num // L -- floor(t)
local first = ip - half + 1
local rel = first - base
local num = j0 * M
local ip = num // L -- floor(t)
local ph = num - ip * L -- num mod L
for _ = j0, jmax - 1 do
local rel = ip - half + 1 - base
local kLo = if rel < 0 then -rel else 0
local kHi = taps - 1
if rel + kHi >= histFrames then
kHi = histFrames - 1 - rel
end
local cnt = kHi - kLo + 1
local xi = rel + kLo + 1
if exact then
local hb = (num - ip * L) * taps + 1 -- phase * taps + 1
for c = 0, ch - 1 do
local acc = 0
local hi = (rel + kLo) * ch + c + 1
for k = kLo, kHi do
acc += hist[hi] * h[hb + k]
hi += ch
local hb = ph * taps + kLo + 1
if ch == 2 then
local a0, a1 = 0, 0
local d = xi - hb
for k = hb, hb + cnt - 1 do
local hk = h[k]
a0 += x0[k + d] * hk
a1 += x1[k + d] * hk
end
writef32(b, o, acc)
writef32(b, o, a0)
writef32(b, o + 4, a1)
o += 8
elseif ch == 1 then
writef32(b, o, dot(x0, xi, h, hb, cnt))
o += 4
else
for c = 1, ch do
writef32(b, o, dot(hist[c], xi, h, hb, cnt))
o += 4
end
end
else
local fp = (num - ip * L) / L * phases
local fp = ph / L * phases
local p = floor(fp)
local a = fp - p
local hb = p * taps + 1
local hb = p * taps + kLo + 1
local hb2 = hb + taps
for c = 0, ch - 1 do
local acc, acc2 = 0, 0
local hi = (rel + kLo) * ch + c + 1
for k = kLo, kHi do
local x = hist[hi]
acc += x * h[hb + k]
acc2 += x * h[hb2 + k]
hi += ch
end
for c = 1, ch do
local acc = dot(hist[c], xi, h, hb, cnt)
local acc2 = dot(hist[c], xi, h, hb2, cnt)
writef32(b, o, acc + (acc2 - acc) * a)
o += 4
end
end
ph += M
if ph >= L then
local q = ph // L
ip += q
ph -= q * L
end
end
st.outPos = jmax
local keepFrom = (jmax * M) // L - half + 1
local drop = keepFrom - base
if drop > 0 then
if drop >= histFrames then
st.hist = {}
for c = 1, ch do
hist[c] = {}
end
st.histFrames = 0
st.base = base + histFrames
else
local nh: { number } = table.create((histFrames - drop) * ch) :: any
table.move(hist, drop * ch + 1, histFrames * ch, 1, nh)
st.hist = nh
for c = 1, ch do
local nh: { number } = table.create(histFrames - drop) :: any
table.move(hist[c], drop + 1, histFrames, 1, nh)
hist[c] = nh
end
st.histFrames = histFrames - drop
st.base = base + drop
end
@@ -208,10 +235,15 @@ local function process(self: State, src: buffer, frames: number, out: buffer?):
end
local ch = self.channels
frames = min(floor(frames), buffer.len(src) // (ch * 4))
local hist = self.hist
local p = self.histFrames * ch
for i = 0, frames * ch - 1 do
hist[p + i + 1] = readf32(src, i * 4)
local p = self.histFrames
for c = 1, ch do
local x = self.hist[c]
local o = (c - 1) * 4
local step = ch * 4
for i = p + 1, p + frames do
x[i] = readf32(src, o)
o += step
end
end
self.histFrames += frames
self.inFrames += frames
@@ -250,6 +282,10 @@ function Resample.new(from: number, to: number, channels: number, opts: Options?
local L: number, M: number = ti // g, fi // g
local exact = L <= MAX_EXACT
local phases = if exact then L else INTERP_PHASES
local hist = table.create(channels)
for c = 1, channels do
hist[c] = {}
end
local st: State = {
from = from,
to = to,
@@ -258,7 +294,7 @@ function Resample.new(from: number, to: number, channels: number, opts: Options?
f = if L == 1 and M == 1 then { taps = 2, half = 1, phases = 1, exact = true, h = { 1, 0 } } else makeFilter(to / from, phases, exact, q[1], q[2], cut),
step = M,
L = L,
hist = {},
hist = hist,
histFrames = 0,
base = 0,
inFrames = 0,
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/SoundFont/Fallback: the built-in General MIDI set (generated waveforms per GM family, drum kit on bank 128).
-- No third-party code.
local Parse = require("@rosetta/codecs/audio/SoundFont/Parse")
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/SoundFont/Parse: SoundFont 2.0x (sfbk RIFF) reader, zones merged into regions as TinySoundFont does.
-- After tsf.h v0.9 (MIT, (c) Bernhard Schelling; licenses/TinySoundFont-LICENSE.txt) tsf_load_presets /
-- tsf_region_operator / tsf_region_envtosecs. Unlike tsf.h, initialAttenuation is cB * 0.04 dB (FluidSynth's
@@ -1,5 +1,6 @@
--!strict
--!native
--!optimize 2
-- codecs/audio/SoundFont/Synth: a SoundFont 2 sample synthesizer with MIDI channels.
-- A port of TinySoundFont (tsf.h v0.9, MIT, (c) 2017-2025 Bernhard Schelling, based on SFZero (c) 2012 Steve Folta;
-- licenses/TinySoundFont-LICENSE.txt). Unlike tsf.h, the envelope gain is ramped across each 64-sample block.
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/SoundFont: SoundFont 2 banks and the sample synth that plays MIDI through them.
-- The synth is a port of TinySoundFont (tsf.h v0.9, MIT, (c) 2017-2025 Bernhard Schelling; licenses/TinySoundFont-LICENSE.txt).
local Err = require("@rosetta/core/Err")
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Stream: the streaming Types.Decoder over a packetised codec (gapless trim, seeking with pre-roll).
-- New in rosetta.
local Err = require("@rosetta/core/Err")
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Tracker/Load: helpers mapping other tracker formats' effects onto the engine's S3M / IT or MOD / XM families.
-- Ported from OpenMPT's ModCommand helpers (ConvertModCommand, ConvertToVolCommand, FillInTwoCommands, GetEffectWeight,
-- CPattern::WriteEffect; BSD licence, licenses/openmpt-LICENSE.txt).
@@ -1,5 +1,6 @@
--!strict
--!native
--!optimize 2
-- codecs/audio/Tracker/Mixer: tracker voice mixing (loops, IT sustain loops, IT two-pole resonant filter, click ramps).
-- No third-party code.
local floor, ceil, min = math.floor, math.ceil, math.min
@@ -1,5 +1,6 @@
--!strict
--!native
--!optimize 2
-- codecs/audio/Tracker/Pcm: raw 8 / 16-bit tracker sample data (signed / unsigned, XM / IT 2.15 delta coding,
-- interleaved or planar stereo) <-> f32.
local readu8, readi8, readu16, readi16 = buffer.readu8, buffer.readi8, buffer.readu16, buffer.readi16
@@ -1,5 +1,6 @@
--!strict
--!native
--!optimize 2
-- codecs/audio/Tracker/Player: the tracker sequencer for the MOD, S3M, XM and IT effect families.
-- Written from the format documents (ProTracker 2.3 docs, the XM spec and FT2 behaviour notes, ST3 TECH.DOC, ITTECH.TXT);
-- no third-party code.
@@ -1,5 +1,6 @@
--!strict
--!native
--!optimize 2
-- codecs/audio/Tracker/Tables: tracker lookup tables, from the public format documents (ProTracker 2.3 effect docs,
-- FT2 / XM spec, ST3 TECH.DOC, ITTECH.TXT).
local Tables = {}
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Tracker: the shared tracker engine behind music/mod, s3m, xm and it, and the formats mapped onto them.
-- Written from the format documents (ProTracker 2.3, the XM spec + FT2 behaviour, ST3 TECH.DOC, ITTECH.TXT); libxmp /
-- OpenMPT were used only as reference players for tests.
+1
View File
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Tta: the TTA1 (True Audio) lossless codec.
-- From the TTA1 format description (22-byte header and seek table with CRC-32s, frames of 256 / 245 seconds); no libtta /
-- ffmpeg code (LGPL). Format 2 (password) is UNSUPPORTED.
@@ -1,5 +1,6 @@
--!strict
--!native
--!optimize 2
-- codecs/audio/Vorbis/Setup: the three Vorbis header packets (Vorbis I spec section 4.2).
-- Ported from stb_vorbis 1.22 start_decoder (public domain / MIT, licenses/stb_vorbis-LICENSE.txt). Floor 0 is
-- rejected as unsupported, as stb_vorbis does.
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Vorbis/Tables: the floor 1 inverse dB table (Vorbis I specification section 10.1, as in stb_vorbis 1.22,
-- public domain / MIT, licenses/stb_vorbis-LICENSE.txt).
return table.freeze({
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/Vorbis: the Vorbis I decoder without its container.
-- A Luau port of stb_vorbis 1.22 (public domain / MIT, licenses/stb_vorbis-LICENSE.txt).
local Vorbis = {
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/VorbisComment: Vorbis comment fields ("KEY=value"; Vorbis, Opus, FLAC) <-> Types.Tags.
local VorbisComment = {}
@@ -1,4 +1,5 @@
--!strict
--!optimize 2
-- codecs/audio/WavPack: the WavPack 4 / 5 audio codec (the blocks of .wv files, and of WavPack in Matroska).
-- Ported from WavPack 5.9.0 (David Bryant, BSD 3-clause, licenses/wavpack-LICENSE.txt). Not supported: DSD, pre-4.0
-- streams (version < 0x402).