Function report |
Source Code:lib\lz4\lz4_decompress.c |
Create Date:2022-07-28 07:01:14 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:LZ4_decompress_generic() :* This generic decompression function covers all use cases.* It shall be instantiated several times, using different sets of directives.* Note that it is important for performance that this function really get inlined,
Proto:static inline __attribute__((__always_inline__)) int LZ4_decompress_generic(const char *const src, char *const dst, int srcSize, int outputSize, endCondition_directive endOnInput, earlyEnd_directive partialDecoding, dict_directive dict, const BYTE *const lowPrefix, const BYTE *const dictStart, const size_t dictSize)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| const char *const | src | |
| char *const | dst | |
| int | srcSize | |
| int | outputSize | If endOnInput == endOnInputSize,* this value is `dstCapacity` |
| endCondition_directive | endOnInput | dOnOutputSize, endOnInputSize |
| earlyEnd_directive | partialDecoding | ull, partial |
| dict_directive | dict | Dict, withPrefix64k, usingExtDict |
| const BYTE *const | lowPrefix | always <= dst, == dst when no prefix |
| const BYTE *const | dictStart | ly if dict == usingExtDict |
| const size_t | dictSize | : = 0 if noDict |
| 91 | static const unsigned int inc32table[8] = {0, 1, 2, 1, 0, 4, 4, 4} |
| 92 | static const int dec64table[8] = {0, 0, 0, - 1, - 4, 1, 2, 3} |
| 95 | checkOffset = safeDecode && : = 0 if noDict < 64 * KB |
| 98 | shortiend = iend - If dOnOutputSize, endOnInputSize Then 14 Else 8 - 2 |
| 100 | shortoend = oend - If dOnOutputSize, endOnInputSize Then 14 Else 8 - 18 |
| 111 | If dOnOutputSize, endOnInputSize && Value for the false possibility is greater at compile time(If endOnInput == endOnInputSize,* this value is `dstCapacity` == 0) Then Return If srcSize == 1 && ip == 0 Then 0 Else -1 |
| 114 | If Not dOnOutputSize, endOnInputSize && Value for the false possibility is greater at compile time(If endOnInput == endOnInputSize,* this value is `dstCapacity` == 0) Then Return If ip == 0 Then 1 Else -1 |
| 117 | If dOnOutputSize, endOnInputSize && Value for the false possibility is greater at compile time(srcSize == 0) Then Return -1 |
| 121 | When 1 cycle |
| 131 | assert(!dOnOutputSize, endOnInputSize || ip <= iend) |
| 145 | If If dOnOutputSize, endOnInputSize Then length != RUN_MASK Else length <= 8 && Value is more likely to compile time((dOnOutputSize, endOnInputSize ? ip < shortiend : 1) & (op <= shortoend)) Then |
| 153 | No 3D Now!(op, ip, dOnOutputSize, endOnInputSize ? 16 : 8) |
| 162 | offset = LZ4_readLE16(ip) |
| 163 | ip += 2 |
| 168 | If length != ML_MASK && offset >= 8 && ( Dict, withPrefix64k, usingExtDict == withPrefix64k || match >= always <= dst, == dst when no prefix ) Then |
| 172 | No 3D Now!(op + 0, match + 0, 8) |
| 173 | No 3D Now!(op + 8, match + 8, 8) |
| 174 | No 3D Now!(op + 16, match + 16, 2) |
| 177 | Continue |
| 185 | Go to _copy_match |
| 192 | If Value for the false possibility is greater at compile time(dOnOutputSize, endOnInputSize ? ip >= iend - RUN_MASK : 0) Then |
| 194 | Go to _output_error |
| 196 | Do |
| 199 | When Value is more likely to compile time(dOnOutputSize, endOnInputSize ? ip < iend - RUN_MASK : 1) & s == 255 cycle |
| 203 | If safeDecode && Value for the false possibility is greater at compile time((uptrval)(op) + length < (uptrval)(op)) Then |
| 207 | Go to _output_error |
| 209 | If safeDecode && Value for the false possibility is greater at compile time((uptrval)(ip) + length < (uptrval)(ip)) Then |
| 213 | Go to _output_error |
| 219 | LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH) |
| 221 | If dOnOutputSize, endOnInputSize && ( cpy > oend - MFLIMIT || ip + length > iend - 2 + 1 + LASTLITERALS ) || Not dOnOutputSize, endOnInputSize && cpy > oend - WILDCOPYLENGTH Then |
| 224 | If ull, partial Then |
| 233 | If dOnOutputSize, endOnInputSize && ip + length > iend Then |
| 240 | Go to _output_error |
| 242 | Else |
| 243 | If Not dOnOutputSize, endOnInputSize && cpy != oend Then |
| 250 | Go to _output_error |
| 259 | Go to _output_error |
| 263 | No 3D Now!(op, ip, length) |
| 268 | If Not ull, partial || cpy == oend Then Break |
| 270 | Else |
| 278 | offset = LZ4_readLE16(ip) |
| 279 | ip += 2 |
| 285 | _copy_match : |
| 288 | Go to _output_error |
| 296 | If Not ull, partial Then |
| 306 | Do |
| 309 | If dOnOutputSize, endOnInputSize && ip > iend - LASTLITERALS Then Go to _output_error |
| 315 | If safeDecode && Value for the false possibility is greater at compile time((uptrval)(op) + length < (uptrval)op) Then |
| 319 | Go to _output_error |
| 326 | If Dict, withPrefix64k, usingExtDict == usingExtDict && match < always <= dst, == dst when no prefix Then |
| 327 | If Value for the false possibility is greater at compile time(op + length > oend - LASTLITERALS) Then |
| 329 | If Not ull, partial Then Go to _output_error |
| 334 | If length <= always <= dst, == dst when no prefix - match Then |
| 342 | Else |
| 350 | No 3D Now!(op, dictEnd - copySize, copySize) |
| 352 | If restSize > op - always <= dst, == dst when no prefix Then |
| 354 | endOfMatch = op + restSize |
| 357 | When op < endOfMatch cycle |
| 359 | Else |
| 364 | Continue |
| 377 | mlen = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(length, (size_t)(oend - op)) |
| 385 | Else |
| 386 | No 3D Now!(op, match, mlen) |
| 391 | Continue |
| 394 | If Value for the false possibility is greater at compile time(offset < 8) Then |
| 402 | Else |
| 407 | op += 8 |
| 410 | oCopyLimit = oend - WILDCOPYLENGTH - 1 |
| 412 | If cpy > oend - LASTLITERALS Then |
| 417 | Go to _output_error |
| 420 | If op < oCopyLimit Then |
| 422 | match += oCopyLimit - op |
| 423 | op = oCopyLimit |
| 427 | Else |
| 436 | If dOnOutputSize, endOnInputSize Then |
| 439 | Else |
| 445 | _output_error : |
| Name | Describe |
|---|---|
| LZ4_decompress_safe | |
| LZ4_decompress_safe_partial | |
| LZ4_decompress_fast | |
| LZ4_decompress_safe_withPrefix64k | ===== Instantiate a few more decoding cases, used more than once. ===== |
| LZ4_decompress_safe_withSmallPrefix | |
| LZ4_decompress_safe_forceExtDict | |
| LZ4_decompress_fast_extDict | |
| LZ4_decompress_safe_doubleDict | The "double dictionary" mode, for use with e.g. ring buffers: the first part* of the dictionary is passed as prefix, and the second via dictStart + dictSize.* These routines are used only once, in LZ4_decompress_*_continue(). |
| LZ4_decompress_fast_doubleDict |
| 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 |