Lines Matching +full:- +full:- +full:match

1 // SPDX-License-Identifier: BSD-2-Clause
3 LZ4 - Fast LZ compression algorithm
4 Copyright (C) 2011-2015, Yann Collet.
7 - LZ4 source repository : https://github.com/Cyan4973/lz4
8 - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
41 #define MAX_DISTANCE ((1 << MAXD_LOG) - 1)
44 #define ML_MASK ((1U<<ML_BITS)-1)
45 #define RUN_BITS (8-ML_BITS)
46 #define RUN_MASK ((1U<<RUN_BITS)-1)
90 const BYTE* const lowLimit = lowPrefix - dictSize; in LZ4_decompress_generic()
94 const size_t dec64table[] = {0, 0, 0, (size_t)-1, 0, 1, 2, 3}; in LZ4_decompress_generic()
101 …if ((partialDecoding) && (oexit> oend-MFLIMIT)) oexit = oend-MFLIMIT; /* t… in LZ4_decompress_generic()
102 …if ((endOnInput) && (unlikely(outputSize==0))) return ((inputSize==1) && (*ip==0)) ? 0 : -1; /* E… in LZ4_decompress_generic()
103 if ((!endOnInput) && (unlikely(outputSize==0))) return (*ip==0?1:-1); in LZ4_decompress_generic()
111 const BYTE* match; in LZ4_decompress_generic() local
123 while (likely((endOnInput)?ip<iend-RUN_MASK:1) && (s==255)); in LZ4_decompress_generic()
130 …if (((endOnInput) && ((cpy>(partialDecoding?oexit:oend-MFLIMIT)) || (ip+length>iend-(2+1+LASTLITER… in LZ4_decompress_generic()
131 || ((!endOnInput) && (cpy>oend-COPYLENGTH))) in LZ4_decompress_generic()
152 match = cpy - LZ4_readLE16(ip); ip+=2; in LZ4_decompress_generic()
153 …if ((checkOffset) && (unlikely(match < lowLimit))) goto _output_error; /* Error : offset outside… in LZ4_decompress_generic()
162 if ((endOnInput) && (ip > iend-LASTLITERALS)) goto _output_error; in LZ4_decompress_generic()
171 if ((dict==usingExtDict) && (match < lowPrefix)) in LZ4_decompress_generic()
173 …if (unlikely(op+length > oend-LASTLITERALS)) goto _output_error; /* doesn't respect parsing rest… in LZ4_decompress_generic()
175 if (length <= (size_t)(lowPrefix-match)) in LZ4_decompress_generic()
177 /* match can be copied as a single segment from external dictionary */ in LZ4_decompress_generic()
178 match = dictEnd - (lowPrefix-match); in LZ4_decompress_generic()
179 memmove(op, match, length); op += length; in LZ4_decompress_generic()
183 /* match encompass external dictionary and current segment */ in LZ4_decompress_generic()
184 size_t copySize = (size_t)(lowPrefix-match); in LZ4_decompress_generic()
185 memcpy(op, dictEnd - copySize, copySize); in LZ4_decompress_generic()
187 copySize = length - copySize; in LZ4_decompress_generic()
188 if (copySize > (size_t)(op-lowPrefix)) /* overlap within current segment */ in LZ4_decompress_generic()
205 if (unlikely((op-match)<8)) in LZ4_decompress_generic()
207 const size_t dec64 = dec64table[op-match]; in LZ4_decompress_generic()
208 op[0] = match[0]; in LZ4_decompress_generic()
209 op[1] = match[1]; in LZ4_decompress_generic()
210 op[2] = match[2]; in LZ4_decompress_generic()
211 op[3] = match[3]; in LZ4_decompress_generic()
212 match += dec32table[op-match]; in LZ4_decompress_generic()
213 LZ4_copy4(op+4, match); in LZ4_decompress_generic()
214 op += 8; match -= dec64; in LZ4_decompress_generic()
215 } else { LZ4_copy8(op, match); op+=8; match+=8; } in LZ4_decompress_generic()
217 if (unlikely(cpy>oend-12)) in LZ4_decompress_generic()
219 …if (cpy > oend-LASTLITERALS) goto _output_error; /* Error : last LASTLITERALS bytes must be lit… in LZ4_decompress_generic()
220 if (op < oend-8) in LZ4_decompress_generic()
222 LZ4_wildCopy(op, match, oend-8); in LZ4_decompress_generic()
223 match += (oend-8) - op; in LZ4_decompress_generic()
224 op = oend-8; in LZ4_decompress_generic()
226 while (op<cpy) *op++ = *match++; in LZ4_decompress_generic()
229 LZ4_wildCopy(op, match, cpy); in LZ4_decompress_generic()
235 return (int) (((char*)op)-dest); /* Nb of output bytes decoded */ in LZ4_decompress_generic()
237 return (int) (((const char*)ip)-source); /* Nb of input bytes read */ in LZ4_decompress_generic()
241 return (int) (-(((const char*)ip)-source))-1; in LZ4_decompress_generic()