merge master
This commit is contained in:
commit
62fcfa7e93
8 files changed
+1449
-1345
No files matched your search
+58
-29
@@ -3597,7 +3597,7 @@ end
|
||||
|
||||
local P_audio_mp3_Tags: any = {}
|
||||
do -- audio/mp3/Tags: id3v2Size
|
||||
local Tags = P_audio_mp3_Tags
|
||||
local Tags = {}
|
||||
local band, bor, lshift = bit32.band, bit32.bor, bit32.lshift
|
||||
local ru8 = buffer.readu8
|
||||
local function syncsafe(b: buffer, o: number): number
|
||||
@@ -3621,11 +3621,12 @@ function Tags.id3v2Size(b: buffer, o: number, len: number): number
|
||||
end
|
||||
return size
|
||||
end
|
||||
P_audio_mp3_Tags.id3v2Size = Tags.id3v2Size
|
||||
end
|
||||
|
||||
local P_codecs_audio_Aac: any = {}
|
||||
do -- codecs/audio/Aac: adts
|
||||
local Aac = P_codecs_audio_Aac
|
||||
local Aac = {}
|
||||
local Bits = __include("core/Bits")
|
||||
Aac.RATES = { 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350 }
|
||||
local function objectType(br: Bits.BitReader): number
|
||||
@@ -3674,11 +3675,12 @@ function Aac.adts(b: buffer, o: number, limit: number): Adts?
|
||||
protected = protected,
|
||||
}
|
||||
end
|
||||
P_codecs_audio_Aac.adts = Aac.adts
|
||||
end
|
||||
|
||||
local P_codecs_audio_Ac3_Tables: any = {}
|
||||
do -- codecs/audio/Ac3/Tables: BITRATES, RATES, frameWords
|
||||
local T = P_codecs_audio_Ac3_Tables
|
||||
local T = {}
|
||||
T.BITRATES = { 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640 }
|
||||
T.RATES = { 48000, 44100, 32000 }
|
||||
function T.frameWords(fscod: number, frmsizecod: number): number
|
||||
@@ -3693,11 +3695,14 @@ function T.frameWords(fscod: number, frmsizecod: number): number
|
||||
end
|
||||
return kbps * 1536000 // 705600 + frmsizecod % 2
|
||||
end
|
||||
P_codecs_audio_Ac3_Tables.BITRATES = T.BITRATES
|
||||
P_codecs_audio_Ac3_Tables.RATES = T.RATES
|
||||
P_codecs_audio_Ac3_Tables.frameWords = T.frameWords
|
||||
end
|
||||
|
||||
local P_codecs_audio_Ac3: any = {}
|
||||
do -- codecs/audio/Ac3: header
|
||||
local Ac3 = P_codecs_audio_Ac3
|
||||
local Ac3 = {}
|
||||
local T = P_codecs_audio_Ac3_Tables
|
||||
local readu8 = buffer.readu8
|
||||
local NFCHANS = { [0] = 2, 1, 2, 3, 3, 4, 4, 5 }
|
||||
@@ -3766,22 +3771,24 @@ function Ac3.header(b: buffer, o: number, limit: number): Header?
|
||||
bsid = bsid,
|
||||
}
|
||||
end
|
||||
P_codecs_audio_Ac3.header = Ac3.header
|
||||
end
|
||||
|
||||
local P_codecs_audio_Mpa_Tables: any = {}
|
||||
do -- codecs/audio/Mpa/Tables: halfrate
|
||||
local T = P_codecs_audio_Mpa_Tables
|
||||
local T = {}
|
||||
T.halfrate = { [0] = 0,
|
||||
4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 72, 80, 0, 4, 8, 12, 16, 20, 24, 28, 32, 40,
|
||||
48, 56, 64, 72, 80, 0, 16, 24, 28, 32, 40, 48, 56, 64, 72, 80, 88, 96, 112, 128, 0, 16, 20, 24,
|
||||
28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 0, 16, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128,
|
||||
160, 192, 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224,
|
||||
}
|
||||
P_codecs_audio_Mpa_Tables.halfrate = T.halfrate
|
||||
end
|
||||
|
||||
local P_codecs_audio_Mpa_Header: any = {}
|
||||
do -- codecs/audio/Mpa/Header: compare, frameBytes, padding, valid
|
||||
local H = P_codecs_audio_Mpa_Header
|
||||
local H = {}
|
||||
local T = P_codecs_audio_Mpa_Tables
|
||||
local band, bxor, rshift = bit32.band, bit32.bxor, bit32.rshift
|
||||
local ru8 = buffer.readu8
|
||||
@@ -3849,11 +3856,15 @@ function H.padding(b: buffer, o: number): number
|
||||
end
|
||||
return if band(ru8(b, o + 1), 6) == 6 then 4 else 1
|
||||
end
|
||||
P_codecs_audio_Mpa_Header.compare = H.compare
|
||||
P_codecs_audio_Mpa_Header.frameBytes = H.frameBytes
|
||||
P_codecs_audio_Mpa_Header.padding = H.padding
|
||||
P_codecs_audio_Mpa_Header.valid = H.valid
|
||||
end
|
||||
|
||||
local P_codecs_audio_Musepack: any = {}
|
||||
do -- codecs/audio/Musepack: magic
|
||||
local Musepack = P_codecs_audio_Musepack
|
||||
local Musepack = {}
|
||||
function Musepack.magic(buf: buffer, p: number, limit: number): number
|
||||
if p + 4 > limit then
|
||||
return 0
|
||||
@@ -3867,15 +3878,17 @@ function Musepack.magic(buf: buffer, p: number, limit: number): number
|
||||
end
|
||||
return 0
|
||||
end
|
||||
P_codecs_audio_Musepack.magic = Musepack.magic
|
||||
end
|
||||
|
||||
local P_codecs_audio_SoundFont: any = {}
|
||||
do -- codecs/audio/SoundFont: sniff
|
||||
local SoundFont = P_codecs_audio_SoundFont
|
||||
local SoundFont = {}
|
||||
local Bytes = __include("core/Bytes")
|
||||
function SoundFont.sniff(r: Bytes.Reader): boolean
|
||||
return r:peek(4) == "RIFF" and r:peek(4, 8) == "sfbk"
|
||||
end
|
||||
P_codecs_audio_SoundFont.sniff = SoundFont.sniff
|
||||
end
|
||||
|
||||
local P_codecs_compress_Brotli = lazy(function()
|
||||
@@ -3888,7 +3901,7 @@ end)
|
||||
|
||||
local P_codecs_compress_Deflate: any = {}
|
||||
do -- codecs/compress/Deflate: peek
|
||||
local Deflate = P_codecs_compress_Deflate
|
||||
local Deflate = {}
|
||||
local Err = __include("core/Err")
|
||||
local Bytes = __include("core/Bytes")
|
||||
local Inflate = P_codecs_compress_Deflate_Inflate
|
||||
@@ -3961,6 +3974,7 @@ function Deflate.peek(buf: buffer | string, offset: number?, length: number?, n:
|
||||
end
|
||||
return shrink(out, k), nil
|
||||
end
|
||||
P_codecs_compress_Deflate.peek = Deflate.peek
|
||||
end
|
||||
|
||||
local P_codecs_compress_Zstd_Decode = lazy(function()
|
||||
@@ -3969,7 +3983,7 @@ end)
|
||||
|
||||
local P_codecs_compress_Zstd: any = {}
|
||||
do -- codecs/compress/Zstd: MAGIC, decompress
|
||||
local Zstd = P_codecs_compress_Zstd
|
||||
local Zstd = {}
|
||||
local Err = __include("core/Err")
|
||||
local Bytes = __include("core/Bytes")
|
||||
local Decode = P_codecs_compress_Zstd_Decode
|
||||
@@ -3999,11 +4013,13 @@ function Zstd.decompress(buf: buffer | string, offset: number?, length: number?,
|
||||
end
|
||||
return out, consumed
|
||||
end
|
||||
P_codecs_compress_Zstd.MAGIC = Zstd.MAGIC
|
||||
P_codecs_compress_Zstd.decompress = Zstd.decompress
|
||||
end
|
||||
|
||||
local P_codecs_text_KeyValues_Binary: any = {}
|
||||
do -- codecs/text/KeyValues/Binary: sniff
|
||||
local Binary = P_codecs_text_KeyValues_Binary
|
||||
local Binary = {}
|
||||
local readu8, readu32, readi32, readf32 = buffer.readu8, buffer.readu32, buffer.readi32, buffer.readf32
|
||||
function Binary.sniff(b: buffer, o: number, n: number): boolean
|
||||
if n < 3 then
|
||||
@@ -4023,18 +4039,20 @@ function Binary.sniff(b: buffer, o: number, n: number): boolean
|
||||
end
|
||||
return false
|
||||
end
|
||||
P_codecs_text_KeyValues_Binary.sniff = Binary.sniff
|
||||
end
|
||||
|
||||
local P_codecs_text_KeyValues: any = {}
|
||||
do -- codecs/text/KeyValues: isBinary
|
||||
local KeyValues = P_codecs_text_KeyValues
|
||||
local KeyValues = {}
|
||||
local Binary = P_codecs_text_KeyValues_Binary
|
||||
KeyValues.isBinary = Binary.sniff
|
||||
P_codecs_text_KeyValues.isBinary = KeyValues.isBinary
|
||||
end
|
||||
|
||||
local P_codecs_text_Nbt_Value: any = {}
|
||||
do -- codecs/text/Nbt/Value: NAMES
|
||||
local Value = P_codecs_text_Nbt_Value
|
||||
local Value = {}
|
||||
Value.NAMES = {
|
||||
[0] = "end",
|
||||
"byte",
|
||||
@@ -4054,11 +4072,12 @@ Value.IDS = {} :: { [string]: number }
|
||||
for id = 0, 12 do
|
||||
Value.IDS[Value.NAMES[id]] = id
|
||||
end
|
||||
P_codecs_text_Nbt_Value.NAMES = Value.NAMES
|
||||
end
|
||||
|
||||
local P_codecs_text_Nbt: any = {}
|
||||
do -- codecs/text/Nbt: peek
|
||||
local Nbt = P_codecs_text_Nbt
|
||||
local Nbt = {}
|
||||
local Deflate = P_codecs_compress_Deflate
|
||||
local Value = P_codecs_text_Nbt_Value
|
||||
type Peek = {
|
||||
@@ -4146,11 +4165,12 @@ function Nbt.peek(buf: buffer, offset: number?, length: number?): Peek?
|
||||
end
|
||||
return at(0, "big", false) or at(0, "little", false)
|
||||
end
|
||||
P_codecs_text_Nbt.peek = Nbt.peek
|
||||
end
|
||||
|
||||
local P_codecs_text_Text: any = {}
|
||||
do -- codecs/text/Text: toUtf8, trim, utf16
|
||||
local Text = P_codecs_text_Text
|
||||
local Text = {}
|
||||
function Text.utf8char(c: number): string
|
||||
local char = string.char
|
||||
if c < 0x80 then
|
||||
@@ -4218,11 +4238,14 @@ function Text.toUtf8(text: string, warnings: { string }?): string
|
||||
end
|
||||
return table.concat(out)
|
||||
end
|
||||
P_codecs_text_Text.toUtf8 = Text.toUtf8
|
||||
P_codecs_text_Text.trim = Text.trim
|
||||
P_codecs_text_Text.utf16 = Text.utf16
|
||||
end
|
||||
|
||||
local P_containers_Fat: any = {}
|
||||
do -- containers/Fat: open
|
||||
local Fat = P_containers_Fat
|
||||
local Fat = {}
|
||||
local readu8, readu16, readu32 = buffer.readu8, buffer.readu16, buffer.readu32
|
||||
type Volume = {
|
||||
b: buffer,
|
||||
@@ -4344,11 +4367,12 @@ function Fat.open(b: buffer, off: number, len: number, opts: OpenOptions?): (Vol
|
||||
end
|
||||
return nil, if o.partition then "no partition " .. o.partition else "no FAT partition"
|
||||
end
|
||||
P_containers_Fat.open = Fat.open
|
||||
end
|
||||
|
||||
local P_containers_IsoBmff: any = {}
|
||||
do -- containers/IsoBmff: sniff
|
||||
local IsoBmff = P_containers_IsoBmff
|
||||
local IsoBmff = {}
|
||||
local Bytes = __include("core/Bytes")
|
||||
local TOP: { [string]: boolean } = {
|
||||
ftyp = true, moov = true, mdat = true, free = true, skip = true, wide = true, pnot = true, moof = true,
|
||||
@@ -4371,11 +4395,12 @@ function IsoBmff.sniff(r: Bytes.Reader): string?
|
||||
end
|
||||
return nil
|
||||
end
|
||||
P_containers_IsoBmff.sniff = IsoBmff.sniff
|
||||
end
|
||||
|
||||
local P_containers_Riff: any = {}
|
||||
do -- containers/Riff: sniff
|
||||
local Riff = P_containers_Riff
|
||||
local Riff = {}
|
||||
function Riff.sniff(r: any): string?
|
||||
local magic = r:peek(4)
|
||||
if magic ~= "RIFF" and magic ~= "RIFX" and magic ~= "RF64" and magic ~= "BW64" then
|
||||
@@ -4384,11 +4409,12 @@ function Riff.sniff(r: any): string?
|
||||
local form = r:peek(4, 8)
|
||||
return if #form == 4 then form else nil
|
||||
end
|
||||
P_containers_Riff.sniff = Riff.sniff
|
||||
end
|
||||
|
||||
local P_containers_Tar: any = {}
|
||||
do -- containers/Tar: valid
|
||||
local Tar = P_containers_Tar
|
||||
local Tar = {}
|
||||
local BLOCK = 512
|
||||
local function zeros(b: buffer, o: number): boolean
|
||||
for i = 0, BLOCK - 1, 4 do
|
||||
@@ -4431,19 +4457,22 @@ function Tar.valid(b: buffer, o: number): boolean
|
||||
local u, s = checksum(b, o)
|
||||
return want == u or want == s
|
||||
end
|
||||
P_containers_Tar.valid = Tar.valid
|
||||
end
|
||||
|
||||
local P_model_fbx_Binary: any = {}
|
||||
do -- model/fbx/Binary: MAGIC
|
||||
local Binary = P_model_fbx_Binary
|
||||
local Binary = {}
|
||||
local MAGIC = "Kaydara FBX Binary \0"
|
||||
Binary.MAGIC = MAGIC
|
||||
P_model_fbx_Binary.MAGIC = Binary.MAGIC
|
||||
end
|
||||
|
||||
local P_model_ms3d_Read: any = {}
|
||||
do -- model/ms3d/Read: MAGIC
|
||||
local Read = P_model_ms3d_Read
|
||||
local Read = {}
|
||||
Read.MAGIC = "MS3D000000"
|
||||
P_model_ms3d_Read.MAGIC = Read.MAGIC
|
||||
end
|
||||
|
||||
do -- image/ani
|
||||
@@ -63628,13 +63657,12 @@ function Decode.decompress(src: buffer, off: number, len: number, maxBytes: numb
|
||||
end
|
||||
local ws = w
|
||||
if wl > 0 then
|
||||
if dict == nil then
|
||||
dict = S.dictionary()
|
||||
if dict == nil then
|
||||
return nil, NO_DICTIONARY
|
||||
end
|
||||
local d = dict or S.dictionary()
|
||||
if d == nil then
|
||||
return nil, NO_DICTIONARY
|
||||
end
|
||||
bcopy(WORD, w, dict, wo, wl)
|
||||
dict = d
|
||||
bcopy(WORD, w, d, wo, wl)
|
||||
w += wl
|
||||
end
|
||||
if ttype == 10 then
|
||||
@@ -164546,9 +164574,10 @@ end
|
||||
|
||||
-- RNA path 'kind["name"].rest': name ends at the first unescaped '"]', rest may hold more subscripts
|
||||
function Anim.split(path: string): (string?, string?, string)
|
||||
local kind, at = string.match(path, '^(%w[%w_%.]-)%["()')
|
||||
local kind, pos = string.match(path, '^(%w[%w_%.]-)%["()')
|
||||
if kind then
|
||||
local i = at :: number
|
||||
local at: number = pos :: any
|
||||
local i = at
|
||||
while true do
|
||||
local q = string.find(path, '"', i, true)
|
||||
if not q then
|
||||
|
||||
+618
-618
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"Core": [[8, "src/Rosetta/init.luau"], [941, "src/Rosetta/Registry.luau"], [3558, "src/Rosetta/Types.luau"], [4675, "src/Rosetta/core/Bytes.luau"], [5202, "src/Rosetta/core/Err.luau"], [5284, "src/Rosetta/core/Input.luau"], [5360, "src/Rosetta/host/init.luau"]],
|
||||
"Detect": [[8, "src/Rosetta/Sniffs.luau"], [4218, "src/Rosetta/core/Bits.luau"], [4511, "src/Rosetta/core/Crc16.luau"], [4563, "src/Rosetta/core/Sniff.luau"]],
|
||||
"Detect": [[8, "src/Rosetta/Sniffs.luau"], [4247, "src/Rosetta/core/Bits.luau"], [4540, "src/Rosetta/core/Crc16.luau"], [4592, "src/Rosetta/core/Sniff.luau"]],
|
||||
"Mpeg2": [[8, "src/Rosetta/codecs/video/Dsp.luau"], [846, "src/Rosetta/codecs/video/Mpeg1/init.luau"], [859, "src/Rosetta/codecs/video/Mpeg2/init.luau"], [1233, "src/Rosetta/codecs/video/Mpeg2/Decoder.luau"], [2760, "src/Rosetta/codecs/video/Mpeg2/Tables.luau"], [2900, "src/Rosetta/codecs/video/Mpeg2/Vlc.luau"]],
|
||||
"H263": [[8, "src/Rosetta/codecs/video/H263/init.luau"], [165, "src/Rosetta/codecs/video/H263/Decoder.luau"], [1023, "src/Rosetta/codecs/video/H263/Tables.luau"]],
|
||||
"H264": [[8, "src/Rosetta/codecs/video/H264/init.luau"], [398, "src/Rosetta/codecs/video/H264/Bitstream.luau"], [673, "src/Rosetta/codecs/video/H264/Cabac.luau"], [1804, "src/Rosetta/codecs/video/H264/Cavlc.luau"], [2572, "src/Rosetta/codecs/video/H264/Deblock.luau"], [2834, "src/Rosetta/codecs/video/H264/Decoder.luau"], [3900, "src/Rosetta/codecs/video/H264/Inter.luau"], [4226, "src/Rosetta/codecs/video/H264/Intra.luau"], [4633, "src/Rosetta/codecs/video/H264/Mb.luau"], [5587, "src/Rosetta/codecs/video/H264/Params.luau"], [6035, "src/Rosetta/codecs/video/H264/Slice.luau"], [6287, "src/Rosetta/codecs/video/H264/Tables.luau"], [6329, "src/Rosetta/codecs/video/H264/Transform.luau"]],
|
||||
@@ -13,7 +13,7 @@
|
||||
"Bcn": [[8, "src/Rosetta/codecs/image/Bcn/init.luau"], [115, "src/Rosetta/codecs/image/Bcn/Decode.luau"], [599, "src/Rosetta/codecs/image/Bcn/Encode.luau"]],
|
||||
"Png": [[8, "src/Rosetta/image/png/init.luau"], [643, "src/Rosetta/image/png/Apng.luau"], [723, "src/Rosetta/image/png/Decode.luau"], [1268, "src/Rosetta/image/png/Encode.luau"]],
|
||||
"Deflate": [[8, "src/Rosetta/codecs/compress/Deflate/init.luau"], [421, "src/Rosetta/codecs/compress/Deflate/Compress.luau"], [903, "src/Rosetta/codecs/compress/Deflate/Inflate.luau"]],
|
||||
"Brotli": [[8, "src/Rosetta/codecs/compress/Brotli/init.luau"], [107, "src/Rosetta/codecs/compress/Brotli/Decode.luau"], [1092, "src/Rosetta/codecs/compress/Brotli/Static.luau"]],
|
||||
"Brotli": [[8, "src/Rosetta/codecs/compress/Brotli/init.luau"], [107, "src/Rosetta/codecs/compress/Brotli/Decode.luau"], [1091, "src/Rosetta/codecs/compress/Brotli/Static.luau"]],
|
||||
"Lzma": [[8, "src/Rosetta/codecs/compress/Lzma/init.luau"], [548, "src/Rosetta/codecs/compress/Lzma/Crc64.luau"], [615, "src/Rosetta/codecs/compress/Lzma/Decode.luau"], [1088, "src/Rosetta/codecs/compress/Lzma/Filters.luau"]],
|
||||
"Zstd": [[8, "src/Rosetta/codecs/compress/Zstd/init.luau"], [65, "src/Rosetta/codecs/compress/Zstd/Decode.luau"], [1049, "src/Rosetta/codecs/compress/Zstd/Xxh64.luau"]],
|
||||
"Mpa": [[8, "src/Rosetta/codecs/audio/Mpa/init.luau"], [23, "src/Rosetta/codecs/audio/Mpa/Analysis.luau"], [82, "src/Rosetta/codecs/audio/Mpa/Core.luau"], [1740, "src/Rosetta/codecs/audio/Mpa/EncTables.luau"], [2033, "src/Rosetta/codecs/audio/Mpa/Encode2.luau"], [2418, "src/Rosetta/codecs/audio/Mpa/Encode3.luau"], [3059, "src/Rosetta/codecs/audio/Mpa/Header.luau"], [3200, "src/Rosetta/codecs/audio/Mpa/Tables.luau"]],
|
||||
@@ -124,7 +124,7 @@
|
||||
"model_3mf": [[8, "src/Rosetta/model/3mf/init.luau"], [90, "src/Rosetta/model/3mf/Read.luau"], [678, "src/Rosetta/model/3mf/Write.luau"]],
|
||||
"model_ase": [[8, "src/Rosetta/model/ase/init.luau"], [131, "src/Rosetta/model/ase/Build.luau"], [705, "src/Rosetta/model/ase/Parse.luau"], [774, "src/Rosetta/model/ase/Write.luau"]],
|
||||
"model_b3d": [[8, "src/Rosetta/model/b3d/init.luau"], [63, "src/Rosetta/model/b3d/Read.luau"]],
|
||||
"model_blend": [[8, "src/Rosetta/model/blend/init.luau"], [108, "src/Rosetta/model/blend/Anim.luau"], [637, "src/Rosetta/model/blend/Armature.luau"], [1173, "src/Rosetta/model/blend/Driver.luau"], [1348, "src/Rosetta/model/blend/Material.luau"], [1700, "src/Rosetta/model/blend/Mesh.luau"], [2388, "src/Rosetta/model/blend/Normals.luau"], [2549, "src/Rosetta/model/blend/Prim.luau"], [3056, "src/Rosetta/model/blend/Read.luau"]],
|
||||
"model_blend": [[8, "src/Rosetta/model/blend/init.luau"], [108, "src/Rosetta/model/blend/Anim.luau"], [638, "src/Rosetta/model/blend/Armature.luau"], [1174, "src/Rosetta/model/blend/Driver.luau"], [1349, "src/Rosetta/model/blend/Material.luau"], [1701, "src/Rosetta/model/blend/Mesh.luau"], [2389, "src/Rosetta/model/blend/Normals.luau"], [2550, "src/Rosetta/model/blend/Prim.luau"], [3057, "src/Rosetta/model/blend/Read.luau"]],
|
||||
"model_bsp": [[8, "src/Rosetta/model/bsp/init.luau"], [199, "src/Rosetta/model/bsp/Lightmap.luau"], [265, "src/Rosetta/model/bsp/Quake.luau"], [654, "src/Rosetta/model/bsp/Quake3.luau"], [883, "src/Rosetta/model/bsp/Tree.luau"]],
|
||||
"model_buildmap": [[8, "src/Rosetta/model/buildmap/init.luau"], [280, "src/Rosetta/model/buildmap/Geometry.luau"]],
|
||||
"model_d3map": [[8, "src/Rosetta/model/d3map/init.luau"], [290, "src/Rosetta/model/d3map/Parse.luau"]],
|
||||
|
||||
+58
-29
@@ -6120,7 +6120,7 @@ end
|
||||
|
||||
local P_audio_mp3_Tags: any = {}
|
||||
do -- audio/mp3/Tags: id3v2Size
|
||||
local Tags = P_audio_mp3_Tags
|
||||
local Tags = {}
|
||||
local band, bor, lshift = bit32.band, bit32.bor, bit32.lshift
|
||||
local ru8 = buffer.readu8
|
||||
local function syncsafe(b: buffer, o: number): number
|
||||
@@ -6144,11 +6144,12 @@ function Tags.id3v2Size(b: buffer, o: number, len: number): number
|
||||
end
|
||||
return size
|
||||
end
|
||||
P_audio_mp3_Tags.id3v2Size = Tags.id3v2Size
|
||||
end
|
||||
|
||||
local P_codecs_audio_Aac: any = {}
|
||||
do -- codecs/audio/Aac: adts
|
||||
local Aac = P_codecs_audio_Aac
|
||||
local Aac = {}
|
||||
local Bits = __include("core/Bits")
|
||||
Aac.RATES = { 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350 }
|
||||
local function objectType(br: Bits.BitReader): number
|
||||
@@ -6197,11 +6198,12 @@ function Aac.adts(b: buffer, o: number, limit: number): Adts?
|
||||
protected = protected,
|
||||
}
|
||||
end
|
||||
P_codecs_audio_Aac.adts = Aac.adts
|
||||
end
|
||||
|
||||
local P_codecs_audio_Ac3_Tables: any = {}
|
||||
do -- codecs/audio/Ac3/Tables: BITRATES, RATES, frameWords
|
||||
local T = P_codecs_audio_Ac3_Tables
|
||||
local T = {}
|
||||
T.BITRATES = { 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640 }
|
||||
T.RATES = { 48000, 44100, 32000 }
|
||||
function T.frameWords(fscod: number, frmsizecod: number): number
|
||||
@@ -6216,11 +6218,14 @@ function T.frameWords(fscod: number, frmsizecod: number): number
|
||||
end
|
||||
return kbps * 1536000 // 705600 + frmsizecod % 2
|
||||
end
|
||||
P_codecs_audio_Ac3_Tables.BITRATES = T.BITRATES
|
||||
P_codecs_audio_Ac3_Tables.RATES = T.RATES
|
||||
P_codecs_audio_Ac3_Tables.frameWords = T.frameWords
|
||||
end
|
||||
|
||||
local P_codecs_audio_Ac3: any = {}
|
||||
do -- codecs/audio/Ac3: header
|
||||
local Ac3 = P_codecs_audio_Ac3
|
||||
local Ac3 = {}
|
||||
local T = P_codecs_audio_Ac3_Tables
|
||||
local readu8 = buffer.readu8
|
||||
local NFCHANS = { [0] = 2, 1, 2, 3, 3, 4, 4, 5 }
|
||||
@@ -6289,22 +6294,24 @@ function Ac3.header(b: buffer, o: number, limit: number): Header?
|
||||
bsid = bsid,
|
||||
}
|
||||
end
|
||||
P_codecs_audio_Ac3.header = Ac3.header
|
||||
end
|
||||
|
||||
local P_codecs_audio_Mpa_Tables: any = {}
|
||||
do -- codecs/audio/Mpa/Tables: halfrate
|
||||
local T = P_codecs_audio_Mpa_Tables
|
||||
local T = {}
|
||||
T.halfrate = { [0] = 0,
|
||||
4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 72, 80, 0, 4, 8, 12, 16, 20, 24, 28, 32, 40,
|
||||
48, 56, 64, 72, 80, 0, 16, 24, 28, 32, 40, 48, 56, 64, 72, 80, 88, 96, 112, 128, 0, 16, 20, 24,
|
||||
28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 0, 16, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128,
|
||||
160, 192, 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224,
|
||||
}
|
||||
P_codecs_audio_Mpa_Tables.halfrate = T.halfrate
|
||||
end
|
||||
|
||||
local P_codecs_audio_Mpa_Header: any = {}
|
||||
do -- codecs/audio/Mpa/Header: compare, frameBytes, padding, valid
|
||||
local H = P_codecs_audio_Mpa_Header
|
||||
local H = {}
|
||||
local T = P_codecs_audio_Mpa_Tables
|
||||
local band, bxor, rshift = bit32.band, bit32.bxor, bit32.rshift
|
||||
local ru8 = buffer.readu8
|
||||
@@ -6372,11 +6379,15 @@ function H.padding(b: buffer, o: number): number
|
||||
end
|
||||
return if band(ru8(b, o + 1), 6) == 6 then 4 else 1
|
||||
end
|
||||
P_codecs_audio_Mpa_Header.compare = H.compare
|
||||
P_codecs_audio_Mpa_Header.frameBytes = H.frameBytes
|
||||
P_codecs_audio_Mpa_Header.padding = H.padding
|
||||
P_codecs_audio_Mpa_Header.valid = H.valid
|
||||
end
|
||||
|
||||
local P_codecs_audio_Musepack: any = {}
|
||||
do -- codecs/audio/Musepack: magic
|
||||
local Musepack = P_codecs_audio_Musepack
|
||||
local Musepack = {}
|
||||
function Musepack.magic(buf: buffer, p: number, limit: number): number
|
||||
if p + 4 > limit then
|
||||
return 0
|
||||
@@ -6390,15 +6401,17 @@ function Musepack.magic(buf: buffer, p: number, limit: number): number
|
||||
end
|
||||
return 0
|
||||
end
|
||||
P_codecs_audio_Musepack.magic = Musepack.magic
|
||||
end
|
||||
|
||||
local P_codecs_audio_SoundFont: any = {}
|
||||
do -- codecs/audio/SoundFont: sniff
|
||||
local SoundFont = P_codecs_audio_SoundFont
|
||||
local SoundFont = {}
|
||||
local Bytes = __include("core/Bytes")
|
||||
function SoundFont.sniff(r: Bytes.Reader): boolean
|
||||
return r:peek(4) == "RIFF" and r:peek(4, 8) == "sfbk"
|
||||
end
|
||||
P_codecs_audio_SoundFont.sniff = SoundFont.sniff
|
||||
end
|
||||
|
||||
local P_codecs_compress_Brotli = lazy(function()
|
||||
@@ -6411,7 +6424,7 @@ end)
|
||||
|
||||
local P_codecs_compress_Deflate: any = {}
|
||||
do -- codecs/compress/Deflate: peek
|
||||
local Deflate = P_codecs_compress_Deflate
|
||||
local Deflate = {}
|
||||
local Err = __include("core/Err")
|
||||
local Bytes = __include("core/Bytes")
|
||||
local Inflate = P_codecs_compress_Deflate_Inflate
|
||||
@@ -6484,6 +6497,7 @@ function Deflate.peek(buf: buffer | string, offset: number?, length: number?, n:
|
||||
end
|
||||
return shrink(out, k), nil
|
||||
end
|
||||
P_codecs_compress_Deflate.peek = Deflate.peek
|
||||
end
|
||||
|
||||
local P_codecs_compress_Zstd_Decode = lazy(function()
|
||||
@@ -6492,7 +6506,7 @@ end)
|
||||
|
||||
local P_codecs_compress_Zstd: any = {}
|
||||
do -- codecs/compress/Zstd: MAGIC, decompress
|
||||
local Zstd = P_codecs_compress_Zstd
|
||||
local Zstd = {}
|
||||
local Err = __include("core/Err")
|
||||
local Bytes = __include("core/Bytes")
|
||||
local Decode = P_codecs_compress_Zstd_Decode
|
||||
@@ -6522,11 +6536,13 @@ function Zstd.decompress(buf: buffer | string, offset: number?, length: number?,
|
||||
end
|
||||
return out, consumed
|
||||
end
|
||||
P_codecs_compress_Zstd.MAGIC = Zstd.MAGIC
|
||||
P_codecs_compress_Zstd.decompress = Zstd.decompress
|
||||
end
|
||||
|
||||
local P_codecs_text_KeyValues_Binary: any = {}
|
||||
do -- codecs/text/KeyValues/Binary: sniff
|
||||
local Binary = P_codecs_text_KeyValues_Binary
|
||||
local Binary = {}
|
||||
local readu8, readu32, readi32, readf32 = buffer.readu8, buffer.readu32, buffer.readi32, buffer.readf32
|
||||
function Binary.sniff(b: buffer, o: number, n: number): boolean
|
||||
if n < 3 then
|
||||
@@ -6546,18 +6562,20 @@ function Binary.sniff(b: buffer, o: number, n: number): boolean
|
||||
end
|
||||
return false
|
||||
end
|
||||
P_codecs_text_KeyValues_Binary.sniff = Binary.sniff
|
||||
end
|
||||
|
||||
local P_codecs_text_KeyValues: any = {}
|
||||
do -- codecs/text/KeyValues: isBinary
|
||||
local KeyValues = P_codecs_text_KeyValues
|
||||
local KeyValues = {}
|
||||
local Binary = P_codecs_text_KeyValues_Binary
|
||||
KeyValues.isBinary = Binary.sniff
|
||||
P_codecs_text_KeyValues.isBinary = KeyValues.isBinary
|
||||
end
|
||||
|
||||
local P_codecs_text_Nbt_Value: any = {}
|
||||
do -- codecs/text/Nbt/Value: NAMES
|
||||
local Value = P_codecs_text_Nbt_Value
|
||||
local Value = {}
|
||||
Value.NAMES = {
|
||||
[0] = "end",
|
||||
"byte",
|
||||
@@ -6577,11 +6595,12 @@ Value.IDS = {} :: { [string]: number }
|
||||
for id = 0, 12 do
|
||||
Value.IDS[Value.NAMES[id]] = id
|
||||
end
|
||||
P_codecs_text_Nbt_Value.NAMES = Value.NAMES
|
||||
end
|
||||
|
||||
local P_codecs_text_Nbt: any = {}
|
||||
do -- codecs/text/Nbt: peek
|
||||
local Nbt = P_codecs_text_Nbt
|
||||
local Nbt = {}
|
||||
local Deflate = P_codecs_compress_Deflate
|
||||
local Value = P_codecs_text_Nbt_Value
|
||||
type Peek = {
|
||||
@@ -6669,11 +6688,12 @@ function Nbt.peek(buf: buffer, offset: number?, length: number?): Peek?
|
||||
end
|
||||
return at(0, "big", false) or at(0, "little", false)
|
||||
end
|
||||
P_codecs_text_Nbt.peek = Nbt.peek
|
||||
end
|
||||
|
||||
local P_codecs_text_Text: any = {}
|
||||
do -- codecs/text/Text: toUtf8, trim, utf16
|
||||
local Text = P_codecs_text_Text
|
||||
local Text = {}
|
||||
function Text.utf8char(c: number): string
|
||||
local char = string.char
|
||||
if c < 0x80 then
|
||||
@@ -6741,11 +6761,14 @@ function Text.toUtf8(text: string, warnings: { string }?): string
|
||||
end
|
||||
return table.concat(out)
|
||||
end
|
||||
P_codecs_text_Text.toUtf8 = Text.toUtf8
|
||||
P_codecs_text_Text.trim = Text.trim
|
||||
P_codecs_text_Text.utf16 = Text.utf16
|
||||
end
|
||||
|
||||
local P_containers_Fat: any = {}
|
||||
do -- containers/Fat: open
|
||||
local Fat = P_containers_Fat
|
||||
local Fat = {}
|
||||
local readu8, readu16, readu32 = buffer.readu8, buffer.readu16, buffer.readu32
|
||||
type Volume = {
|
||||
b: buffer,
|
||||
@@ -6867,11 +6890,12 @@ function Fat.open(b: buffer, off: number, len: number, opts: OpenOptions?): (Vol
|
||||
end
|
||||
return nil, if o.partition then "no partition " .. o.partition else "no FAT partition"
|
||||
end
|
||||
P_containers_Fat.open = Fat.open
|
||||
end
|
||||
|
||||
local P_containers_IsoBmff: any = {}
|
||||
do -- containers/IsoBmff: sniff
|
||||
local IsoBmff = P_containers_IsoBmff
|
||||
local IsoBmff = {}
|
||||
local Bytes = __include("core/Bytes")
|
||||
local TOP: { [string]: boolean } = {
|
||||
ftyp = true, moov = true, mdat = true, free = true, skip = true, wide = true, pnot = true, moof = true,
|
||||
@@ -6894,11 +6918,12 @@ function IsoBmff.sniff(r: Bytes.Reader): string?
|
||||
end
|
||||
return nil
|
||||
end
|
||||
P_containers_IsoBmff.sniff = IsoBmff.sniff
|
||||
end
|
||||
|
||||
local P_containers_Riff: any = {}
|
||||
do -- containers/Riff: sniff
|
||||
local Riff = P_containers_Riff
|
||||
local Riff = {}
|
||||
function Riff.sniff(r: any): string?
|
||||
local magic = r:peek(4)
|
||||
if magic ~= "RIFF" and magic ~= "RIFX" and magic ~= "RF64" and magic ~= "BW64" then
|
||||
@@ -6907,11 +6932,12 @@ function Riff.sniff(r: any): string?
|
||||
local form = r:peek(4, 8)
|
||||
return if #form == 4 then form else nil
|
||||
end
|
||||
P_containers_Riff.sniff = Riff.sniff
|
||||
end
|
||||
|
||||
local P_containers_Tar: any = {}
|
||||
do -- containers/Tar: valid
|
||||
local Tar = P_containers_Tar
|
||||
local Tar = {}
|
||||
local BLOCK = 512
|
||||
local function zeros(b: buffer, o: number): boolean
|
||||
for i = 0, BLOCK - 1, 4 do
|
||||
@@ -6954,19 +6980,22 @@ function Tar.valid(b: buffer, o: number): boolean
|
||||
local u, s = checksum(b, o)
|
||||
return want == u or want == s
|
||||
end
|
||||
P_containers_Tar.valid = Tar.valid
|
||||
end
|
||||
|
||||
local P_model_fbx_Binary: any = {}
|
||||
do -- model/fbx/Binary: MAGIC
|
||||
local Binary = P_model_fbx_Binary
|
||||
local Binary = {}
|
||||
local MAGIC = "Kaydara FBX Binary \0"
|
||||
Binary.MAGIC = MAGIC
|
||||
P_model_fbx_Binary.MAGIC = Binary.MAGIC
|
||||
end
|
||||
|
||||
local P_model_ms3d_Read: any = {}
|
||||
do -- model/ms3d/Read: MAGIC
|
||||
local Read = P_model_ms3d_Read
|
||||
local Read = {}
|
||||
Read.MAGIC = "MS3D000000"
|
||||
P_model_ms3d_Read.MAGIC = Read.MAGIC
|
||||
end
|
||||
|
||||
do -- image/ani
|
||||
@@ -40146,13 +40175,12 @@ end
|
||||
end
|
||||
local ws = w
|
||||
if wl > 0 then
|
||||
if dict == nil then
|
||||
dict = S.dictionary()
|
||||
if dict == nil then
|
||||
return nil, NO_DICTIONARY
|
||||
end
|
||||
local d = dict or S.dictionary()
|
||||
if d == nil then
|
||||
return nil, NO_DICTIONARY
|
||||
end
|
||||
bcopy(WORD, w, dict, wo, wl)
|
||||
dict = d
|
||||
bcopy(WORD, w, d, wo, wl)
|
||||
w += wl
|
||||
end
|
||||
if ttype == 10 then
|
||||
@@ -166834,9 +166862,10 @@ end
|
||||
|
||||
-- RNA path 'kind["name"].rest': name ends at the first unescaped '"]', rest may hold more subscripts
|
||||
function Anim.split(path: string): (string?, string?, string)
|
||||
local kind, at = string.match(path, '^(%w[%w_%.]-)%["()')
|
||||
local kind, pos = string.match(path, '^(%w[%w_%.]-)%["()')
|
||||
if kind then
|
||||
local i = at :: number
|
||||
local at: number = pos :: any
|
||||
local i = at
|
||||
while true do
|
||||
local q = string.find(path, '"', i, true)
|
||||
if not q then
|
||||
|
||||
+89
-44
@@ -677,10 +677,6 @@ local Bytes = __include("core/Bytes")
|
||||
local Input = __include("core/Input")
|
||||
local Types = __include("Types")
|
||||
local Registry = __include("Registry")
|
||||
local Video = __include("codecs/video/Video")
|
||||
local AudioWrap = __include("containers/AudioWrap")
|
||||
local Rbx = __include("codecs/model/Rbx")
|
||||
local ImageOps = __include("ops/ImageOps")
|
||||
local host = __include("host")
|
||||
|
||||
local F = {}
|
||||
@@ -689,7 +685,6 @@ F.version = "0.1.0"
|
||||
F.Err = Err
|
||||
F.Types = Types
|
||||
F.Bytes = Bytes
|
||||
F.Rbx = Rbx
|
||||
F.null = Types.null
|
||||
F.host = host
|
||||
F.plugins = {}
|
||||
@@ -1008,7 +1003,7 @@ end
|
||||
-- api hooks (a format never requires another format): opts.decodeImage / encodeImage, opts.plugins, opts.decodeModule,
|
||||
-- opts.openAudio (containers/AudioWrap: PCM -> WAV, Opus / Vorbis -> Ogg, AAC -> ADTS, MP3 / FLAC / AC-3 as they are)
|
||||
local function openAudio(demuxer, track, sbr)
|
||||
local buf, fmt, err = AudioWrap.wrap(demuxer, track)
|
||||
local buf, fmt, err = __include("containers/AudioWrap").wrap(demuxer, track)
|
||||
if not buf then
|
||||
return nil, err
|
||||
end
|
||||
@@ -1020,7 +1015,7 @@ local buf, fmt, err = AudioWrap.wrap(demuxer, track)
|
||||
local skip = (type(track.codecDelay) == "number" and track.codecDelay > 0 and{(math.floor(track.codecDelay * dec.sampleRate + 0.5) )}or{0
|
||||
})[1] local length = (type(track.playDuration) == "number" and track.playDuration > 0 and{(math.floor(track.playDuration * dec.sampleRate + 0.5) )}or{nil
|
||||
})[1] if skip > 0 or length then
|
||||
dec = AudioWrap.trim(dec, skip, length)
|
||||
dec = __include("containers/AudioWrap").trim(dec, skip, length)
|
||||
end
|
||||
end
|
||||
return dec, oerr
|
||||
@@ -1200,7 +1195,7 @@ if type(v.nextFrame) ~= "function" or type(v.toRGBA) ~= "function" then
|
||||
if #images == 0 then
|
||||
return nil, Err.new(Err.ARG, "save: the video has no frames")
|
||||
end
|
||||
local img, ierr = ImageOps.fromFrames(images, delays)
|
||||
local img, ierr = __include("ops/ImageOps").fromFrames(images, delays)
|
||||
if not img then
|
||||
return nil, ierr
|
||||
end
|
||||
@@ -1486,7 +1481,7 @@ if type(img) ~= "table" or img.kind ~= "image" then
|
||||
end
|
||||
local frames, delays = { img }, { 0.1 }
|
||||
if type(img.frames) == "table" and #img.frames > 0 then
|
||||
local list, cerr = ImageOps.coalesce(img)
|
||||
local list, cerr = __include("ops/ImageOps").coalesce(img)
|
||||
if not list then
|
||||
return nil, cerr
|
||||
end
|
||||
@@ -1496,19 +1491,18 @@ if type(img) ~= "table" or img.kind ~= "image" then
|
||||
delays[i] = (type(f.delay) == "number" and f.delay > 0 and{f.delay }or{0.1
|
||||
})[1] end
|
||||
elseif img.format ~= "rgba8" and img.format ~= "yuv420p" then
|
||||
local c, cerr = ImageOps.convert(img, "rgba8")
|
||||
local c, cerr = __include("ops/ImageOps").convert(img, "rgba8")
|
||||
if not c then
|
||||
return nil, cerr
|
||||
end
|
||||
frames = { c }
|
||||
end
|
||||
local src = type(img.meta) == "table" and img.meta.source
|
||||
return Video.fromFrames(frames, delays, { format = type(src) == "table" and src.format or "image", loops = img.loops, meta = img.meta })
|
||||
return __include("codecs/video/Video").fromFrames(frames, delays, { format = type(src) == "table" and src.format or "image", loops = img.loops, meta = img.meta })
|
||||
end
|
||||
F.video.fromFrames = function(images, delays, opts)
|
||||
return Video.fromFrames(images, delays, opts)
|
||||
return __include("codecs/video/Video").fromFrames(images, delays, opts)
|
||||
end
|
||||
F.video.codecs = Video
|
||||
|
||||
F.model.loadTextures = function(scene, opts)
|
||||
local errs= {}
|
||||
@@ -1537,7 +1531,7 @@ end
|
||||
|
||||
local OPS= {
|
||||
image = function()
|
||||
return ImageOps
|
||||
return __include("ops/ImageOps")
|
||||
end,
|
||||
mesh = function()
|
||||
return __include("ops/MeshOps")
|
||||
@@ -1581,6 +1575,28 @@ local make = OPS[k]
|
||||
return m
|
||||
end,
|
||||
}) )
|
||||
-- F.Rbx (codecs/model/Rbx), F.video.codecs (codecs/video/Video): required on first use
|
||||
|
||||
setmetatable(F, {
|
||||
__index = function(t, k)
|
||||
if k == "Rbx" then
|
||||
local m = __include("codecs/model/Rbx")
|
||||
rawset(t, k, m)
|
||||
return m
|
||||
end
|
||||
return nil
|
||||
end,
|
||||
})
|
||||
setmetatable(F.video, {
|
||||
__index = function(t, k)
|
||||
if k == "codecs" then
|
||||
local m = __include("codecs/video/Video")
|
||||
rawset(t, k, m)
|
||||
return m
|
||||
end
|
||||
return nil
|
||||
end,
|
||||
})
|
||||
|
||||
return F
|
||||
end
|
||||
@@ -4223,7 +4239,7 @@ end
|
||||
|
||||
local P_audio_mp3_Tags= {}
|
||||
do -- audio/mp3/Tags: id3v2Size
|
||||
local Tags = P_audio_mp3_Tags
|
||||
local Tags = {}
|
||||
local band, bor, lshift = bit32.band, bit32.bor, bit32.lshift
|
||||
local ru8 = buffer.readu8
|
||||
local function syncsafe(b, o)
|
||||
@@ -4247,11 +4263,12 @@ if len - o < 10 or buffer.readstring(b, o, 3) ~= "ID3" then
|
||||
end
|
||||
return size
|
||||
end
|
||||
P_audio_mp3_Tags.id3v2Size = Tags.id3v2Size
|
||||
end
|
||||
|
||||
local P_codecs_audio_Aac= {}
|
||||
do -- codecs/audio/Aac: adts
|
||||
local Aac = P_codecs_audio_Aac
|
||||
local Aac = {}
|
||||
local Bits = __include("core/Bits")
|
||||
Aac.RATES = { 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350 }
|
||||
local function objectType(br)
|
||||
@@ -4300,11 +4317,12 @@ if o < 0 or o + 7 > limit or o + 7 > buffer.len(b) then
|
||||
protected = protected,
|
||||
}
|
||||
end
|
||||
P_codecs_audio_Aac.adts = Aac.adts
|
||||
end
|
||||
|
||||
local P_codecs_audio_Ac3_Tables= {}
|
||||
do -- codecs/audio/Ac3/Tables: BITRATES, RATES, frameWords
|
||||
local T = P_codecs_audio_Ac3_Tables
|
||||
local T = {}
|
||||
T.BITRATES = { 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640 }
|
||||
T.RATES = { 48000, 44100, 32000 }
|
||||
function T.frameWords(fscod, frmsizecod)
|
||||
@@ -4319,11 +4337,14 @@ local kbps = T.BITRATES[math.floor(frmsizecod / 2 )+ 1]
|
||||
end
|
||||
return math.floor(kbps * 1536000 / 705600 )+ frmsizecod % 2
|
||||
end
|
||||
P_codecs_audio_Ac3_Tables.BITRATES = T.BITRATES
|
||||
P_codecs_audio_Ac3_Tables.RATES = T.RATES
|
||||
P_codecs_audio_Ac3_Tables.frameWords = T.frameWords
|
||||
end
|
||||
|
||||
local P_codecs_audio_Ac3= {}
|
||||
do -- codecs/audio/Ac3: header
|
||||
local Ac3 = P_codecs_audio_Ac3
|
||||
local Ac3 = {}
|
||||
local T = P_codecs_audio_Ac3_Tables
|
||||
local readu8 = buffer.readu8
|
||||
local NFCHANS = { [0] = 2, 1, 2, 3, 3, 4, 4, 5 }
|
||||
@@ -4392,22 +4413,24 @@ if o < 0 or o + 8 > limit or o + 8 > buffer.len(b) then
|
||||
bsid = bsid,
|
||||
}
|
||||
end
|
||||
P_codecs_audio_Ac3.header = Ac3.header
|
||||
end
|
||||
|
||||
local P_codecs_audio_Mpa_Tables= {}
|
||||
do -- codecs/audio/Mpa/Tables: halfrate
|
||||
local T = P_codecs_audio_Mpa_Tables
|
||||
local T = {}
|
||||
T.halfrate = { [0] = 0,
|
||||
4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 72, 80, 0, 4, 8, 12, 16, 20, 24, 28, 32, 40,
|
||||
48, 56, 64, 72, 80, 0, 16, 24, 28, 32, 40, 48, 56, 64, 72, 80, 88, 96, 112, 128, 0, 16, 20, 24,
|
||||
28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 0, 16, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128,
|
||||
160, 192, 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224,
|
||||
}
|
||||
P_codecs_audio_Mpa_Tables.halfrate = T.halfrate
|
||||
end
|
||||
|
||||
local P_codecs_audio_Mpa_Header= {}
|
||||
do -- codecs/audio/Mpa/Header: compare, frameBytes, padding, valid
|
||||
local H = P_codecs_audio_Mpa_Header
|
||||
local H = {}
|
||||
local T = P_codecs_audio_Mpa_Tables
|
||||
local band, bxor, rshift = bit32.band, bit32.bxor, bit32.rshift
|
||||
local ru8 = buffer.readu8
|
||||
@@ -4475,11 +4498,15 @@ if band(ru8(b, o + 2), 2) == 0 then
|
||||
end
|
||||
return band(ru8(b, o + 1), 6) == 6 and 4 or 1
|
||||
end
|
||||
P_codecs_audio_Mpa_Header.compare = H.compare
|
||||
P_codecs_audio_Mpa_Header.frameBytes = H.frameBytes
|
||||
P_codecs_audio_Mpa_Header.padding = H.padding
|
||||
P_codecs_audio_Mpa_Header.valid = H.valid
|
||||
end
|
||||
|
||||
local P_codecs_audio_Musepack= {}
|
||||
do -- codecs/audio/Musepack: magic
|
||||
local Musepack = P_codecs_audio_Musepack
|
||||
local Musepack = {}
|
||||
function Musepack.magic(buf, p, limit)
|
||||
if p + 4 > limit then
|
||||
return 0
|
||||
@@ -4493,15 +4520,17 @@ if p + 4 > limit then
|
||||
end
|
||||
return 0
|
||||
end
|
||||
P_codecs_audio_Musepack.magic = Musepack.magic
|
||||
end
|
||||
|
||||
local P_codecs_audio_SoundFont= {}
|
||||
do -- codecs/audio/SoundFont: sniff
|
||||
local SoundFont = P_codecs_audio_SoundFont
|
||||
local SoundFont = {}
|
||||
local Bytes = __include("core/Bytes")
|
||||
function SoundFont.sniff(r)
|
||||
return r:peek(4) == "RIFF" and r:peek(4, 8) == "sfbk"
|
||||
end
|
||||
P_codecs_audio_SoundFont.sniff = SoundFont.sniff
|
||||
end
|
||||
|
||||
local P_codecs_compress_Brotli = lazy(function()
|
||||
@@ -4514,7 +4543,7 @@ end)
|
||||
|
||||
local P_codecs_compress_Deflate= {}
|
||||
do -- codecs/compress/Deflate: peek
|
||||
local Deflate = P_codecs_compress_Deflate
|
||||
local Deflate = {}
|
||||
local Err = __include("core/Err")
|
||||
local Bytes = __include("core/Bytes")
|
||||
local Inflate = P_codecs_compress_Deflate_Inflate
|
||||
@@ -4587,6 +4616,7 @@ local b, o, l, aerr = args("Deflate.peek", buf, offset, length)
|
||||
end
|
||||
return shrink(out, k), nil
|
||||
end
|
||||
P_codecs_compress_Deflate.peek = Deflate.peek
|
||||
end
|
||||
|
||||
local P_codecs_compress_Zstd_Decode = lazy(function()
|
||||
@@ -4595,7 +4625,7 @@ end)
|
||||
|
||||
local P_codecs_compress_Zstd= {}
|
||||
do -- codecs/compress/Zstd: MAGIC, decompress
|
||||
local Zstd = P_codecs_compress_Zstd
|
||||
local Zstd = {}
|
||||
local Err = __include("core/Err")
|
||||
local Bytes = __include("core/Bytes")
|
||||
local Decode = P_codecs_compress_Zstd_Decode
|
||||
@@ -4625,11 +4655,13 @@ local b, o, l, aerr = Bytes.span("Zstd.decompress", buf, offset, length)
|
||||
end
|
||||
return out, consumed
|
||||
end
|
||||
P_codecs_compress_Zstd.MAGIC = Zstd.MAGIC
|
||||
P_codecs_compress_Zstd.decompress = Zstd.decompress
|
||||
end
|
||||
|
||||
local P_codecs_text_KeyValues_Binary= {}
|
||||
do -- codecs/text/KeyValues/Binary: sniff
|
||||
local Binary = P_codecs_text_KeyValues_Binary
|
||||
local Binary = {}
|
||||
local readu8, readu32, readi32, readf32 = buffer.readu8, buffer.readu32, buffer.readi32, buffer.readf32
|
||||
function Binary.sniff(b, o, n)
|
||||
if n < 3 then
|
||||
@@ -4649,18 +4681,20 @@ if n < 3 then
|
||||
end
|
||||
return false
|
||||
end
|
||||
P_codecs_text_KeyValues_Binary.sniff = Binary.sniff
|
||||
end
|
||||
|
||||
local P_codecs_text_KeyValues= {}
|
||||
do -- codecs/text/KeyValues: isBinary
|
||||
local KeyValues = P_codecs_text_KeyValues
|
||||
local KeyValues = {}
|
||||
local Binary = P_codecs_text_KeyValues_Binary
|
||||
KeyValues.isBinary = Binary.sniff
|
||||
P_codecs_text_KeyValues.isBinary = KeyValues.isBinary
|
||||
end
|
||||
|
||||
local P_codecs_text_Nbt_Value= {}
|
||||
do -- codecs/text/Nbt/Value: NAMES
|
||||
local Value = P_codecs_text_Nbt_Value
|
||||
local Value = {}
|
||||
Value.NAMES = {
|
||||
[0] = "end",
|
||||
"byte",
|
||||
@@ -4680,11 +4714,12 @@ Value.IDS = {}
|
||||
for id = 0, 12 do
|
||||
Value.IDS[Value.NAMES[id] ] = id
|
||||
end
|
||||
P_codecs_text_Nbt_Value.NAMES = Value.NAMES
|
||||
end
|
||||
|
||||
local P_codecs_text_Nbt= {}
|
||||
do -- codecs/text/Nbt: peek
|
||||
local Nbt = P_codecs_text_Nbt
|
||||
local Nbt = {}
|
||||
local Deflate = P_codecs_compress_Deflate
|
||||
local Value = P_codecs_text_Nbt_Value
|
||||
|
||||
@@ -4772,11 +4807,12 @@ local a, b = buffer.readu8(head, q), buffer.readu8(head, q + 1)
|
||||
end
|
||||
return at(0, "big", false) or at(0, "little", false)
|
||||
end
|
||||
P_codecs_text_Nbt.peek = Nbt.peek
|
||||
end
|
||||
|
||||
local P_codecs_text_Text= {}
|
||||
do -- codecs/text/Text: toUtf8, trim, utf16
|
||||
local Text = P_codecs_text_Text
|
||||
local Text = {}
|
||||
function Text.utf8char(c)
|
||||
local char = string.char
|
||||
if c < 0x80 then
|
||||
@@ -4844,11 +4880,14 @@ if string.sub(text, 1, 3) == "\239\187\191" then
|
||||
end
|
||||
return table.concat(out)
|
||||
end
|
||||
P_codecs_text_Text.toUtf8 = Text.toUtf8
|
||||
P_codecs_text_Text.trim = Text.trim
|
||||
P_codecs_text_Text.utf16 = Text.utf16
|
||||
end
|
||||
|
||||
local P_containers_Fat= {}
|
||||
do -- containers/Fat: open
|
||||
local Fat = P_containers_Fat
|
||||
local Fat = {}
|
||||
local readu8, readu16, readu32 = buffer.readu8, buffer.readu16, buffer.readu32
|
||||
|
||||
|
||||
@@ -4970,11 +5009,12 @@ local o= opts or {}
|
||||
end
|
||||
return nil, (o.partition and(("no partition " .. o.partition ))or("no FAT partition"
|
||||
))end
|
||||
P_containers_Fat.open = Fat.open
|
||||
end
|
||||
|
||||
local P_containers_IsoBmff= {}
|
||||
do -- containers/IsoBmff: sniff
|
||||
local IsoBmff = P_containers_IsoBmff
|
||||
local IsoBmff = {}
|
||||
local Bytes = __include("core/Bytes")
|
||||
local TOP= {
|
||||
ftyp = true, moov = true, mdat = true, free = true, skip = true, wide = true, pnot = true, moof = true,
|
||||
@@ -4997,11 +5037,12 @@ local head = r:peek(12)
|
||||
end
|
||||
return nil
|
||||
end
|
||||
P_containers_IsoBmff.sniff = IsoBmff.sniff
|
||||
end
|
||||
|
||||
local P_containers_Riff= {}
|
||||
do -- containers/Riff: sniff
|
||||
local Riff = P_containers_Riff
|
||||
local Riff = {}
|
||||
function Riff.sniff(r)
|
||||
local magic = r:peek(4)
|
||||
if magic ~= "RIFF" and magic ~= "RIFX" and magic ~= "RF64" and magic ~= "BW64" then
|
||||
@@ -5010,11 +5051,12 @@ local magic = r:peek(4)
|
||||
local form = r:peek(4, 8)
|
||||
return (#form == 4 and{form }or{nil
|
||||
})[1]end
|
||||
P_containers_Riff.sniff = Riff.sniff
|
||||
end
|
||||
|
||||
local P_containers_Tar= {}
|
||||
do -- containers/Tar: valid
|
||||
local Tar = P_containers_Tar
|
||||
local Tar = {}
|
||||
local BLOCK = 512
|
||||
local function zeros(b, o)
|
||||
for i = 0, BLOCK - 1, 4 do
|
||||
@@ -5057,19 +5099,22 @@ if o + BLOCK > buffer.len(b) or zeros(b, o) then
|
||||
local u, s = checksum(b, o)
|
||||
return want == u or want == s
|
||||
end
|
||||
P_containers_Tar.valid = Tar.valid
|
||||
end
|
||||
|
||||
local P_model_fbx_Binary= {}
|
||||
do -- model/fbx/Binary: MAGIC
|
||||
local Binary = P_model_fbx_Binary
|
||||
local Binary = {}
|
||||
local MAGIC = "Kaydara FBX Binary \0"
|
||||
Binary.MAGIC = MAGIC
|
||||
P_model_fbx_Binary.MAGIC = Binary.MAGIC
|
||||
end
|
||||
|
||||
local P_model_ms3d_Read= {}
|
||||
do -- model/ms3d/Read: MAGIC
|
||||
local Read = P_model_ms3d_Read
|
||||
local Read = {}
|
||||
Read.MAGIC = "MS3D000000"
|
||||
P_model_ms3d_Read.MAGIC = Read.MAGIC
|
||||
end
|
||||
|
||||
do -- image/ani
|
||||
@@ -64254,13 +64299,12 @@ __DARKLUA_CONTINUE_26=true break
|
||||
end
|
||||
local ws = w
|
||||
if wl > 0 then
|
||||
if dict == nil then
|
||||
dict = S.dictionary()
|
||||
if dict == nil then
|
||||
return nil, NO_DICTIONARY
|
||||
end
|
||||
local d = dict or S.dictionary()
|
||||
if d == nil then
|
||||
return nil, NO_DICTIONARY
|
||||
end
|
||||
bcopy(WORD, w, dict, wo, wl)
|
||||
dict = d
|
||||
bcopy(WORD, w, d, wo, wl)
|
||||
w =w+ wl
|
||||
end
|
||||
if ttype == 10 then
|
||||
@@ -165172,10 +165216,11 @@ end
|
||||
|
||||
-- RNA path 'kind["name"].rest': name ends at the first unescaped '"]', rest may hold more subscripts
|
||||
function Anim.split(path)
|
||||
local kind, at = string.match(path, '^(%w[%w_%.]-)%["()')
|
||||
local kind, pos = string.match(path, '^(%w[%w_%.]-)%["()')
|
||||
if kind then
|
||||
local i = at
|
||||
while true do
|
||||
local at= pos
|
||||
local i = at
|
||||
while true do
|
||||
local q = string.find(path, '"', i, true)
|
||||
if not q then
|
||||
break
|
||||
|
||||
+620
-620
File diff suppressed because it is too large.
Load diff
@@ -499,9 +499,10 @@ end
|
||||
|
||||
-- RNA path 'kind["name"].rest': name ends at the first unescaped '"]', rest may hold more subscripts
|
||||
function Anim.split(path: string): (string?, string?, string)
|
||||
local kind, at = string.match(path, '^(%w[%w_%.]-)%["()')
|
||||
local kind, pos = string.match(path, '^(%w[%w_%.]-)%["()')
|
||||
if kind then
|
||||
local i = at :: number
|
||||
local at: number = pos :: any
|
||||
local i = at
|
||||
while true do
|
||||
local q = string.find(path, '"', i, true)
|
||||
if not q then
|
||||
|
||||
Reference in new issue
Block a user