Lines Matching full:window

203     ZSTD_window_t window;   /* State for window round buffer management */  member
222 …U32 forceNonContiguous; /* Non-zero if we should force non-contiguous load for the next window upd…
254 ZSTD_window_t window; /* State for the window round buffer management */ member
268 U32 windowLog; /* Window log for the LDM */
863 * over a window of length bytes.
896 * Clears the window containing the history by simply setting it to empty.
898 MEM_STATIC void ZSTD_window_clear(ZSTD_window_t* window) in ZSTD_window_clear() argument
900 size_t const endT = (size_t)(window->nextSrc - window->base); in ZSTD_window_clear()
903 window->lowLimit = end; in ZSTD_window_clear()
904 window->dictLimit = end; in ZSTD_window_clear()
907 MEM_STATIC U32 ZSTD_window_isEmpty(ZSTD_window_t const window) in ZSTD_window_isEmpty() argument
909 return window.dictLimit == ZSTD_WINDOW_START_INDEX && in ZSTD_window_isEmpty()
910 window.lowLimit == ZSTD_WINDOW_START_INDEX && in ZSTD_window_isEmpty()
911 (window.nextSrc - window.base) == ZSTD_WINDOW_START_INDEX; in ZSTD_window_isEmpty()
916 * Returns non-zero if the window has a non-empty extDict.
918 MEM_STATIC U32 ZSTD_window_hasExtDict(ZSTD_window_t const window) in ZSTD_window_hasExtDict() argument
920 return window.lowLimit < window.dictLimit; in ZSTD_window_hasExtDict()
930 return ZSTD_window_hasExtDict(ms->window) ? in ZSTD_matchState_dictMode()
954 MEM_STATIC U32 ZSTD_window_canOverflowCorrect(ZSTD_window_t const window, in ZSTD_window_canOverflowCorrect() argument
961 U32 const curr = (U32)((BYTE const*)src - window.base); in ZSTD_window_canOverflowCorrect()
971 U32 const adjustment = window.nbOverflowCorrections + 1; in ZSTD_window_canOverflowCorrect()
989 MEM_STATIC U32 ZSTD_window_needOverflowCorrection(ZSTD_window_t const window, in ZSTD_window_needOverflowCorrection() argument
996 U32 const curr = (U32)((BYTE const*)srcEnd - window.base); in ZSTD_window_needOverflowCorrection()
998 if (ZSTD_window_canOverflowCorrect(window, cycleLog, maxDist, loadedDictEnd, src)) { in ZSTD_window_needOverflowCorrection()
1014 MEM_STATIC U32 ZSTD_window_correctOverflow(ZSTD_window_t* window, U32 cycleLog, in ZSTD_window_correctOverflow() argument
1038 U32 const curr = (U32)((BYTE const*)src - window->base); in ZSTD_window_correctOverflow()
1060 window->base += correction; in ZSTD_window_correctOverflow()
1061 window->dictBase += correction; in ZSTD_window_correctOverflow()
1062 if (window->lowLimit < correction + ZSTD_WINDOW_START_INDEX) { in ZSTD_window_correctOverflow()
1063 window->lowLimit = ZSTD_WINDOW_START_INDEX; in ZSTD_window_correctOverflow()
1065 window->lowLimit -= correction; in ZSTD_window_correctOverflow()
1067 if (window->dictLimit < correction + ZSTD_WINDOW_START_INDEX) { in ZSTD_window_correctOverflow()
1068 window->dictLimit = ZSTD_WINDOW_START_INDEX; in ZSTD_window_correctOverflow()
1070 window->dictLimit -= correction; in ZSTD_window_correctOverflow()
1073 /* Ensure we can still reference the full window. */ in ZSTD_window_correctOverflow()
1077 assert(window->lowLimit <= newCurrent); in ZSTD_window_correctOverflow()
1078 assert(window->dictLimit <= newCurrent); in ZSTD_window_correctOverflow()
1080 ++window->nbOverflowCorrections; in ZSTD_window_correctOverflow()
1083 window->lowLimit); in ZSTD_window_correctOverflow()
1102 * as long as the last byte of the dictionary is in the window.
1103 * Once input has progressed beyond window size, dictionary cannot be referenced anymore.
1111 ZSTD_window_enforceMaxDist(ZSTD_window_t* window, in ZSTD_window_enforceMaxDist() argument
1117 U32 const blockEndIdx = (U32)((BYTE const*)blockEnd - window->base); in ZSTD_window_enforceMaxDist()
1137 if (window->lowLimit < newLowLimit) window->lowLimit = newLowLimit; in ZSTD_window_enforceMaxDist()
1138 if (window->dictLimit < window->lowLimit) { in ZSTD_window_enforceMaxDist()
1140 (unsigned)window->dictLimit, (unsigned)window->lowLimit); in ZSTD_window_enforceMaxDist()
1141 window->dictLimit = window->lowLimit; in ZSTD_window_enforceMaxDist()
1143 /* On reaching window size, dictionaries are invalidated */ in ZSTD_window_enforceMaxDist()
1151 * when input progresses beyond window size.
1153 * loadedDictEnd uses same referential as window->base
1154 * maxDist is the window size */
1156 ZSTD_checkDictValidity(const ZSTD_window_t* window, in ZSTD_checkDictValidity() argument
1164 { U32 const blockEndIdx = (U32)((BYTE const*)blockEnd - window->base); in ZSTD_checkDictValidity()
1171 /* On reaching window size, dictionaries are invalidated. in ZSTD_checkDictValidity()
1172 * For simplification, if window size is reached anywhere within next block, in ZSTD_checkDictValidity()
1184 MEM_STATIC void ZSTD_window_init(ZSTD_window_t* window) { in ZSTD_window_init() argument
1185 ZSTD_memset(window, 0, sizeof(*window)); in ZSTD_window_init()
1186 window->base = (BYTE const*)" "; in ZSTD_window_init()
1187 window->dictBase = (BYTE const*)" "; in ZSTD_window_init()
1189window->dictLimit = ZSTD_WINDOW_START_INDEX; /* start from >0, so that 1st position is valid */ in ZSTD_window_init()
1190window->lowLimit = ZSTD_WINDOW_START_INDEX; /* it ensures first and later CCtx usages compress… in ZSTD_window_init()
1191 window->nextSrc = window->base + ZSTD_WINDOW_START_INDEX; /* see issue #1241 */ in ZSTD_window_init()
1192 window->nbOverflowCorrections = 0; in ZSTD_window_init()
1197 * Updates the window by appending [src, src + srcSize) to the window.
1202 MEM_STATIC U32 ZSTD_window_update(ZSTD_window_t* window, in ZSTD_window_update() argument
1211 assert(window->base != NULL); in ZSTD_window_update()
1212 assert(window->dictBase != NULL); in ZSTD_window_update()
1214 if (src != window->nextSrc || forceNonContiguous) { in ZSTD_window_update()
1216 size_t const distanceFromBase = (size_t)(window->nextSrc - window->base); in ZSTD_window_update()
1217 DEBUGLOG(5, "Non contiguous blocks, new segment starts at %u", window->dictLimit); in ZSTD_window_update()
1218 window->lowLimit = window->dictLimit; in ZSTD_window_update()
1220 window->dictLimit = (U32)distanceFromBase; in ZSTD_window_update()
1221 window->dictBase = window->base; in ZSTD_window_update()
1222 window->base = ip - distanceFromBase; in ZSTD_window_update()
1223 /* ms->nextToUpdate = window->dictLimit; */ in ZSTD_window_update()
1224 …if (window->dictLimit - window->lowLimit < HASH_READ_SIZE) window->lowLimit = window->dictLimit; … in ZSTD_window_update()
1227 window->nextSrc = ip + srcSize; in ZSTD_window_update()
1229 if ( (ip+srcSize > window->dictBase + window->lowLimit) in ZSTD_window_update()
1230 & (ip < window->dictBase + window->dictLimit)) { in ZSTD_window_update()
1231 ptrdiff_t const highInputIdx = (ip + srcSize) - window->dictBase; in ZSTD_window_update()
1232 …U32 const lowLimitMax = (highInputIdx > (ptrdiff_t)window->dictLimit) ? window->dictLimit : (U32)h… in ZSTD_window_update()
1233 window->lowLimit = lowLimitMax; in ZSTD_window_update()
1234 DEBUGLOG(5, "Overlapping extDict and input : new lowLimit = %u", window->lowLimit); in ZSTD_window_update()
1245 U32 const lowestValid = ms->window.lowLimit; in ZSTD_getLowestMatchIndex()
1249 * is within the window. We invalidate the dictionary (and set loadedDictEnd to 0) when it isn't in ZSTD_getLowestMatchIndex()
1262 U32 const lowestValid = ms->window.dictLimit; in ZSTD_getLowestPrefixIndex()