From 3b271630d5bfc48ff034592bbe501da5c9aa08c7 Mon Sep 17 00:00:00 2001 From: Oleg Stepanischev Date: Tue, 17 Oct 2023 23:02:30 +0300 Subject: [PATCH] Converted some object initializations to constructors (.NET Native workaround) --- src/ZstdSharp/Unsafe/Clevels.cs | 2 +- src/ZstdSharp/Unsafe/FASTCOVER_accel_t.cs | 5 +++++ src/ZstdSharp/Unsafe/Fastcover.cs | 2 +- src/ZstdSharp/Unsafe/HufDecompress.cs | 2 +- src/ZstdSharp/Unsafe/ZSTD_compressionParameters.cs | 10 ++++++++++ src/ZstdSharp/Unsafe/ZSTD_customMem.cs | 6 ++++++ src/ZstdSharp/Unsafe/ZSTD_seqSymbol.cs | 7 +++++++ src/ZstdSharp/Unsafe/Zstd.cs | 2 +- src/ZstdSharp/Unsafe/ZstdCompressInternal.cs | 2 +- src/ZstdSharp/Unsafe/ZstdDecompressBlock.cs | 6 +++--- src/ZstdSharp/Unsafe/algo_time_t.cs | 5 +++++ src/ZstdSharp/Unsafe/rawSeqStore_t.cs | 8 ++++++++ 12 files changed, 49 insertions(+), 8 deletions(-) diff --git a/src/ZstdSharp/Unsafe/Clevels.cs b/src/ZstdSharp/Unsafe/Clevels.cs index 34a8889..cfba80b 100644 --- a/src/ZstdSharp/Unsafe/Clevels.cs +++ b/src/ZstdSharp/Unsafe/Clevels.cs @@ -2,6 +2,6 @@ namespace ZstdSharp.Unsafe { public static unsafe partial class Methods { - private static readonly ZSTD_compressionParameters[][] ZSTD_defaultCParameters = new ZSTD_compressionParameters[4][] { new ZSTD_compressionParameters[23] { new ZSTD_compressionParameters { windowLog = 19, chainLog = 12, hashLog = 13, searchLog = 1, minMatch = 6, targetLength = 1, strategy = ZSTD_strategy.ZSTD_fast }, new ZSTD_compressionParameters { windowLog = 19, chainLog = 13, hashLog = 14, searchLog = 1, minMatch = 7, targetLength = 0, strategy = ZSTD_strategy.ZSTD_fast }, new ZSTD_compressionParameters { windowLog = 20, chainLog = 15, hashLog = 16, searchLog = 1, minMatch = 6, targetLength = 0, strategy = ZSTD_strategy.ZSTD_fast }, new ZSTD_compressionParameters { windowLog = 21, chainLog = 16, hashLog = 17, searchLog = 1, minMatch = 5, targetLength = 0, strategy = ZSTD_strategy.ZSTD_dfast }, new ZSTD_compressionParameters { windowLog = 21, chainLog = 18, hashLog = 18, searchLog = 1, minMatch = 5, targetLength = 0, strategy = ZSTD_strategy.ZSTD_dfast }, new ZSTD_compressionParameters { windowLog = 21, chainLog = 18, hashLog = 19, searchLog = 3, minMatch = 5, targetLength = 2, strategy = ZSTD_strategy.ZSTD_greedy }, new ZSTD_compressionParameters { windowLog = 21, chainLog = 18, hashLog = 19, searchLog = 3, minMatch = 5, targetLength = 4, strategy = ZSTD_strategy.ZSTD_lazy }, new ZSTD_compressionParameters { windowLog = 21, chainLog = 19, hashLog = 20, searchLog = 4, minMatch = 5, targetLength = 8, strategy = ZSTD_strategy.ZSTD_lazy }, new ZSTD_compressionParameters { windowLog = 21, chainLog = 19, hashLog = 20, searchLog = 4, minMatch = 5, targetLength = 16, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 22, chainLog = 20, hashLog = 21, searchLog = 4, minMatch = 5, targetLength = 16, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 22, chainLog = 21, hashLog = 22, searchLog = 5, minMatch = 5, targetLength = 16, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 22, chainLog = 21, hashLog = 22, searchLog = 6, minMatch = 5, targetLength = 16, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 22, chainLog = 22, hashLog = 23, searchLog = 6, minMatch = 5, targetLength = 32, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 22, chainLog = 22, hashLog = 22, searchLog = 4, minMatch = 5, targetLength = 32, strategy = ZSTD_strategy.ZSTD_btlazy2 }, new ZSTD_compressionParameters { windowLog = 22, chainLog = 22, hashLog = 23, searchLog = 5, minMatch = 5, targetLength = 32, strategy = ZSTD_strategy.ZSTD_btlazy2 }, new ZSTD_compressionParameters { windowLog = 22, chainLog = 23, hashLog = 23, searchLog = 6, minMatch = 5, targetLength = 32, strategy = ZSTD_strategy.ZSTD_btlazy2 }, new ZSTD_compressionParameters { windowLog = 22, chainLog = 22, hashLog = 22, searchLog = 5, minMatch = 5, targetLength = 48, strategy = ZSTD_strategy.ZSTD_btopt }, new ZSTD_compressionParameters { windowLog = 23, chainLog = 23, hashLog = 22, searchLog = 5, minMatch = 4, targetLength = 64, strategy = ZSTD_strategy.ZSTD_btopt }, new ZSTD_compressionParameters { windowLog = 23, chainLog = 23, hashLog = 22, searchLog = 6, minMatch = 3, targetLength = 64, strategy = ZSTD_strategy.ZSTD_btultra }, new ZSTD_compressionParameters { windowLog = 23, chainLog = 24, hashLog = 22, searchLog = 7, minMatch = 3, targetLength = 256, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 25, chainLog = 25, hashLog = 23, searchLog = 7, minMatch = 3, targetLength = 256, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 26, chainLog = 26, hashLog = 24, searchLog = 7, minMatch = 3, targetLength = 512, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 27, chainLog = 27, hashLog = 25, searchLog = 9, minMatch = 3, targetLength = 999, strategy = ZSTD_strategy.ZSTD_btultra2 } }, new ZSTD_compressionParameters[23] { new ZSTD_compressionParameters { windowLog = 18, chainLog = 12, hashLog = 13, searchLog = 1, minMatch = 5, targetLength = 1, strategy = ZSTD_strategy.ZSTD_fast }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 13, hashLog = 14, searchLog = 1, minMatch = 6, targetLength = 0, strategy = ZSTD_strategy.ZSTD_fast }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 14, hashLog = 14, searchLog = 1, minMatch = 5, targetLength = 0, strategy = ZSTD_strategy.ZSTD_dfast }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 16, hashLog = 16, searchLog = 1, minMatch = 4, targetLength = 0, strategy = ZSTD_strategy.ZSTD_dfast }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 16, hashLog = 17, searchLog = 3, minMatch = 5, targetLength = 2, strategy = ZSTD_strategy.ZSTD_greedy }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 17, hashLog = 18, searchLog = 5, minMatch = 5, targetLength = 2, strategy = ZSTD_strategy.ZSTD_greedy }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 18, hashLog = 19, searchLog = 3, minMatch = 5, targetLength = 4, strategy = ZSTD_strategy.ZSTD_lazy }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 18, hashLog = 19, searchLog = 4, minMatch = 4, targetLength = 4, strategy = ZSTD_strategy.ZSTD_lazy }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 18, hashLog = 19, searchLog = 4, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 18, hashLog = 19, searchLog = 5, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 18, hashLog = 19, searchLog = 6, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 18, hashLog = 19, searchLog = 5, minMatch = 4, targetLength = 12, strategy = ZSTD_strategy.ZSTD_btlazy2 }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 19, hashLog = 19, searchLog = 7, minMatch = 4, targetLength = 12, strategy = ZSTD_strategy.ZSTD_btlazy2 }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 18, hashLog = 19, searchLog = 4, minMatch = 4, targetLength = 16, strategy = ZSTD_strategy.ZSTD_btopt }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 18, hashLog = 19, searchLog = 4, minMatch = 3, targetLength = 32, strategy = ZSTD_strategy.ZSTD_btopt }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 18, hashLog = 19, searchLog = 6, minMatch = 3, targetLength = 128, strategy = ZSTD_strategy.ZSTD_btopt }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 19, hashLog = 19, searchLog = 6, minMatch = 3, targetLength = 128, strategy = ZSTD_strategy.ZSTD_btultra }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 19, hashLog = 19, searchLog = 8, minMatch = 3, targetLength = 256, strategy = ZSTD_strategy.ZSTD_btultra }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 19, hashLog = 19, searchLog = 6, minMatch = 3, targetLength = 128, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 19, hashLog = 19, searchLog = 8, minMatch = 3, targetLength = 256, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 19, hashLog = 19, searchLog = 10, minMatch = 3, targetLength = 512, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 19, hashLog = 19, searchLog = 12, minMatch = 3, targetLength = 512, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 18, chainLog = 19, hashLog = 19, searchLog = 13, minMatch = 3, targetLength = 999, strategy = ZSTD_strategy.ZSTD_btultra2 } }, new ZSTD_compressionParameters[23] { new ZSTD_compressionParameters { windowLog = 17, chainLog = 12, hashLog = 12, searchLog = 1, minMatch = 5, targetLength = 1, strategy = ZSTD_strategy.ZSTD_fast }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 12, hashLog = 13, searchLog = 1, minMatch = 6, targetLength = 0, strategy = ZSTD_strategy.ZSTD_fast }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 13, hashLog = 15, searchLog = 1, minMatch = 5, targetLength = 0, strategy = ZSTD_strategy.ZSTD_fast }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 15, hashLog = 16, searchLog = 2, minMatch = 5, targetLength = 0, strategy = ZSTD_strategy.ZSTD_dfast }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 17, hashLog = 17, searchLog = 2, minMatch = 4, targetLength = 0, strategy = ZSTD_strategy.ZSTD_dfast }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 16, hashLog = 17, searchLog = 3, minMatch = 4, targetLength = 2, strategy = ZSTD_strategy.ZSTD_greedy }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 16, hashLog = 17, searchLog = 3, minMatch = 4, targetLength = 4, strategy = ZSTD_strategy.ZSTD_lazy }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 16, hashLog = 17, searchLog = 3, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 16, hashLog = 17, searchLog = 4, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 16, hashLog = 17, searchLog = 5, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 16, hashLog = 17, searchLog = 6, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 17, hashLog = 17, searchLog = 5, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_btlazy2 }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 18, hashLog = 17, searchLog = 7, minMatch = 4, targetLength = 12, strategy = ZSTD_strategy.ZSTD_btlazy2 }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 18, hashLog = 17, searchLog = 3, minMatch = 4, targetLength = 12, strategy = ZSTD_strategy.ZSTD_btopt }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 18, hashLog = 17, searchLog = 4, minMatch = 3, targetLength = 32, strategy = ZSTD_strategy.ZSTD_btopt }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 18, hashLog = 17, searchLog = 6, minMatch = 3, targetLength = 256, strategy = ZSTD_strategy.ZSTD_btopt }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 18, hashLog = 17, searchLog = 6, minMatch = 3, targetLength = 128, strategy = ZSTD_strategy.ZSTD_btultra }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 18, hashLog = 17, searchLog = 8, minMatch = 3, targetLength = 256, strategy = ZSTD_strategy.ZSTD_btultra }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 18, hashLog = 17, searchLog = 10, minMatch = 3, targetLength = 512, strategy = ZSTD_strategy.ZSTD_btultra }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 18, hashLog = 17, searchLog = 5, minMatch = 3, targetLength = 256, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 18, hashLog = 17, searchLog = 7, minMatch = 3, targetLength = 512, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 18, hashLog = 17, searchLog = 9, minMatch = 3, targetLength = 512, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 17, chainLog = 18, hashLog = 17, searchLog = 11, minMatch = 3, targetLength = 999, strategy = ZSTD_strategy.ZSTD_btultra2 } }, new ZSTD_compressionParameters[23] { new ZSTD_compressionParameters { windowLog = 14, chainLog = 12, hashLog = 13, searchLog = 1, minMatch = 5, targetLength = 1, strategy = ZSTD_strategy.ZSTD_fast }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 14, hashLog = 15, searchLog = 1, minMatch = 5, targetLength = 0, strategy = ZSTD_strategy.ZSTD_fast }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 14, hashLog = 15, searchLog = 1, minMatch = 4, targetLength = 0, strategy = ZSTD_strategy.ZSTD_fast }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 14, hashLog = 15, searchLog = 2, minMatch = 4, targetLength = 0, strategy = ZSTD_strategy.ZSTD_dfast }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 14, hashLog = 14, searchLog = 4, minMatch = 4, targetLength = 2, strategy = ZSTD_strategy.ZSTD_greedy }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 14, hashLog = 14, searchLog = 3, minMatch = 4, targetLength = 4, strategy = ZSTD_strategy.ZSTD_lazy }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 14, hashLog = 14, searchLog = 4, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 14, hashLog = 14, searchLog = 6, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 14, hashLog = 14, searchLog = 8, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_lazy2 }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 14, searchLog = 5, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_btlazy2 }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 14, searchLog = 9, minMatch = 4, targetLength = 8, strategy = ZSTD_strategy.ZSTD_btlazy2 }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 14, searchLog = 3, minMatch = 4, targetLength = 12, strategy = ZSTD_strategy.ZSTD_btopt }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 14, searchLog = 4, minMatch = 3, targetLength = 24, strategy = ZSTD_strategy.ZSTD_btopt }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 14, searchLog = 5, minMatch = 3, targetLength = 32, strategy = ZSTD_strategy.ZSTD_btultra }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 15, searchLog = 6, minMatch = 3, targetLength = 64, strategy = ZSTD_strategy.ZSTD_btultra }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 15, searchLog = 7, minMatch = 3, targetLength = 256, strategy = ZSTD_strategy.ZSTD_btultra }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 15, searchLog = 5, minMatch = 3, targetLength = 48, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 15, searchLog = 6, minMatch = 3, targetLength = 128, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 15, searchLog = 7, minMatch = 3, targetLength = 256, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 15, searchLog = 8, minMatch = 3, targetLength = 256, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 15, searchLog = 8, minMatch = 3, targetLength = 512, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 15, searchLog = 9, minMatch = 3, targetLength = 512, strategy = ZSTD_strategy.ZSTD_btultra2 }, new ZSTD_compressionParameters { windowLog = 14, chainLog = 15, hashLog = 15, searchLog = 10, minMatch = 3, targetLength = 999, strategy = ZSTD_strategy.ZSTD_btultra2 } } }; + private static readonly ZSTD_compressionParameters[][] ZSTD_defaultCParameters = new ZSTD_compressionParameters[4][] { new ZSTD_compressionParameters[23] { new ZSTD_compressionParameters(windowLog: 19, chainLog: 12, hashLog: 13, searchLog: 1, minMatch: 6, targetLength: 1, strategy: ZSTD_strategy.ZSTD_fast), new ZSTD_compressionParameters(windowLog: 19, chainLog: 13, hashLog: 14, searchLog: 1, minMatch: 7, targetLength: 0, strategy: ZSTD_strategy.ZSTD_fast), new ZSTD_compressionParameters(windowLog: 20, chainLog: 15, hashLog: 16, searchLog: 1, minMatch: 6, targetLength: 0, strategy: ZSTD_strategy.ZSTD_fast), new ZSTD_compressionParameters(windowLog: 21, chainLog: 16, hashLog: 17, searchLog: 1, minMatch: 5, targetLength: 0, strategy: ZSTD_strategy.ZSTD_dfast), new ZSTD_compressionParameters(windowLog: 21, chainLog: 18, hashLog: 18, searchLog: 1, minMatch: 5, targetLength: 0, strategy: ZSTD_strategy.ZSTD_dfast), new ZSTD_compressionParameters(windowLog: 21, chainLog: 18, hashLog: 19, searchLog: 3, minMatch: 5, targetLength: 2, strategy: ZSTD_strategy.ZSTD_greedy), new ZSTD_compressionParameters(windowLog: 21, chainLog: 18, hashLog: 19, searchLog: 3, minMatch: 5, targetLength: 4, strategy: ZSTD_strategy.ZSTD_lazy), new ZSTD_compressionParameters(windowLog: 21, chainLog: 19, hashLog: 20, searchLog: 4, minMatch: 5, targetLength: 8, strategy: ZSTD_strategy.ZSTD_lazy), new ZSTD_compressionParameters(windowLog: 21, chainLog: 19, hashLog: 20, searchLog: 4, minMatch: 5, targetLength: 16, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 22, chainLog: 20, hashLog: 21, searchLog: 4, minMatch: 5, targetLength: 16, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 22, chainLog: 21, hashLog: 22, searchLog: 5, minMatch: 5, targetLength: 16, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 22, chainLog: 21, hashLog: 22, searchLog: 6, minMatch: 5, targetLength: 16, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 22, chainLog: 22, hashLog: 23, searchLog: 6, minMatch: 5, targetLength: 32, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 22, chainLog: 22, hashLog: 22, searchLog: 4, minMatch: 5, targetLength: 32, strategy: ZSTD_strategy.ZSTD_btlazy2), new ZSTD_compressionParameters(windowLog: 22, chainLog: 22, hashLog: 23, searchLog: 5, minMatch: 5, targetLength: 32, strategy: ZSTD_strategy.ZSTD_btlazy2), new ZSTD_compressionParameters(windowLog: 22, chainLog: 23, hashLog: 23, searchLog: 6, minMatch: 5, targetLength: 32, strategy: ZSTD_strategy.ZSTD_btlazy2), new ZSTD_compressionParameters(windowLog: 22, chainLog: 22, hashLog: 22, searchLog: 5, minMatch: 5, targetLength: 48, strategy: ZSTD_strategy.ZSTD_btopt), new ZSTD_compressionParameters(windowLog: 23, chainLog: 23, hashLog: 22, searchLog: 5, minMatch: 4, targetLength: 64, strategy: ZSTD_strategy.ZSTD_btopt), new ZSTD_compressionParameters(windowLog: 23, chainLog: 23, hashLog: 22, searchLog: 6, minMatch: 3, targetLength: 64, strategy: ZSTD_strategy.ZSTD_btultra), new ZSTD_compressionParameters(windowLog: 23, chainLog: 24, hashLog: 22, searchLog: 7, minMatch: 3, targetLength: 256, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 25, chainLog: 25, hashLog: 23, searchLog: 7, minMatch: 3, targetLength: 256, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 26, chainLog: 26, hashLog: 24, searchLog: 7, minMatch: 3, targetLength: 512, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 27, chainLog: 27, hashLog: 25, searchLog: 9, minMatch: 3, targetLength: 999, strategy: ZSTD_strategy.ZSTD_btultra2) }, new ZSTD_compressionParameters[23] { new ZSTD_compressionParameters(windowLog: 18, chainLog: 12, hashLog: 13, searchLog: 1, minMatch: 5, targetLength: 1, strategy: ZSTD_strategy.ZSTD_fast), new ZSTD_compressionParameters(windowLog: 18, chainLog: 13, hashLog: 14, searchLog: 1, minMatch: 6, targetLength: 0, strategy: ZSTD_strategy.ZSTD_fast), new ZSTD_compressionParameters(windowLog: 18, chainLog: 14, hashLog: 14, searchLog: 1, minMatch: 5, targetLength: 0, strategy: ZSTD_strategy.ZSTD_dfast), new ZSTD_compressionParameters(windowLog: 18, chainLog: 16, hashLog: 16, searchLog: 1, minMatch: 4, targetLength: 0, strategy: ZSTD_strategy.ZSTD_dfast), new ZSTD_compressionParameters(windowLog: 18, chainLog: 16, hashLog: 17, searchLog: 3, minMatch: 5, targetLength: 2, strategy: ZSTD_strategy.ZSTD_greedy), new ZSTD_compressionParameters(windowLog: 18, chainLog: 17, hashLog: 18, searchLog: 5, minMatch: 5, targetLength: 2, strategy: ZSTD_strategy.ZSTD_greedy), new ZSTD_compressionParameters(windowLog: 18, chainLog: 18, hashLog: 19, searchLog: 3, minMatch: 5, targetLength: 4, strategy: ZSTD_strategy.ZSTD_lazy), new ZSTD_compressionParameters(windowLog: 18, chainLog: 18, hashLog: 19, searchLog: 4, minMatch: 4, targetLength: 4, strategy: ZSTD_strategy.ZSTD_lazy), new ZSTD_compressionParameters(windowLog: 18, chainLog: 18, hashLog: 19, searchLog: 4, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 18, chainLog: 18, hashLog: 19, searchLog: 5, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 18, chainLog: 18, hashLog: 19, searchLog: 6, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 18, chainLog: 18, hashLog: 19, searchLog: 5, minMatch: 4, targetLength: 12, strategy: ZSTD_strategy.ZSTD_btlazy2), new ZSTD_compressionParameters(windowLog: 18, chainLog: 19, hashLog: 19, searchLog: 7, minMatch: 4, targetLength: 12, strategy: ZSTD_strategy.ZSTD_btlazy2), new ZSTD_compressionParameters(windowLog: 18, chainLog: 18, hashLog: 19, searchLog: 4, minMatch: 4, targetLength: 16, strategy: ZSTD_strategy.ZSTD_btopt), new ZSTD_compressionParameters(windowLog: 18, chainLog: 18, hashLog: 19, searchLog: 4, minMatch: 3, targetLength: 32, strategy: ZSTD_strategy.ZSTD_btopt), new ZSTD_compressionParameters(windowLog: 18, chainLog: 18, hashLog: 19, searchLog: 6, minMatch: 3, targetLength: 128, strategy: ZSTD_strategy.ZSTD_btopt), new ZSTD_compressionParameters(windowLog: 18, chainLog: 19, hashLog: 19, searchLog: 6, minMatch: 3, targetLength: 128, strategy: ZSTD_strategy.ZSTD_btultra), new ZSTD_compressionParameters(windowLog: 18, chainLog: 19, hashLog: 19, searchLog: 8, minMatch: 3, targetLength: 256, strategy: ZSTD_strategy.ZSTD_btultra), new ZSTD_compressionParameters(windowLog: 18, chainLog: 19, hashLog: 19, searchLog: 6, minMatch: 3, targetLength: 128, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 18, chainLog: 19, hashLog: 19, searchLog: 8, minMatch: 3, targetLength: 256, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 18, chainLog: 19, hashLog: 19, searchLog: 10, minMatch: 3, targetLength: 512, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 18, chainLog: 19, hashLog: 19, searchLog: 12, minMatch: 3, targetLength: 512, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 18, chainLog: 19, hashLog: 19, searchLog: 13, minMatch: 3, targetLength: 999, strategy: ZSTD_strategy.ZSTD_btultra2) }, new ZSTD_compressionParameters[23] { new ZSTD_compressionParameters(windowLog: 17, chainLog: 12, hashLog: 12, searchLog: 1, minMatch: 5, targetLength: 1, strategy: ZSTD_strategy.ZSTD_fast), new ZSTD_compressionParameters(windowLog: 17, chainLog: 12, hashLog: 13, searchLog: 1, minMatch: 6, targetLength: 0, strategy: ZSTD_strategy.ZSTD_fast), new ZSTD_compressionParameters(windowLog: 17, chainLog: 13, hashLog: 15, searchLog: 1, minMatch: 5, targetLength: 0, strategy: ZSTD_strategy.ZSTD_fast), new ZSTD_compressionParameters(windowLog: 17, chainLog: 15, hashLog: 16, searchLog: 2, minMatch: 5, targetLength: 0, strategy: ZSTD_strategy.ZSTD_dfast), new ZSTD_compressionParameters(windowLog: 17, chainLog: 17, hashLog: 17, searchLog: 2, minMatch: 4, targetLength: 0, strategy: ZSTD_strategy.ZSTD_dfast), new ZSTD_compressionParameters(windowLog: 17, chainLog: 16, hashLog: 17, searchLog: 3, minMatch: 4, targetLength: 2, strategy: ZSTD_strategy.ZSTD_greedy), new ZSTD_compressionParameters(windowLog: 17, chainLog: 16, hashLog: 17, searchLog: 3, minMatch: 4, targetLength: 4, strategy: ZSTD_strategy.ZSTD_lazy), new ZSTD_compressionParameters(windowLog: 17, chainLog: 16, hashLog: 17, searchLog: 3, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 17, chainLog: 16, hashLog: 17, searchLog: 4, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 17, chainLog: 16, hashLog: 17, searchLog: 5, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 17, chainLog: 16, hashLog: 17, searchLog: 6, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 17, chainLog: 17, hashLog: 17, searchLog: 5, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_btlazy2), new ZSTD_compressionParameters(windowLog: 17, chainLog: 18, hashLog: 17, searchLog: 7, minMatch: 4, targetLength: 12, strategy: ZSTD_strategy.ZSTD_btlazy2), new ZSTD_compressionParameters(windowLog: 17, chainLog: 18, hashLog: 17, searchLog: 3, minMatch: 4, targetLength: 12, strategy: ZSTD_strategy.ZSTD_btopt), new ZSTD_compressionParameters(windowLog: 17, chainLog: 18, hashLog: 17, searchLog: 4, minMatch: 3, targetLength: 32, strategy: ZSTD_strategy.ZSTD_btopt), new ZSTD_compressionParameters(windowLog: 17, chainLog: 18, hashLog: 17, searchLog: 6, minMatch: 3, targetLength: 256, strategy: ZSTD_strategy.ZSTD_btopt), new ZSTD_compressionParameters(windowLog: 17, chainLog: 18, hashLog: 17, searchLog: 6, minMatch: 3, targetLength: 128, strategy: ZSTD_strategy.ZSTD_btultra), new ZSTD_compressionParameters(windowLog: 17, chainLog: 18, hashLog: 17, searchLog: 8, minMatch: 3, targetLength: 256, strategy: ZSTD_strategy.ZSTD_btultra), new ZSTD_compressionParameters(windowLog: 17, chainLog: 18, hashLog: 17, searchLog: 10, minMatch: 3, targetLength: 512, strategy: ZSTD_strategy.ZSTD_btultra), new ZSTD_compressionParameters(windowLog: 17, chainLog: 18, hashLog: 17, searchLog: 5, minMatch: 3, targetLength: 256, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 17, chainLog: 18, hashLog: 17, searchLog: 7, minMatch: 3, targetLength: 512, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 17, chainLog: 18, hashLog: 17, searchLog: 9, minMatch: 3, targetLength: 512, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 17, chainLog: 18, hashLog: 17, searchLog: 11, minMatch: 3, targetLength: 999, strategy: ZSTD_strategy.ZSTD_btultra2) }, new ZSTD_compressionParameters[23] { new ZSTD_compressionParameters(windowLog: 14, chainLog: 12, hashLog: 13, searchLog: 1, minMatch: 5, targetLength: 1, strategy: ZSTD_strategy.ZSTD_fast), new ZSTD_compressionParameters(windowLog: 14, chainLog: 14, hashLog: 15, searchLog: 1, minMatch: 5, targetLength: 0, strategy: ZSTD_strategy.ZSTD_fast), new ZSTD_compressionParameters(windowLog: 14, chainLog: 14, hashLog: 15, searchLog: 1, minMatch: 4, targetLength: 0, strategy: ZSTD_strategy.ZSTD_fast), new ZSTD_compressionParameters(windowLog: 14, chainLog: 14, hashLog: 15, searchLog: 2, minMatch: 4, targetLength: 0, strategy: ZSTD_strategy.ZSTD_dfast), new ZSTD_compressionParameters(windowLog: 14, chainLog: 14, hashLog: 14, searchLog: 4, minMatch: 4, targetLength: 2, strategy: ZSTD_strategy.ZSTD_greedy), new ZSTD_compressionParameters(windowLog: 14, chainLog: 14, hashLog: 14, searchLog: 3, minMatch: 4, targetLength: 4, strategy: ZSTD_strategy.ZSTD_lazy), new ZSTD_compressionParameters(windowLog: 14, chainLog: 14, hashLog: 14, searchLog: 4, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 14, chainLog: 14, hashLog: 14, searchLog: 6, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 14, chainLog: 14, hashLog: 14, searchLog: 8, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_lazy2), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 14, searchLog: 5, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_btlazy2), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 14, searchLog: 9, minMatch: 4, targetLength: 8, strategy: ZSTD_strategy.ZSTD_btlazy2), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 14, searchLog: 3, minMatch: 4, targetLength: 12, strategy: ZSTD_strategy.ZSTD_btopt), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 14, searchLog: 4, minMatch: 3, targetLength: 24, strategy: ZSTD_strategy.ZSTD_btopt), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 14, searchLog: 5, minMatch: 3, targetLength: 32, strategy: ZSTD_strategy.ZSTD_btultra), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 15, searchLog: 6, minMatch: 3, targetLength: 64, strategy: ZSTD_strategy.ZSTD_btultra), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 15, searchLog: 7, minMatch: 3, targetLength: 256, strategy: ZSTD_strategy.ZSTD_btultra), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 15, searchLog: 5, minMatch: 3, targetLength: 48, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 15, searchLog: 6, minMatch: 3, targetLength: 128, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 15, searchLog: 7, minMatch: 3, targetLength: 256, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 15, searchLog: 8, minMatch: 3, targetLength: 256, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 15, searchLog: 8, minMatch: 3, targetLength: 512, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 15, searchLog: 9, minMatch: 3, targetLength: 512, strategy: ZSTD_strategy.ZSTD_btultra2), new ZSTD_compressionParameters(windowLog: 14, chainLog: 15, hashLog: 15, searchLog: 10, minMatch: 3, targetLength: 999, strategy: ZSTD_strategy.ZSTD_btultra2) } }; } } \ No newline at end of file diff --git a/src/ZstdSharp/Unsafe/FASTCOVER_accel_t.cs b/src/ZstdSharp/Unsafe/FASTCOVER_accel_t.cs index 4ea66ee..0ec97b4 100644 --- a/src/ZstdSharp/Unsafe/FASTCOVER_accel_t.cs +++ b/src/ZstdSharp/Unsafe/FASTCOVER_accel_t.cs @@ -9,5 +9,10 @@ public struct FASTCOVER_accel_t public uint finalize; /* Number of dmer skipped between each dmer counted in computeFrequency */ public uint skip; + public FASTCOVER_accel_t(uint finalize = default, uint skip = default) + { + this.finalize = finalize; + this.skip = skip; + } } } \ No newline at end of file diff --git a/src/ZstdSharp/Unsafe/Fastcover.cs b/src/ZstdSharp/Unsafe/Fastcover.cs index abb3540..d85e04f 100644 --- a/src/ZstdSharp/Unsafe/Fastcover.cs +++ b/src/ZstdSharp/Unsafe/Fastcover.cs @@ -20,7 +20,7 @@ private static nuint FASTCOVER_hashPtrToIndex(void* p, uint f, uint d) return ZSTD_hash8Ptr(p, f); } - private static readonly FASTCOVER_accel_t* FASTCOVER_defaultAccelParameters = GetArrayPointer(new FASTCOVER_accel_t[11] { new FASTCOVER_accel_t { finalize = 100, skip = 0 }, new FASTCOVER_accel_t { finalize = 100, skip = 0 }, new FASTCOVER_accel_t { finalize = 50, skip = 1 }, new FASTCOVER_accel_t { finalize = 34, skip = 2 }, new FASTCOVER_accel_t { finalize = 25, skip = 3 }, new FASTCOVER_accel_t { finalize = 20, skip = 4 }, new FASTCOVER_accel_t { finalize = 17, skip = 5 }, new FASTCOVER_accel_t { finalize = 14, skip = 6 }, new FASTCOVER_accel_t { finalize = 13, skip = 7 }, new FASTCOVER_accel_t { finalize = 11, skip = 8 }, new FASTCOVER_accel_t { finalize = 10, skip = 9 } }); + private static readonly FASTCOVER_accel_t* FASTCOVER_defaultAccelParameters = GetArrayPointer(new FASTCOVER_accel_t[11] { new FASTCOVER_accel_t(finalize: 100, skip: 0), new FASTCOVER_accel_t(finalize: 100, skip: 0), new FASTCOVER_accel_t(finalize: 50, skip: 1), new FASTCOVER_accel_t(finalize: 34, skip: 2), new FASTCOVER_accel_t(finalize: 25, skip: 3), new FASTCOVER_accel_t(finalize: 20, skip: 4), new FASTCOVER_accel_t(finalize: 17, skip: 5), new FASTCOVER_accel_t(finalize: 14, skip: 6), new FASTCOVER_accel_t(finalize: 13, skip: 7), new FASTCOVER_accel_t(finalize: 11, skip: 8), new FASTCOVER_accel_t(finalize: 10, skip: 9) }); /*-************************************* * Helper functions ***************************************/ diff --git a/src/ZstdSharp/Unsafe/HufDecompress.cs b/src/ZstdSharp/Unsafe/HufDecompress.cs index 365d9b9..da49c4d 100644 --- a/src/ZstdSharp/Unsafe/HufDecompress.cs +++ b/src/ZstdSharp/Unsafe/HufDecompress.cs @@ -1862,7 +1862,7 @@ private static nuint HUF_decompress4X2_DCtx_wksp(uint* dctx, void* dst, nuint ds return HUF_decompress4X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags); } - private static readonly algo_time_t[][] algoTime = new algo_time_t[16][] { new algo_time_t[2] { new algo_time_t { tableTime = 0, decode256Time = 0 }, new algo_time_t { tableTime = 1, decode256Time = 1 } }, new algo_time_t[2] { new algo_time_t { tableTime = 0, decode256Time = 0 }, new algo_time_t { tableTime = 1, decode256Time = 1 } }, new algo_time_t[2] { new algo_time_t { tableTime = 150, decode256Time = 216 }, new algo_time_t { tableTime = 381, decode256Time = 119 } }, new algo_time_t[2] { new algo_time_t { tableTime = 170, decode256Time = 205 }, new algo_time_t { tableTime = 514, decode256Time = 112 } }, new algo_time_t[2] { new algo_time_t { tableTime = 177, decode256Time = 199 }, new algo_time_t { tableTime = 539, decode256Time = 110 } }, new algo_time_t[2] { new algo_time_t { tableTime = 197, decode256Time = 194 }, new algo_time_t { tableTime = 644, decode256Time = 107 } }, new algo_time_t[2] { new algo_time_t { tableTime = 221, decode256Time = 192 }, new algo_time_t { tableTime = 735, decode256Time = 107 } }, new algo_time_t[2] { new algo_time_t { tableTime = 256, decode256Time = 189 }, new algo_time_t { tableTime = 881, decode256Time = 106 } }, new algo_time_t[2] { new algo_time_t { tableTime = 359, decode256Time = 188 }, new algo_time_t { tableTime = 1167, decode256Time = 109 } }, new algo_time_t[2] { new algo_time_t { tableTime = 582, decode256Time = 187 }, new algo_time_t { tableTime = 1570, decode256Time = 114 } }, new algo_time_t[2] { new algo_time_t { tableTime = 688, decode256Time = 187 }, new algo_time_t { tableTime = 1712, decode256Time = 122 } }, new algo_time_t[2] { new algo_time_t { tableTime = 825, decode256Time = 186 }, new algo_time_t { tableTime = 1965, decode256Time = 136 } }, new algo_time_t[2] { new algo_time_t { tableTime = 976, decode256Time = 185 }, new algo_time_t { tableTime = 2131, decode256Time = 150 } }, new algo_time_t[2] { new algo_time_t { tableTime = 1180, decode256Time = 186 }, new algo_time_t { tableTime = 2070, decode256Time = 175 } }, new algo_time_t[2] { new algo_time_t { tableTime = 1377, decode256Time = 185 }, new algo_time_t { tableTime = 1731, decode256Time = 202 } }, new algo_time_t[2] { new algo_time_t { tableTime = 1412, decode256Time = 185 }, new algo_time_t { tableTime = 1695, decode256Time = 202 } } }; + private static readonly algo_time_t[][] algoTime = new algo_time_t[16][] { new algo_time_t[2] { new algo_time_t(tableTime: 0, decode256Time: 0), new algo_time_t(tableTime: 1, decode256Time: 1) }, new algo_time_t[2] { new algo_time_t(tableTime: 0, decode256Time: 0), new algo_time_t(tableTime: 1, decode256Time: 1) }, new algo_time_t[2] { new algo_time_t(tableTime: 150, decode256Time: 216), new algo_time_t(tableTime: 381, decode256Time: 119) }, new algo_time_t[2] { new algo_time_t(tableTime: 170, decode256Time: 205), new algo_time_t(tableTime: 514, decode256Time: 112) }, new algo_time_t[2] { new algo_time_t(tableTime: 177, decode256Time: 199), new algo_time_t(tableTime: 539, decode256Time: 110) }, new algo_time_t[2] { new algo_time_t(tableTime: 197, decode256Time: 194), new algo_time_t(tableTime: 644, decode256Time: 107) }, new algo_time_t[2] { new algo_time_t(tableTime: 221, decode256Time: 192), new algo_time_t(tableTime: 735, decode256Time: 107) }, new algo_time_t[2] { new algo_time_t(tableTime: 256, decode256Time: 189), new algo_time_t(tableTime: 881, decode256Time: 106) }, new algo_time_t[2] { new algo_time_t(tableTime: 359, decode256Time: 188), new algo_time_t(tableTime: 1167, decode256Time: 109) }, new algo_time_t[2] { new algo_time_t(tableTime: 582, decode256Time: 187), new algo_time_t(tableTime: 1570, decode256Time: 114) }, new algo_time_t[2] { new algo_time_t(tableTime: 688, decode256Time: 187), new algo_time_t(tableTime: 1712, decode256Time: 122) }, new algo_time_t[2] { new algo_time_t(tableTime: 825, decode256Time: 186), new algo_time_t(tableTime: 1965, decode256Time: 136) }, new algo_time_t[2] { new algo_time_t(tableTime: 976, decode256Time: 185), new algo_time_t(tableTime: 2131, decode256Time: 150) }, new algo_time_t[2] { new algo_time_t(tableTime: 1180, decode256Time: 186), new algo_time_t(tableTime: 2070, decode256Time: 175) }, new algo_time_t[2] { new algo_time_t(tableTime: 1377, decode256Time: 185), new algo_time_t(tableTime: 1731, decode256Time: 202) }, new algo_time_t[2] { new algo_time_t(tableTime: 1412, decode256Time: 185), new algo_time_t(tableTime: 1695, decode256Time: 202) } }; /** HUF_selectDecoder() : * Tells which decoder is likely to decode faster, * based on a set of pre-computed metrics. diff --git a/src/ZstdSharp/Unsafe/ZSTD_compressionParameters.cs b/src/ZstdSharp/Unsafe/ZSTD_compressionParameters.cs index e884094..f1826f4 100644 --- a/src/ZstdSharp/Unsafe/ZSTD_compressionParameters.cs +++ b/src/ZstdSharp/Unsafe/ZSTD_compressionParameters.cs @@ -16,5 +16,15 @@ public struct ZSTD_compressionParameters public uint targetLength; /**< see ZSTD_strategy definition above */ public ZSTD_strategy strategy; + public ZSTD_compressionParameters(uint windowLog = default, uint chainLog = default, uint hashLog = default, uint searchLog = default, uint minMatch = default, uint targetLength = default, ZSTD_strategy strategy = default) + { + this.windowLog = windowLog; + this.chainLog = chainLog; + this.hashLog = hashLog; + this.searchLog = searchLog; + this.minMatch = minMatch; + this.targetLength = targetLength; + this.strategy = strategy; + } } } \ No newline at end of file diff --git a/src/ZstdSharp/Unsafe/ZSTD_customMem.cs b/src/ZstdSharp/Unsafe/ZSTD_customMem.cs index d728ae6..6625a18 100644 --- a/src/ZstdSharp/Unsafe/ZSTD_customMem.cs +++ b/src/ZstdSharp/Unsafe/ZSTD_customMem.cs @@ -5,5 +5,11 @@ public unsafe struct ZSTD_customMem public void* customAlloc; public void* customFree; public void* opaque; + public ZSTD_customMem(void* customAlloc = default, void* customFree = default, void* opaque = default) + { + this.customAlloc = customAlloc; + this.customFree = customFree; + this.opaque = opaque; + } } } \ No newline at end of file diff --git a/src/ZstdSharp/Unsafe/ZSTD_seqSymbol.cs b/src/ZstdSharp/Unsafe/ZSTD_seqSymbol.cs index 8aa7f22..11662af 100644 --- a/src/ZstdSharp/Unsafe/ZSTD_seqSymbol.cs +++ b/src/ZstdSharp/Unsafe/ZSTD_seqSymbol.cs @@ -6,5 +6,12 @@ public struct ZSTD_seqSymbol public byte nbAdditionalBits; public byte nbBits; public uint baseValue; + public ZSTD_seqSymbol(ushort nextState = default, byte nbAdditionalBits = default, byte nbBits = default, uint baseValue = default) + { + this.nextState = nextState; + this.nbAdditionalBits = nbAdditionalBits; + this.nbBits = nbBits; + this.baseValue = baseValue; + } } } \ No newline at end of file diff --git a/src/ZstdSharp/Unsafe/Zstd.cs b/src/ZstdSharp/Unsafe/Zstd.cs index 1e555a0..875d50b 100644 --- a/src/ZstdSharp/Unsafe/Zstd.cs +++ b/src/ZstdSharp/Unsafe/Zstd.cs @@ -2,6 +2,6 @@ namespace ZstdSharp.Unsafe { public static unsafe partial class Methods { - private static readonly ZSTD_customMem ZSTD_defaultCMem = new ZSTD_customMem { customAlloc = null, customFree = null, opaque = null }; + private static readonly ZSTD_customMem ZSTD_defaultCMem = new ZSTD_customMem(customAlloc: null, customFree: null, opaque: null); } } \ No newline at end of file diff --git a/src/ZstdSharp/Unsafe/ZstdCompressInternal.cs b/src/ZstdSharp/Unsafe/ZstdCompressInternal.cs index 2bfa0d4..b7f04f0 100644 --- a/src/ZstdSharp/Unsafe/ZstdCompressInternal.cs +++ b/src/ZstdSharp/Unsafe/ZstdCompressInternal.cs @@ -7,7 +7,7 @@ namespace ZstdSharp.Unsafe { public static unsafe partial class Methods { - private static readonly rawSeqStore_t kNullRawSeqStore = new rawSeqStore_t { seq = null, pos = 0, posInSequence = 0, size = 0, capacity = 0 }; + private static readonly rawSeqStore_t kNullRawSeqStore = new rawSeqStore_t(seq: null, pos: 0, posInSequence: 0, size: 0, capacity: 0); #if NET7_0_OR_GREATER private static ReadOnlySpan Span_LL_Code => new byte[64]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24}; private static byte* LL_Code => (byte*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref MemoryMarshal.GetReference(Span_LL_Code)); diff --git a/src/ZstdSharp/Unsafe/ZstdDecompressBlock.cs b/src/ZstdSharp/Unsafe/ZstdDecompressBlock.cs index f739516..5479726 100644 --- a/src/ZstdSharp/Unsafe/ZstdDecompressBlock.cs +++ b/src/ZstdSharp/Unsafe/ZstdDecompressBlock.cs @@ -359,9 +359,9 @@ private static nuint ZSTD_decodeLiteralsBlock(ZSTD_DCtx_s* dctx, void* src, nuin } } - private static readonly ZSTD_seqSymbol* LL_defaultDTable = GetArrayPointer(new ZSTD_seqSymbol[65] { new ZSTD_seqSymbol { nextState = 1, nbAdditionalBits = 1, nbBits = 1, baseValue = 6 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 4, baseValue = 0 }, new ZSTD_seqSymbol { nextState = 16, nbAdditionalBits = 0, nbBits = 4, baseValue = 0 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 1 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 3 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 4 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 6 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 7 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 9 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 10 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 12 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 14 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 1, nbBits = 5, baseValue = 16 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 1, nbBits = 5, baseValue = 20 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 1, nbBits = 5, baseValue = 22 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 2, nbBits = 5, baseValue = 28 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 3, nbBits = 5, baseValue = 32 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 4, nbBits = 5, baseValue = 48 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 6, nbBits = 5, baseValue = 64 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 7, nbBits = 5, baseValue = 128 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 8, nbBits = 6, baseValue = 256 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 10, nbBits = 6, baseValue = 1024 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 12, nbBits = 6, baseValue = 4096 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 4, baseValue = 0 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 4, baseValue = 1 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 2 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 4 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 5 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 7 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 8 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 10 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 11 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 13 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 1, nbBits = 5, baseValue = 16 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 1, nbBits = 5, baseValue = 18 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 1, nbBits = 5, baseValue = 22 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 2, nbBits = 5, baseValue = 24 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 3, nbBits = 5, baseValue = 32 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 3, nbBits = 5, baseValue = 40 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 6, nbBits = 4, baseValue = 64 }, new ZSTD_seqSymbol { nextState = 16, nbAdditionalBits = 6, nbBits = 4, baseValue = 64 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 7, nbBits = 5, baseValue = 128 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 9, nbBits = 6, baseValue = 512 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 11, nbBits = 6, baseValue = 2048 }, new ZSTD_seqSymbol { nextState = 48, nbAdditionalBits = 0, nbBits = 4, baseValue = 0 }, new ZSTD_seqSymbol { nextState = 16, nbAdditionalBits = 0, nbBits = 4, baseValue = 1 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 2 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 3 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 5 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 6 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 8 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 9 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 11 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 12 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 15 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 1, nbBits = 5, baseValue = 18 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 1, nbBits = 5, baseValue = 20 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 2, nbBits = 5, baseValue = 24 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 2, nbBits = 5, baseValue = 28 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 3, nbBits = 5, baseValue = 40 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 4, nbBits = 5, baseValue = 48 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 16, nbBits = 6, baseValue = 65536 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 15, nbBits = 6, baseValue = 32768 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 14, nbBits = 6, baseValue = 16384 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 13, nbBits = 6, baseValue = 8192 } }); - private static readonly ZSTD_seqSymbol* OF_defaultDTable = GetArrayPointer(new ZSTD_seqSymbol[33] { new ZSTD_seqSymbol { nextState = 1, nbAdditionalBits = 1, nbBits = 1, baseValue = 5 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 0 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 6, nbBits = 4, baseValue = 61 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 9, nbBits = 5, baseValue = 509 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 15, nbBits = 5, baseValue = 32765 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 21, nbBits = 5, baseValue = 2097149 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 3, nbBits = 5, baseValue = 5 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 7, nbBits = 4, baseValue = 125 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 12, nbBits = 5, baseValue = 4093 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 18, nbBits = 5, baseValue = 262141 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 23, nbBits = 5, baseValue = 8388605 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 5, nbBits = 5, baseValue = 29 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 8, nbBits = 4, baseValue = 253 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 14, nbBits = 5, baseValue = 16381 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 20, nbBits = 5, baseValue = 1048573 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 2, nbBits = 5, baseValue = 1 }, new ZSTD_seqSymbol { nextState = 16, nbAdditionalBits = 7, nbBits = 4, baseValue = 125 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 11, nbBits = 5, baseValue = 2045 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 17, nbBits = 5, baseValue = 131069 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 22, nbBits = 5, baseValue = 4194301 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 4, nbBits = 5, baseValue = 13 }, new ZSTD_seqSymbol { nextState = 16, nbAdditionalBits = 8, nbBits = 4, baseValue = 253 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 13, nbBits = 5, baseValue = 8189 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 19, nbBits = 5, baseValue = 524285 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 1, nbBits = 5, baseValue = 1 }, new ZSTD_seqSymbol { nextState = 16, nbAdditionalBits = 6, nbBits = 4, baseValue = 61 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 10, nbBits = 5, baseValue = 1021 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 16, nbBits = 5, baseValue = 65533 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 28, nbBits = 5, baseValue = 268435453 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 27, nbBits = 5, baseValue = 134217725 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 26, nbBits = 5, baseValue = 67108861 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 25, nbBits = 5, baseValue = 33554429 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 24, nbBits = 5, baseValue = 16777213 } }); - private static readonly ZSTD_seqSymbol* ML_defaultDTable = GetArrayPointer(new ZSTD_seqSymbol[65] { new ZSTD_seqSymbol { nextState = 1, nbAdditionalBits = 1, nbBits = 1, baseValue = 6 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 3 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 4, baseValue = 4 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 5 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 6 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 8 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 9 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 11 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 13 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 16 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 19 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 22 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 25 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 28 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 31 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 34 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 1, nbBits = 6, baseValue = 37 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 1, nbBits = 6, baseValue = 41 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 2, nbBits = 6, baseValue = 47 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 3, nbBits = 6, baseValue = 59 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 4, nbBits = 6, baseValue = 83 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 7, nbBits = 6, baseValue = 131 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 9, nbBits = 6, baseValue = 515 }, new ZSTD_seqSymbol { nextState = 16, nbAdditionalBits = 0, nbBits = 4, baseValue = 4 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 4, baseValue = 5 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 6 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 7 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 9 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 5, baseValue = 10 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 12 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 15 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 18 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 21 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 24 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 27 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 30 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 33 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 1, nbBits = 6, baseValue = 35 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 1, nbBits = 6, baseValue = 39 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 2, nbBits = 6, baseValue = 43 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 3, nbBits = 6, baseValue = 51 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 4, nbBits = 6, baseValue = 67 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 5, nbBits = 6, baseValue = 99 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 8, nbBits = 6, baseValue = 259 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 4, baseValue = 4 }, new ZSTD_seqSymbol { nextState = 48, nbAdditionalBits = 0, nbBits = 4, baseValue = 4 }, new ZSTD_seqSymbol { nextState = 16, nbAdditionalBits = 0, nbBits = 4, baseValue = 5 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 7 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 8 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 10 }, new ZSTD_seqSymbol { nextState = 32, nbAdditionalBits = 0, nbBits = 5, baseValue = 11 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 14 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 17 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 20 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 23 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 26 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 29 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 0, nbBits = 6, baseValue = 32 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 16, nbBits = 6, baseValue = 65539 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 15, nbBits = 6, baseValue = 32771 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 14, nbBits = 6, baseValue = 16387 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 13, nbBits = 6, baseValue = 8195 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 12, nbBits = 6, baseValue = 4099 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 11, nbBits = 6, baseValue = 2051 }, new ZSTD_seqSymbol { nextState = 0, nbAdditionalBits = 10, nbBits = 6, baseValue = 1027 } }); + private static readonly ZSTD_seqSymbol* LL_defaultDTable = GetArrayPointer(new ZSTD_seqSymbol[65] { new ZSTD_seqSymbol(nextState: 1, nbAdditionalBits: 1, nbBits: 1, baseValue: 6), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 4, baseValue: 0), new ZSTD_seqSymbol(nextState: 16, nbAdditionalBits: 0, nbBits: 4, baseValue: 0), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 1), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 3), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 4), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 6), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 7), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 9), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 10), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 12), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 14), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 1, nbBits: 5, baseValue: 16), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 1, nbBits: 5, baseValue: 20), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 1, nbBits: 5, baseValue: 22), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 2, nbBits: 5, baseValue: 28), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 3, nbBits: 5, baseValue: 32), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 4, nbBits: 5, baseValue: 48), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 6, nbBits: 5, baseValue: 64), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 7, nbBits: 5, baseValue: 128), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 8, nbBits: 6, baseValue: 256), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 10, nbBits: 6, baseValue: 1024), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 12, nbBits: 6, baseValue: 4096), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 4, baseValue: 0), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 4, baseValue: 1), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 2), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 4), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 5), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 7), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 8), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 10), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 11), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 13), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 1, nbBits: 5, baseValue: 16), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 1, nbBits: 5, baseValue: 18), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 1, nbBits: 5, baseValue: 22), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 2, nbBits: 5, baseValue: 24), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 3, nbBits: 5, baseValue: 32), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 3, nbBits: 5, baseValue: 40), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 6, nbBits: 4, baseValue: 64), new ZSTD_seqSymbol(nextState: 16, nbAdditionalBits: 6, nbBits: 4, baseValue: 64), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 7, nbBits: 5, baseValue: 128), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 9, nbBits: 6, baseValue: 512), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 11, nbBits: 6, baseValue: 2048), new ZSTD_seqSymbol(nextState: 48, nbAdditionalBits: 0, nbBits: 4, baseValue: 0), new ZSTD_seqSymbol(nextState: 16, nbAdditionalBits: 0, nbBits: 4, baseValue: 1), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 2), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 3), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 5), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 6), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 8), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 9), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 11), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 12), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 15), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 1, nbBits: 5, baseValue: 18), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 1, nbBits: 5, baseValue: 20), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 2, nbBits: 5, baseValue: 24), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 2, nbBits: 5, baseValue: 28), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 3, nbBits: 5, baseValue: 40), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 4, nbBits: 5, baseValue: 48), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 16, nbBits: 6, baseValue: 65536), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 15, nbBits: 6, baseValue: 32768), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 14, nbBits: 6, baseValue: 16384), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 13, nbBits: 6, baseValue: 8192) }); + private static readonly ZSTD_seqSymbol* OF_defaultDTable = GetArrayPointer(new ZSTD_seqSymbol[33] { new ZSTD_seqSymbol(nextState: 1, nbAdditionalBits: 1, nbBits: 1, baseValue: 5), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 0), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 6, nbBits: 4, baseValue: 61), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 9, nbBits: 5, baseValue: 509), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 15, nbBits: 5, baseValue: 32765), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 21, nbBits: 5, baseValue: 2097149), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 3, nbBits: 5, baseValue: 5), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 7, nbBits: 4, baseValue: 125), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 12, nbBits: 5, baseValue: 4093), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 18, nbBits: 5, baseValue: 262141), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 23, nbBits: 5, baseValue: 8388605), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 5, nbBits: 5, baseValue: 29), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 8, nbBits: 4, baseValue: 253), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 14, nbBits: 5, baseValue: 16381), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 20, nbBits: 5, baseValue: 1048573), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 2, nbBits: 5, baseValue: 1), new ZSTD_seqSymbol(nextState: 16, nbAdditionalBits: 7, nbBits: 4, baseValue: 125), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 11, nbBits: 5, baseValue: 2045), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 17, nbBits: 5, baseValue: 131069), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 22, nbBits: 5, baseValue: 4194301), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 4, nbBits: 5, baseValue: 13), new ZSTD_seqSymbol(nextState: 16, nbAdditionalBits: 8, nbBits: 4, baseValue: 253), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 13, nbBits: 5, baseValue: 8189), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 19, nbBits: 5, baseValue: 524285), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 1, nbBits: 5, baseValue: 1), new ZSTD_seqSymbol(nextState: 16, nbAdditionalBits: 6, nbBits: 4, baseValue: 61), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 10, nbBits: 5, baseValue: 1021), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 16, nbBits: 5, baseValue: 65533), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 28, nbBits: 5, baseValue: 268435453), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 27, nbBits: 5, baseValue: 134217725), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 26, nbBits: 5, baseValue: 67108861), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 25, nbBits: 5, baseValue: 33554429), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 24, nbBits: 5, baseValue: 16777213) }); + private static readonly ZSTD_seqSymbol* ML_defaultDTable = GetArrayPointer(new ZSTD_seqSymbol[65] { new ZSTD_seqSymbol(nextState: 1, nbAdditionalBits: 1, nbBits: 1, baseValue: 6), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 3), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 4, baseValue: 4), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 5), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 6), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 8), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 9), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 11), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 13), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 16), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 19), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 22), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 25), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 28), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 31), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 34), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 1, nbBits: 6, baseValue: 37), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 1, nbBits: 6, baseValue: 41), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 2, nbBits: 6, baseValue: 47), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 3, nbBits: 6, baseValue: 59), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 4, nbBits: 6, baseValue: 83), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 7, nbBits: 6, baseValue: 131), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 9, nbBits: 6, baseValue: 515), new ZSTD_seqSymbol(nextState: 16, nbAdditionalBits: 0, nbBits: 4, baseValue: 4), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 4, baseValue: 5), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 6), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 7), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 9), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 5, baseValue: 10), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 12), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 15), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 18), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 21), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 24), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 27), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 30), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 33), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 1, nbBits: 6, baseValue: 35), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 1, nbBits: 6, baseValue: 39), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 2, nbBits: 6, baseValue: 43), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 3, nbBits: 6, baseValue: 51), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 4, nbBits: 6, baseValue: 67), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 5, nbBits: 6, baseValue: 99), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 8, nbBits: 6, baseValue: 259), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 4, baseValue: 4), new ZSTD_seqSymbol(nextState: 48, nbAdditionalBits: 0, nbBits: 4, baseValue: 4), new ZSTD_seqSymbol(nextState: 16, nbAdditionalBits: 0, nbBits: 4, baseValue: 5), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 7), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 8), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 10), new ZSTD_seqSymbol(nextState: 32, nbAdditionalBits: 0, nbBits: 5, baseValue: 11), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 14), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 17), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 20), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 23), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 26), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 29), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 0, nbBits: 6, baseValue: 32), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 16, nbBits: 6, baseValue: 65539), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 15, nbBits: 6, baseValue: 32771), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 14, nbBits: 6, baseValue: 16387), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 13, nbBits: 6, baseValue: 8195), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 12, nbBits: 6, baseValue: 4099), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 11, nbBits: 6, baseValue: 2051), new ZSTD_seqSymbol(nextState: 0, nbAdditionalBits: 10, nbBits: 6, baseValue: 1027) }); private static void ZSTD_buildSeqTable_rle(ZSTD_seqSymbol* dt, uint baseValue, byte nbAddBits) { void* ptr = dt; diff --git a/src/ZstdSharp/Unsafe/algo_time_t.cs b/src/ZstdSharp/Unsafe/algo_time_t.cs index 92480ce..f449682 100644 --- a/src/ZstdSharp/Unsafe/algo_time_t.cs +++ b/src/ZstdSharp/Unsafe/algo_time_t.cs @@ -4,5 +4,10 @@ public struct algo_time_t { public uint tableTime; public uint decode256Time; + public algo_time_t(uint tableTime = default, uint decode256Time = default) + { + this.tableTime = tableTime; + this.decode256Time = decode256Time; + } } } \ No newline at end of file diff --git a/src/ZstdSharp/Unsafe/rawSeqStore_t.cs b/src/ZstdSharp/Unsafe/rawSeqStore_t.cs index c3f42c3..0720ff7 100644 --- a/src/ZstdSharp/Unsafe/rawSeqStore_t.cs +++ b/src/ZstdSharp/Unsafe/rawSeqStore_t.cs @@ -13,5 +13,13 @@ public unsafe struct rawSeqStore_t public nuint size; /* The capacity starting from `seq` pointer */ public nuint capacity; + public rawSeqStore_t(rawSeq* seq = default, nuint pos = default, nuint posInSequence = default, nuint size = default, nuint capacity = default) + { + this.seq = seq; + this.pos = pos; + this.posInSequence = posInSequence; + this.size = size; + this.capacity = capacity; + } } } \ No newline at end of file