Function report |
Source Code:lib\zstd\zstd_opt.h |
Create Date:2022-07-28 07:04:33 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:-************************************** Binary Tree search
Proto:static U32 ZSTD_insertBtAndGetAllMatches(ZSTD_CCtx *zc, const BYTE *const ip, const BYTE *const iLimit, U32 nbCompares, const U32 mls, U32 extDict, ZSTD_match_t *matches, const U32 minMatchLen)
Type:U32
Parameter:
| Type | Parameter | Name |
|---|---|---|
| ZSTD_CCtx * | zc | |
| const BYTE *const | ip | |
| const BYTE *const | iLimit | |
| U32 | nbCompares | |
| const U32 | mls | |
| U32 | extDict | |
| ZSTD_match_t * | matches | |
| const U32 | minMatchLen |
| 241 | h = ZSTD_hashPtr(ip, hashLog, mls) |
| 243 | matchIndex = hashTable[h] |
| 244 | bt = chainTable |
| 247 | commonLengthSmaller = 0 , commonLengthLarger = 0 |
| 251 | prefixStart = base + dictLimit |
| 254 | smallerPtr = bt + 2 * (curr & btMask) |
| 256 | matchEndIdx = curr + 8 |
| 258 | mnum = 0 |
| 261 | bestLength = minMatchLen - 1 |
| 263 | If minMatch == 3 Then |
| 265 | If matchIndex3 > windowLow && curr - matchIndex3 < 1 << 18 Then |
| 267 | currMl = 0 |
| 268 | If Not extDict || matchIndex3 >= dictLimit Then |
| 269 | match = base + matchIndex3 |
| 270 | If match[bestLength] == ip[bestLength] Then currMl = ZSTD_count(ip, match, iLimit) |
| 272 | Else |
| 273 | match = dictBase + matchIndex3 |
| 280 | If currMl > bestLength Then |
| 281 | bestLength = currMl |
| 282 | off = ZSTD_REP_MOVE_OPT + curr - matchIndex3 |
| 284 | mnum++ |
| 285 | If currMl > -************************************** Common constants Then Go to update |
| 295 | When nbCompares-- && matchIndex > windowLow cycle |
| 296 | nextPtr = bt + 2 * (matchIndex & btMask) |
| 297 | matchLength = -************************************** shared macros(commonLengthSmaller, commonLengthLarger) |
| 300 | If Not extDict || matchIndex + matchLength >= dictLimit Then |
| 301 | match = base + matchIndex |
| 302 | If match[matchLength] == ip[matchLength] Then |
| 303 | matchLength += ZSTD_count(ip + matchLength + 1, match + matchLength + 1, iLimit) + 1 |
| 305 | Else |
| 306 | match = dictBase + matchIndex |
| 307 | 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 |
| 308 | If matchIndex + matchLength >= dictLimit Then match = base + matchIndex |
| 312 | If matchLength > bestLength Then |
| 313 | If matchLength > matchEndIdx - matchIndex Then matchEndIdx = matchIndex + matchLength |
| 315 | bestLength = matchLength |
| 316 | off = ZSTD_REP_MOVE_OPT + curr - matchIndex |
| 317 | len = matchLength |
| 318 | mnum++ |
| 319 | If matchLength > -************************************** Common constants Then Break |
| 321 | If ip + matchLength == iLimit Then Break |
| 325 | If match[matchLength] < ip[matchLength] Then |
| 327 | smallerPtr = matchIndex |
| 329 | If matchIndex <= btLow Then |
| 330 | smallerPtr = dummy32 |
| 331 | Break |
| 333 | smallerPtr = nextPtr + 1 |
| 334 | matchIndex = nextPtr[1] |
| 335 | Else |
| 348 | smallerPtr = largerPtr = 0 |
| 350 | update : |
| 351 | nextToUpdate = If matchEndIdx > curr + 8 Then matchEndIdx - 8 Else curr + 1 |
| 352 | Return mnum |
| 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 |