Skip to content

Commit

Permalink
Private/readonly fields
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-st committed Oct 5, 2023
1 parent 43f9853 commit b1f90a7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/ZstdSharp/Unsafe/Clevels.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/ZstdSharp/Unsafe/HufDecompress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.
Expand Down
4 changes: 2 additions & 2 deletions src/ZstdSharp/Unsafe/ZstdCompress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3119,8 +3119,8 @@ private static nuint ZSTD_entropyCompressSeqStore(seqStore_t* seqStorePtr, ZSTD_
return cSize;
}

private static ZSTD_blockCompressor[][] blockCompressor = new ZSTD_blockCompressor[4][] { new ZSTD_blockCompressor[10] { ZSTD_compressBlock_fast, ZSTD_compressBlock_fast, ZSTD_compressBlock_doubleFast, ZSTD_compressBlock_greedy, ZSTD_compressBlock_lazy, ZSTD_compressBlock_lazy2, ZSTD_compressBlock_btlazy2, ZSTD_compressBlock_btopt, ZSTD_compressBlock_btultra, ZSTD_compressBlock_btultra2 }, new ZSTD_blockCompressor[10] { ZSTD_compressBlock_fast_extDict, ZSTD_compressBlock_fast_extDict, ZSTD_compressBlock_doubleFast_extDict, ZSTD_compressBlock_greedy_extDict, ZSTD_compressBlock_lazy_extDict, ZSTD_compressBlock_lazy2_extDict, ZSTD_compressBlock_btlazy2_extDict, ZSTD_compressBlock_btopt_extDict, ZSTD_compressBlock_btultra_extDict, ZSTD_compressBlock_btultra_extDict }, new ZSTD_blockCompressor[10] { ZSTD_compressBlock_fast_dictMatchState, ZSTD_compressBlock_fast_dictMatchState, ZSTD_compressBlock_doubleFast_dictMatchState, ZSTD_compressBlock_greedy_dictMatchState, ZSTD_compressBlock_lazy_dictMatchState, ZSTD_compressBlock_lazy2_dictMatchState, ZSTD_compressBlock_btlazy2_dictMatchState, ZSTD_compressBlock_btopt_dictMatchState, ZSTD_compressBlock_btultra_dictMatchState, ZSTD_compressBlock_btultra_dictMatchState }, new ZSTD_blockCompressor[10] { null, null, null, ZSTD_compressBlock_greedy_dedicatedDictSearch, ZSTD_compressBlock_lazy_dedicatedDictSearch, ZSTD_compressBlock_lazy2_dedicatedDictSearch, null, null, null, null } };
private static ZSTD_blockCompressor[][] rowBasedBlockCompressors = new ZSTD_blockCompressor[4][] { new ZSTD_blockCompressor[3] { ZSTD_compressBlock_greedy_row, ZSTD_compressBlock_lazy_row, ZSTD_compressBlock_lazy2_row }, new ZSTD_blockCompressor[3] { ZSTD_compressBlock_greedy_extDict_row, ZSTD_compressBlock_lazy_extDict_row, ZSTD_compressBlock_lazy2_extDict_row }, new ZSTD_blockCompressor[3] { ZSTD_compressBlock_greedy_dictMatchState_row, ZSTD_compressBlock_lazy_dictMatchState_row, ZSTD_compressBlock_lazy2_dictMatchState_row }, new ZSTD_blockCompressor[3] { ZSTD_compressBlock_greedy_dedicatedDictSearch_row, ZSTD_compressBlock_lazy_dedicatedDictSearch_row, ZSTD_compressBlock_lazy2_dedicatedDictSearch_row } };
private static readonly ZSTD_blockCompressor[][] blockCompressor = new ZSTD_blockCompressor[4][] { new ZSTD_blockCompressor[10] { ZSTD_compressBlock_fast, ZSTD_compressBlock_fast, ZSTD_compressBlock_doubleFast, ZSTD_compressBlock_greedy, ZSTD_compressBlock_lazy, ZSTD_compressBlock_lazy2, ZSTD_compressBlock_btlazy2, ZSTD_compressBlock_btopt, ZSTD_compressBlock_btultra, ZSTD_compressBlock_btultra2 }, new ZSTD_blockCompressor[10] { ZSTD_compressBlock_fast_extDict, ZSTD_compressBlock_fast_extDict, ZSTD_compressBlock_doubleFast_extDict, ZSTD_compressBlock_greedy_extDict, ZSTD_compressBlock_lazy_extDict, ZSTD_compressBlock_lazy2_extDict, ZSTD_compressBlock_btlazy2_extDict, ZSTD_compressBlock_btopt_extDict, ZSTD_compressBlock_btultra_extDict, ZSTD_compressBlock_btultra_extDict }, new ZSTD_blockCompressor[10] { ZSTD_compressBlock_fast_dictMatchState, ZSTD_compressBlock_fast_dictMatchState, ZSTD_compressBlock_doubleFast_dictMatchState, ZSTD_compressBlock_greedy_dictMatchState, ZSTD_compressBlock_lazy_dictMatchState, ZSTD_compressBlock_lazy2_dictMatchState, ZSTD_compressBlock_btlazy2_dictMatchState, ZSTD_compressBlock_btopt_dictMatchState, ZSTD_compressBlock_btultra_dictMatchState, ZSTD_compressBlock_btultra_dictMatchState }, new ZSTD_blockCompressor[10] { null, null, null, ZSTD_compressBlock_greedy_dedicatedDictSearch, ZSTD_compressBlock_lazy_dedicatedDictSearch, ZSTD_compressBlock_lazy2_dedicatedDictSearch, null, null, null, null } };
private static readonly ZSTD_blockCompressor[][] rowBasedBlockCompressors = new ZSTD_blockCompressor[4][] { new ZSTD_blockCompressor[3] { ZSTD_compressBlock_greedy_row, ZSTD_compressBlock_lazy_row, ZSTD_compressBlock_lazy2_row }, new ZSTD_blockCompressor[3] { ZSTD_compressBlock_greedy_extDict_row, ZSTD_compressBlock_lazy_extDict_row, ZSTD_compressBlock_lazy2_extDict_row }, new ZSTD_blockCompressor[3] { ZSTD_compressBlock_greedy_dictMatchState_row, ZSTD_compressBlock_lazy_dictMatchState_row, ZSTD_compressBlock_lazy2_dictMatchState_row }, new ZSTD_blockCompressor[3] { ZSTD_compressBlock_greedy_dedicatedDictSearch_row, ZSTD_compressBlock_lazy_dedicatedDictSearch_row, ZSTD_compressBlock_lazy2_dedicatedDictSearch_row } };
/* ZSTD_selectBlockCompressor() :
* Not static, but internal use only (used by long distance matcher)
* assumption : strat is a valid strategy */
Expand Down
6 changes: 3 additions & 3 deletions src/ZstdSharp/Unsafe/ZstdOpt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ private static uint ZSTD_scaleStats(uint* table, uint lastEltIndex, uint logTarg
return ZSTD_downscaleStats(table, lastEltIndex, ZSTD_highbit32(factor), base_directive_e.base_1guaranteed);
}

public static readonly uint* baseLLfreqs = GetArrayPointer(new uint[36] { 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static readonly uint* baseOFCfreqs = GetArrayPointer(new uint[32] { 6, 2, 1, 1, 2, 3, 4, 4, 4, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
private static readonly uint* baseLLfreqs = GetArrayPointer(new uint[36] { 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
private static readonly uint* baseOFCfreqs = GetArrayPointer(new uint[32] { 6, 2, 1, 1, 2, 3, 4, 4, 4, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
/* ZSTD_rescaleFreqs() :
* if first block (detected by optPtr->litLengthSum == 0) : init statistics
* take hints from dictionary if there is one
Expand Down Expand Up @@ -817,7 +817,7 @@ private static uint ZSTD_btGetAllMatches_dictMatchState_6(ZSTD_match_t* matches,
return ZSTD_btGetAllMatches_internal(matches, ms, nextToUpdate3, ip, iHighLimit, rep, ll0, lengthToBeat, ZSTD_dictMode_e.ZSTD_dictMatchState, 6);
}

public static ZSTD_getAllMatchesFn[][] getAllMatchesFns = new ZSTD_getAllMatchesFn[3][] { new ZSTD_getAllMatchesFn[4] { ZSTD_btGetAllMatches_noDict_3, ZSTD_btGetAllMatches_noDict_4, ZSTD_btGetAllMatches_noDict_5, ZSTD_btGetAllMatches_noDict_6 }, new ZSTD_getAllMatchesFn[4] { ZSTD_btGetAllMatches_extDict_3, ZSTD_btGetAllMatches_extDict_4, ZSTD_btGetAllMatches_extDict_5, ZSTD_btGetAllMatches_extDict_6 }, new ZSTD_getAllMatchesFn[4] { ZSTD_btGetAllMatches_dictMatchState_3, ZSTD_btGetAllMatches_dictMatchState_4, ZSTD_btGetAllMatches_dictMatchState_5, ZSTD_btGetAllMatches_dictMatchState_6 } };
private static readonly ZSTD_getAllMatchesFn[][] getAllMatchesFns = new ZSTD_getAllMatchesFn[3][] { new ZSTD_getAllMatchesFn[4] { ZSTD_btGetAllMatches_noDict_3, ZSTD_btGetAllMatches_noDict_4, ZSTD_btGetAllMatches_noDict_5, ZSTD_btGetAllMatches_noDict_6 }, new ZSTD_getAllMatchesFn[4] { ZSTD_btGetAllMatches_extDict_3, ZSTD_btGetAllMatches_extDict_4, ZSTD_btGetAllMatches_extDict_5, ZSTD_btGetAllMatches_extDict_6 }, new ZSTD_getAllMatchesFn[4] { ZSTD_btGetAllMatches_dictMatchState_3, ZSTD_btGetAllMatches_dictMatchState_4, ZSTD_btGetAllMatches_dictMatchState_5, ZSTD_btGetAllMatches_dictMatchState_6 } };
private static ZSTD_getAllMatchesFn ZSTD_selectBtGetAllMatches(ZSTD_matchState_t* ms, ZSTD_dictMode_e dictMode)
{
uint mls = 3 > (ms->cParams.minMatch < 6 ? ms->cParams.minMatch : 6) ? 3 : ms->cParams.minMatch < 6 ? ms->cParams.minMatch : 6;
Expand Down

0 comments on commit b1f90a7

Please sign in to comment.