Function report |
Source Code:lib\zstd\compress.c |
Create Date:2022-07-28 07:03:57 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:ZSTD_insertBtAndFindBestMatch
Proto:static size_t ZSTD_insertBtAndFindBestMatch(ZSTD_CCtx *zc, const BYTE *const ip, const BYTE *const iend, size_t *offsetPtr, U32 nbCompares, const U32 mls, U32 extDict)
Type:size_t
Parameter:
| Type | Parameter | Name |
|---|---|---|
| ZSTD_CCtx * | zc | |
| const BYTE *const | ip | |
| const BYTE *const | iend | |
| size_t * | offsetPtr | |
| U32 | nbCompares | |
| const U32 | mls | |
| U32 | extDict |
| 1648 | h = ZSTD_hashPtr(ip, hashLog, mls) |
| 1649 | bt = chainTable |
| 1652 | matchIndex = hashTable[h] |
| 1653 | commonLengthSmaller = 0 , commonLengthLarger = 0 |
| 1658 | prefixStart = base + dictLimit |
| 1662 | smallerPtr = bt + 2 * (curr & btMask) |
| 1664 | matchEndIdx = curr + 8 |
| 1666 | bestLength = 0 |
| 1670 | When nbCompares-- && matchIndex > windowLow cycle |
| 1671 | nextPtr = bt + 2 * (matchIndex & btMask) |
| 1672 | matchLength = -************************************** shared macros(commonLengthSmaller, commonLengthLarger) |
| 1675 | If Not extDict || matchIndex + matchLength >= dictLimit Then |
| 1676 | match = base + matchIndex |
| 1677 | If match[matchLength] == ip[matchLength] Then matchLength += ZSTD_count(ip + matchLength + 1, match + matchLength + 1, iend) + 1 |
| 1679 | Else |
| 1680 | match = dictBase + matchIndex |
| 1681 | matchLength += ZSTD_count_2segments() :* can count match length with `ip` & `match` in 2 different segments.* convention : on reaching mEnd, match count continue starting from iStart |
| 1682 | If matchIndex + matchLength >= dictLimit Then match = base + matchIndex |
| 1686 | If matchLength > bestLength Then |
| 1687 | If matchLength > matchEndIdx - matchIndex Then matchEndIdx = matchIndex + matchLength |
| 1689 | If 4 * (matchLength - bestLength) > ====== common function ====== - ====== common function ====== Then bestLength = matchLength , offsetPtr = ZSTD_REP_MOVE + curr - matchIndex |
| 1691 | If ip + matchLength == iend Then Break |
| 1695 | If match[matchLength] < ip[matchLength] Then |
| 1697 | smallerPtr = matchIndex |
| 1698 | commonLengthSmaller = matchLength |
| 1699 | If matchIndex <= btLow Then |
| 1700 | smallerPtr = dummy32 |
| 1701 | Break |
| 1703 | smallerPtr = nextPtr + 1 |
| 1704 | matchIndex = nextPtr[1] |
| 1705 | Else |
| 1707 | largerPtr = matchIndex |
| 1708 | commonLengthLarger = matchLength |
| 1709 | If matchIndex <= btLow Then |
| 1714 | matchIndex = nextPtr[0] |
| 1718 | smallerPtr = largerPtr = 0 |
| 1720 | nextToUpdate = If matchEndIdx > curr + 8 Then matchEndIdx - 8 Else curr + 1 |
| 1721 | Return bestLength |
| Name | Describe |
|---|---|
| ZSTD_BtFindBestMatch | ZSTD_BtFindBestMatch() : Tree updater, providing best match |
| ZSTD_BtFindBestMatch_extDict | Tree updater, providing best match |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |