Lines Matching full:if
28 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 #if defined(__GNUC__)
60 #if defined (__clang__)
103 if (startingOffset > 1 GB) { in LZ4HC_init_internal()
129 if (delta>LZ4_DISTANCE_MAX) delta = LZ4_DISTANCE_MAX; in LZ4HC_Insert()
155 #if defined(_MSC_VER)
165 if (bitsToRotate == 0) return pattern; in LZ4HC_rotatePattern()
180 if (!diff) { ip+=sizeof(pattern); continue; } in LZ4HC_countPattern()
185 if (LZ4_isLittleEndian()) { in LZ4HC_countPattern()
194 if (*ip != byte) break; in LZ4HC_countPattern()
211 if (LZ4_read32(ip-4) != pattern) break; in LZ4HC_reverseCountPattern()
216 if (ip[-1] != *bytePtr) break; in LZ4HC_reverseCountPattern()
223 * Checks if the match is in the last 3 bytes of the dictionary, so reading the
225 * @returns true if the match index is okay.
278 if (favorDecSpeed && (ipIndex - matchIndex < 8)) { in LZ4HC_InsertAndGetWiderMatch()
280 } else if (matchIndex >= dictLimit) { /* within current Prefix */ in LZ4HC_InsertAndGetWiderMatch()
285 … if (LZ4_read16(iLowLimit + longest - 1) == LZ4_read16(matchPtr - lookBackLength + longest - 1)) { in LZ4HC_InsertAndGetWiderMatch()
286 if (LZ4_read32(matchPtr) == pattern) { in LZ4HC_InsertAndGetWiderMatch()
290 if (matchLength > longest) { in LZ4HC_InsertAndGetWiderMatch()
297 if (LZ4_read32(matchPtr) == pattern) { in LZ4HC_InsertAndGetWiderMatch()
301 if (vLimit > iHighLimit) vLimit = iHighLimit; in LZ4HC_InsertAndGetWiderMatch()
303 if ((ip+matchLength == vLimit) && (vLimit < iHighLimit)) in LZ4HC_InsertAndGetWiderMatch()
307 if (matchLength > longest) { in LZ4HC_InsertAndGetWiderMatch()
313 if (chainSwap && matchLength==longest) { /* better match => select a better chain */ in LZ4HC_InsertAndGetWiderMatch()
315 if (matchIndex + (U32)longest <= ipIndex) { in LZ4HC_InsertAndGetWiderMatch()
325 if (candidateDist > distanceToNextMatch) { in LZ4HC_InsertAndGetWiderMatch()
331 if (distanceToNextMatch > 1) { in LZ4HC_InsertAndGetWiderMatch()
332 if (distanceToNextMatch > matchIndex) break; /* avoid overflow */ in LZ4HC_InsertAndGetWiderMatch()
338 if (patternAnalysis && distNextMatch==1 && matchChainPos==0) { in LZ4HC_InsertAndGetWiderMatch()
341 if (repeat == rep_untested) { in LZ4HC_InsertAndGetWiderMatch()
342 if ( ((pattern & 0xFFFF) == (pattern >> 16)) in LZ4HC_InsertAndGetWiderMatch()
349 if ( (repeat == rep_confirmed) && (matchCandidateIdx >= lowestMatchIndex) in LZ4HC_InsertAndGetWiderMatch()
353 if (LZ4_read32(matchPtr) == pattern) { /* good candidate */ in LZ4HC_InsertAndGetWiderMatch()
357 if (extDict && matchPtr + forwardPatternLength == iLimit) { in LZ4HC_InsertAndGetWiderMatch()
364 … if (!extDict && matchPtr - backLength == lowPrefixPtr && hc4->lowLimit < dictLimit) { in LZ4HC_InsertAndGetWiderMatch()
372 … /* Adjust to end of pattern if the source pattern fits, otherwise the beginning of the pattern */ in LZ4HC_InsertAndGetWiderMatch()
373 …if ( (currentSegmentLength >= srcPatternLength) /* current pattern segment large enough to conta… in LZ4HC_InsertAndGetWiderMatch()
376 if (LZ4HC_protectDictEnd(dictLimit, newMatchIndex)) in LZ4HC_InsertAndGetWiderMatch()
379 /* Can only happen if started in the prefix */ in LZ4HC_InsertAndGetWiderMatch()
385 if (!LZ4HC_protectDictEnd(dictLimit, newMatchIndex)) { in LZ4HC_InsertAndGetWiderMatch()
390 if (lookBackLength==0) { /* no back possible */ in LZ4HC_InsertAndGetWiderMatch()
392 if ((size_t)longest < maxML) { in LZ4HC_InsertAndGetWiderMatch()
394 … if ((size_t)(ip - base) - matchIndex > LZ4_DISTANCE_MAX) break; in LZ4HC_InsertAndGetWiderMatch()
401 … if (distToNextPattern > matchIndex) break; /* avoid overflow */ in LZ4HC_InsertAndGetWiderMatch()
413 if ( dict == usingDictCtxHc in LZ4HC_InsertAndGetWiderMatch()
423 if (LZ4_read32(matchPtr) == pattern) { in LZ4HC_InsertAndGetWiderMatch()
427 if (vLimit > iHighLimit) vLimit = iHighLimit; in LZ4HC_InsertAndGetWiderMatch()
431 if (mlt > longest) { in LZ4HC_InsertAndGetWiderMatch()
461 * @return : 0 if ok,
462 * 1 if buffer issue detected */
479 #if defined(LZ4_DEBUG) && (LZ4_DEBUG >= 6) in LZ4HC_encodeSequence()
487 if (start==NULL) start = anchor; /* only works for single segment */ in LZ4HC_encodeSequence()
500 if (limit && ((op + (length / 255) + length + (2 + 1 + LASTLITERALS)) > oend)) { in LZ4HC_encodeSequence()
505 if (length >= RUN_MASK) { in LZ4HC_encodeSequence()
525 if (limit && (op + (length / 255) + (1 + LASTLITERALS) > oend)) { in LZ4HC_encodeSequence()
529 if (length >= ML_MASK) { in LZ4HC_encodeSequence()
533 if (length >= 255) { length -= 255; *op++ = 255; } in LZ4HC_encodeSequence()
584 …if (limit == fillOutput) oend -= LASTLITERALS; /* Hack for support LZ4 format res… in LZ4HC_compress_hashChain()
585 …if (inputSize < LZ4_minLength) goto _last_literals; /* Input too small, no compression… in LZ4HC_compress_hashChain()
590 if (ml<MINMATCH) { ip++; continue; } in LZ4HC_compress_hashChain()
596 if (ip+ml <= mflimit) { in LZ4HC_compress_hashChain()
604 if (ml2 == ml) { /* No better match => encode ML1 */ in LZ4HC_compress_hashChain()
606 … if (LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor), ml, ref, limit, oend)) goto _dest_overflow; in LZ4HC_compress_hashChain()
610 if (start0 < ip) { /* first match was skipped at least once */ in LZ4HC_compress_hashChain()
611 if (start2 < ip + ml0) { /* squeezing ML1 between ML0(original ML1) and ML2 */ in LZ4HC_compress_hashChain()
616 if ((start2 - ip) < 3) { /* First Match too small : removed */ in LZ4HC_compress_hashChain()
627 if ((start2 - ip) < OPTIMAL_ML) { in LZ4HC_compress_hashChain()
630 if (new_ml > OPTIMAL_ML) new_ml = OPTIMAL_ML; in LZ4HC_compress_hashChain()
631 if (ip+new_ml > start2 + ml2 - MINMATCH) new_ml = (int)(start2 - ip) + ml2 - MINMATCH; in LZ4HC_compress_hashChain()
633 if (correction > 0) { in LZ4HC_compress_hashChain()
641 if (start2 + ml2 <= mflimit) { in LZ4HC_compress_hashChain()
649 if (ml3 == ml2) { /* No better match => encode ML1 and ML2 */ in LZ4HC_compress_hashChain()
651 if (start2 < ip+ml) ml = (int)(start2 - ip); in LZ4HC_compress_hashChain()
654 … if (LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor), ml, ref, limit, oend)) goto _dest_overflow; in LZ4HC_compress_hashChain()
657 if (LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor), ml2, ref2, limit, oend)) { in LZ4HC_compress_hashChain()
665 if (start3 < ip+ml+3) { /* Not enough space for match 2 : remove it */ in LZ4HC_compress_hashChain()
666 …if (start3 >= (ip+ml)) { /* can write Seq1 immediately ==> Seq2 is removed, so Seq3 becomes Seq1 … in LZ4HC_compress_hashChain()
667 if (start2 < ip+ml) { in LZ4HC_compress_hashChain()
672 if (ml2 < MINMATCH) { in LZ4HC_compress_hashChain()
680 … if (LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor), ml, ref, limit, oend)) goto _dest_overflow; in LZ4HC_compress_hashChain()
702 if (start2 < ip+ml) { in LZ4HC_compress_hashChain()
703 if ((start2 - ip) < OPTIMAL_ML) { in LZ4HC_compress_hashChain()
705 if (ml > OPTIMAL_ML) ml = OPTIMAL_ML; in LZ4HC_compress_hashChain()
706 if (ip + ml > start2 + ml2 - MINMATCH) ml = (int)(start2 - ip) + ml2 - MINMATCH; in LZ4HC_compress_hashChain()
708 if (correction > 0) { in LZ4HC_compress_hashChain()
718 … if (LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor), ml, ref, limit, oend)) goto _dest_overflow; in LZ4HC_compress_hashChain()
735 if (limit == fillOutput) oend += LASTLITERALS; /* restore correct value */ in LZ4HC_compress_hashChain()
736 if (limit && (op + totalSize > oend)) { in LZ4HC_compress_hashChain()
737 if (limit == limitedOutput) return 0; in LZ4HC_compress_hashChain()
744 ip = anchor + lastRunSize; /* can be != iend if limit==fillOutput */ in LZ4HC_compress_hashChain()
746 if (lastRunSize >= RUN_MASK) { in LZ4HC_compress_hashChain()
763 if (limit == fillOutput) { in LZ4HC_compress_hashChain()
771 if (op + ll_totalCost <= maxLitPos) { in LZ4HC_compress_hashChain()
776 if ((size_t)ml > maxMlSize) ml = (int)maxMlSize; in LZ4HC_compress_hashChain()
777 if ((oend + LASTLITERALS) - (op + ll_totalCost + 2) - 1 + ml >= MFLIMIT) { in LZ4HC_compress_hashChain()
832 if (limit == fillOutput && dstCapacity < 1) return 0; /* Impossible to store anything */ in LZ4HC_compress_generic_internal()
833 …if ((U32)*srcSizePtr > (U32)LZ4_MAX_INPUT_SIZE) return 0; /* Unsupported input size (too large … in LZ4HC_compress_generic_internal()
836 …if (cLevel < 1) cLevel = LZ4HC_CLEVEL_DEFAULT; /* note : convention is different from lz4frame, … in LZ4HC_compress_generic_internal()
842 if (cParam.strat == lz4hc) { in LZ4HC_compress_generic_internal()
854 if (result <= 0) ctx->dirty = 1; in LZ4HC_compress_generic_internal()
889 if (position >= 64 KB) { in LZ4HC_compress_generic_dictCtx()
892 } else if (position == 0 && *srcSizePtr > 4 KB) { in LZ4HC_compress_generic_dictCtx()
913 if (ctx->dictCtx == NULL) { in LZ4HC_compress_generic()
925 #if LZ4_ALIGN_TEST in LZ4_streamHC_t_alignment()
938 if (!LZ4_isAligned(state, LZ4_streamHC_t_alignment())) return 0; in LZ4_compress_HC_extStateHC_fastReset()
941 if (dstCapacity < LZ4_compressBound(srcSize)) in LZ4_compress_HC_extStateHC_fastReset()
950 if (ctx==NULL) return 0; /* init failure */ in LZ4_compress_HC_extStateHC()
956 #if defined(LZ4HC_HEAPMODE) && LZ4HC_HEAPMODE==1 in LZ4_compress_HC()
963 #if defined(LZ4HC_HEAPMODE) && LZ4HC_HEAPMODE==1 in LZ4_compress_HC()
973 if (ctx==NULL) return 0; /* init failure */ in LZ4_compress_HC_destSize()
989 if (state == NULL) return NULL; in LZ4_createStreamHC()
997 if (!LZ4_streamHCPtr) return 0; /* support free on NULL */ in LZ4_freeStreamHC()
1006 /* if compilation fails here, LZ4_STREAMHCSIZE must be increased */ in LZ4_initStreamHC()
1010 if (buffer == NULL) return NULL; in LZ4_initStreamHC()
1011 if (size < sizeof(LZ4_streamHC_t)) return NULL; in LZ4_initStreamHC()
1012 if (!LZ4_isAligned(buffer, LZ4_streamHC_t_alignment())) return NULL; in LZ4_initStreamHC()
1030 if (LZ4_streamHCPtr->internal_donotuse.dirty) { in LZ4_resetStreamHC_fast()
1034 if (LZ4_streamHCPtr->internal_donotuse.end != NULL) { in LZ4_resetStreamHC_fast()
1048 if (compressionLevel < 1) compressionLevel = LZ4HC_CLEVEL_DEFAULT; in LZ4_setCompressionLevel()
1049 if (compressionLevel > LZ4HC_CLEVEL_MAX) compressionLevel = LZ4HC_CLEVEL_MAX; in LZ4_setCompressionLevel()
1066 if (dictSize > 64 KB) { in LZ4_loadDictHC()
1077 if (dictSize >= 4) LZ4HC_Insert (ctxPtr, ctxPtr->end-3); in LZ4_loadDictHC()
1090 if (ctxPtr->end >= ctxPtr->base + ctxPtr->dictLimit + 4) in LZ4HC_setExternalDict()
1115 /* auto-init if forgotten */ in LZ4_compressHC_continue_generic()
1116 if (ctxPtr->base == NULL) LZ4HC_init_internal (ctxPtr, (const BYTE*) src); in LZ4_compressHC_continue_generic()
1119 if ((size_t)(ctxPtr->end - ctxPtr->base) > 2 GB) { in LZ4_compressHC_continue_generic()
1121 if (dictSize > 64 KB) dictSize = 64 KB; in LZ4_compressHC_continue_generic()
1125 /* Check if blocks follow each other */ in LZ4_compressHC_continue_generic()
1126 if ((const BYTE*)src != ctxPtr->end) in LZ4_compressHC_continue_generic()
1133 if ((sourceEnd > dictBegin) && ((const BYTE*)src < dictEnd)) { in LZ4_compressHC_continue_generic()
1134 if (sourceEnd > dictEnd) sourceEnd = dictEnd; in LZ4_compressHC_continue_generic()
1136 if (ctxPtr->dictLimit - ctxPtr->lowLimit < 4) ctxPtr->lowLimit = ctxPtr->dictLimit; in LZ4_compressHC_continue_generic()
1144 if (dstCapacity < LZ4_compressBound(srcSize)) in LZ4_compress_HC_continue()
1168 if (dictSize > 64 KB) dictSize = 64 KB; in LZ4_saveDictHC()
1169 if (dictSize < 4) dictSize = 0; in LZ4_saveDictHC()
1170 if (dictSize > prefixSize) dictSize = prefixSize; in LZ4_saveDictHC()
1171 if (safeBuffer == NULL) assert(dictSize == 0); in LZ4_saveDictHC()
1172 if (dictSize > 0) in LZ4_saveDictHC()
1179 if (streamPtr->nextToUpdate < streamPtr->dictLimit) in LZ4_saveDictHC()
1209 * @return : 0 on success, !=0 if error */
1213 if (hc4 == NULL) return 1; /* init failed */ in LZ4_resetStreamStateHC()
1221 if (hc4 == NULL) return NULL; /* not enough memory */ in LZ4_createHC()
1228 if (!LZ4HC_Data) return 0; /* support free on NULL */ in LZ4_freeHC()
1268 if (litlen >= (int)RUN_MASK) in LZ4HC_literalsPrice()
1283 if (mlen >= (int)(ML_MASK+MINMATCH)) in LZ4HC_sequencePrice()
1308 if (matchLength <= minLen) return match; in LZ4HC_FindLongerMatch()
1309 if (favorDecSpeed) { in LZ4HC_FindLongerMatch()
1310 if ((matchLength>18) & (matchLength<=36)) matchLength=18; /* favor shortcut */ in LZ4HC_FindLongerMatch()
1351 if (opt == NULL) goto _return_label; in LZ4HC_compress_optimal()
1355 if (limit == fillOutput) oend -= LASTLITERALS; /* Hack for support LZ4 format restriction */ in LZ4HC_compress_optimal()
1356 if (sufficient_len >= LZ4_OPT_NUM) sufficient_len = LZ4_OPT_NUM-1; in LZ4HC_compress_optimal()
1365 if (firstMatch.len==0) { ip++; continue; } in LZ4HC_compress_optimal()
1367 if ((size_t)firstMatch.len > sufficient_len) { in LZ4HC_compress_optimal()
1372 …if ( LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor), firstML, matchPos, limit, oend) ) { /* updat… in LZ4HC_compress_optimal()
1421 if (curPtr > mflimit) break; in LZ4HC_compress_optimal()
1424 if (fullUpdate) { in LZ4HC_compress_optimal()
1425 /* not useful to search here if next position has same (or lower) cost */ in LZ4HC_compress_optimal()
1426 if ( (opt[cur+1].price <= opt[cur].price) in LZ4HC_compress_optimal()
1431 /* not useful to search here if next position has same (or lower) cost */ in LZ4HC_compress_optimal()
1432 if (opt[cur+1].price <= opt[cur].price) continue; in LZ4HC_compress_optimal()
1436 if (fullUpdate) in LZ4HC_compress_optimal()
1441 if (!newMatch.len) continue; in LZ4HC_compress_optimal()
1443 if ( ((size_t)newMatch.len > sufficient_len) in LZ4HC_compress_optimal()
1458 if (price < opt[pos].price) { in LZ4HC_compress_optimal()
1479 if (opt[cur].mlen == 1) { in LZ4HC_compress_optimal()
1489 if (pos > last_match_pos+TRAILING_LITERALS in LZ4HC_compress_optimal()
1494 if ( (ml == matchML) /* last pos of last match */ in LZ4HC_compress_optimal()
1533 … if (next_matchLength > candidate_pos) break; /* last match elected, first match to encode */ in LZ4HC_compress_optimal()
1543 …if (ml == 1) { ip++; rPos++; continue; } /* literal; note: can end up with several literals, in w… in LZ4HC_compress_optimal()
1548 …if ( LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor), ml, ip - offset, limit, oend) ) { /* updates… in LZ4HC_compress_optimal()
1560 if (limit == fillOutput) oend += LASTLITERALS; /* restore correct value */ in LZ4HC_compress_optimal()
1561 if (limit && (op + totalSize > oend)) { in LZ4HC_compress_optimal()
1562 if (limit == limitedOutput) { /* Check output limit */ in LZ4HC_compress_optimal()
1572 ip = anchor + lastRunSize; /* can be != iend if limit==fillOutput */ in LZ4HC_compress_optimal()
1574 if (lastRunSize >= RUN_MASK) { in LZ4HC_compress_optimal()
1592 if (limit == fillOutput) { in LZ4HC_compress_optimal()
1600 if (op + ll_totalCost <= maxLitPos) { in LZ4HC_compress_optimal()
1605 if ((size_t)ovml > maxMlSize) ovml = (int)maxMlSize; in LZ4HC_compress_optimal()
1606 if ((oend + LASTLITERALS) - (op + ll_totalCost + 2) - 1 + ovml >= MFLIMIT) { in LZ4HC_compress_optimal()