From c6062f71ebcab1e7553282c8f19eb082f0c6ed2f Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 22 Sep 2025 10:29:29 -0400 Subject: [PATCH] Move Quantum compression models to IO --- .../Compression/Quantum/Constants.cs | 50 ------------------- .../Compression/Quantum/Enums.cs | 45 ----------------- .../Compression/Quantum/Model.cs | 24 --------- .../Compression/Quantum/ModelSymbol.cs | 15 ------ 4 files changed, 134 deletions(-) delete mode 100644 SabreTools.Models/Compression/Quantum/Constants.cs delete mode 100644 SabreTools.Models/Compression/Quantum/Enums.cs delete mode 100644 SabreTools.Models/Compression/Quantum/Model.cs delete mode 100644 SabreTools.Models/Compression/Quantum/ModelSymbol.cs diff --git a/SabreTools.Models/Compression/Quantum/Constants.cs b/SabreTools.Models/Compression/Quantum/Constants.cs deleted file mode 100644 index 9a2f732..0000000 --- a/SabreTools.Models/Compression/Quantum/Constants.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace SabreTools.Models.Compression.Quantum -{ - /// - public static class Constants - { - public static readonly int[] PositionSlot = - [ - 0x00000, 0x00001, 0x00002, 0x00003, 0x00004, 0x00006, 0x00008, 0x0000c, - 0x00010, 0x00018, 0x00020, 0x00030, 0x00040, 0x00060, 0x00080, 0x000c0, - 0x00100, 0x00180, 0x00200, 0x00300, 0x00400, 0x00600, 0x00800, 0x00c00, - 0x01000, 0x01800, 0x02000, 0x03000, 0x04000, 0x06000, 0x08000, 0x0c000, - 0x10000, 0x18000, 0x20000, 0x30000, 0x40000, 0x60000, 0x80000, 0xc0000, - 0x100000, 0x180000 - ]; - - public static readonly int[] PositionExtraBits = - [ - 0, 0, 0, 0, 1, 1, 2, 2, - 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, - 11, 11, 12, 12, 13, 13, 14, 14, - 15, 15, 16, 16, 17, 17, 18, 18, - 19, 19 - ]; - - public static readonly int[] LengthSlot = - [ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x08, - 0x0a, 0x0c, 0x0e, 0x12, 0x16, 0x1a, 0x1e, 0x26, - 0x2e, 0x36, 0x3e, 0x4e, 0x5e, 0x6e, 0x7e, 0x9e, - 0xbe, 0xde, 0xfe - ]; - - public static readonly int[] LengthExtraBits = - [ - 0, 0, 0, 0, 0, 0, 1, 1, - 1, 1, 2, 2, 2, 2, 3, 3, - 3, 3, 4, 4, 4, 4, 5, 5, - 5, 5, 0 - ]; - - /// - /// Number of position slots for (tsize - 10) - /// - public static readonly int[] NumPositionSlots = - [ - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42 - ]; - } -} \ No newline at end of file diff --git a/SabreTools.Models/Compression/Quantum/Enums.cs b/SabreTools.Models/Compression/Quantum/Enums.cs deleted file mode 100644 index 9dc8ee5..0000000 --- a/SabreTools.Models/Compression/Quantum/Enums.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace SabreTools.Models.Compression.Quantum -{ - public enum SelectorModel - { - /// - /// Literal model, 64 entries, start at symbol 0 - /// - SELECTOR_0 = 0, - - /// - /// Literal model, 64 entries, start at symbol 64 - /// - SELECTOR_1 = 1, - - /// - /// Literal model, 64 entries, start at symbol 128 - /// - SELECTOR_2 = 2, - - /// - /// Literal model, 64 entries, start at symbol 192 - /// - SELECTOR_3 = 3, - - /// - /// LZ model, 3 character matches, max 24 entries, start at symbol 0 - /// - SELECTOR_4 = 4, - - /// - /// LZ model, 4 character matches, max 36 entries, start at symbol 0 - /// - SELECTOR_5 = 5, - - /// - /// LZ model, 5+ character matches, max 42 entries, start at symbol 0 - /// - SELECTOR_6_POSITION = 6, - - /// - /// LZ model, 5+ character matches, 27 entries, start at symbol 0 - /// - SELECTOR_6_LENGTH = 7, - } -} \ No newline at end of file diff --git a/SabreTools.Models/Compression/Quantum/Model.cs b/SabreTools.Models/Compression/Quantum/Model.cs deleted file mode 100644 index fb21617..0000000 --- a/SabreTools.Models/Compression/Quantum/Model.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace SabreTools.Models.Compression.Quantum -{ - /// - public sealed class Model - { - public int Entries { get; set; } - - /// - /// All the models are initialized with the symbols in symbol - /// order in the table, and with every symbol in the table - /// having a frequency of 1 - /// - public ModelSymbol[]? Symbols { get; set; } - - /// - /// The initial total frequency is equal to the number of entries - /// in the table - /// - public int TotalFrequency { get; set; } - - /// The initial time_to_reorder value is 4 - public int TimeToReorder { get; set; } - } -} \ No newline at end of file diff --git a/SabreTools.Models/Compression/Quantum/ModelSymbol.cs b/SabreTools.Models/Compression/Quantum/ModelSymbol.cs deleted file mode 100644 index 3576862..0000000 --- a/SabreTools.Models/Compression/Quantum/ModelSymbol.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace SabreTools.Models.Compression.Quantum -{ - /// - public sealed class ModelSymbol - { - public ushort Symbol { get; set; } - - /// - /// The cumulative frequency is the frequency of all the symbols - /// which are at a higher index in the table than that symbol — - /// thus the last entry in the table has a cumulative frequency of 0. - /// - public ushort CumulativeFrequency { get; set; } - } -} \ No newline at end of file