Lines Matching full:window

271     ZSTD_window_t window;   /* State for window round buffer management */  member
292 …int forceNonContiguous; /* Non-zero if we should force non-contiguous load for the next window upd…
336 ZSTD_window_t window; /* State for the window round buffer management */ member
350 U32 windowLog; /* Window log for the LDM */
997 * over a window of length bytes.
1031 * Clears the window containing the history by simply setting it to empty.
1033 MEM_STATIC void ZSTD_window_clear(ZSTD_window_t* window) in ZSTD_window_clear() argument
1035 size_t const endT = (size_t)(window->nextSrc - window->base); in ZSTD_window_clear()
1038 window->lowLimit = end; in ZSTD_window_clear()
1039 window->dictLimit = end; in ZSTD_window_clear()
1042 MEM_STATIC U32 ZSTD_window_isEmpty(ZSTD_window_t const window) in ZSTD_window_isEmpty() argument
1044 return window.dictLimit == ZSTD_WINDOW_START_INDEX && in ZSTD_window_isEmpty()
1045 window.lowLimit == ZSTD_WINDOW_START_INDEX && in ZSTD_window_isEmpty()
1046 (window.nextSrc - window.base) == ZSTD_WINDOW_START_INDEX; in ZSTD_window_isEmpty()
1051 * Returns non-zero if the window has a non-empty extDict.
1053 MEM_STATIC U32 ZSTD_window_hasExtDict(ZSTD_window_t const window) in ZSTD_window_hasExtDict() argument
1055 return window.lowLimit < window.dictLimit; in ZSTD_window_hasExtDict()
1065 return ZSTD_window_hasExtDict(ms->window) ? in ZSTD_matchState_dictMode()
1089 MEM_STATIC U32 ZSTD_window_canOverflowCorrect(ZSTD_window_t const window, in ZSTD_window_canOverflowCorrect() argument
1096 U32 const curr = (U32)((BYTE const*)src - window.base); in ZSTD_window_canOverflowCorrect()
1106 U32 const adjustment = window.nbOverflowCorrections + 1; in ZSTD_window_canOverflowCorrect()
1124 MEM_STATIC U32 ZSTD_window_needOverflowCorrection(ZSTD_window_t const window, in ZSTD_window_needOverflowCorrection() argument
1131 U32 const curr = (U32)((BYTE const*)srcEnd - window.base); in ZSTD_window_needOverflowCorrection()
1133 if (ZSTD_window_canOverflowCorrect(window, cycleLog, maxDist, loadedDictEnd, src)) { in ZSTD_window_needOverflowCorrection()
1151 U32 ZSTD_window_correctOverflow(ZSTD_window_t* window, U32 cycleLog, in ZSTD_window_correctOverflow() argument
1175 U32 const curr = (U32)((BYTE const*)src - window->base); in ZSTD_window_correctOverflow()
1197 window->base += correction; in ZSTD_window_correctOverflow()
1198 window->dictBase += correction; in ZSTD_window_correctOverflow()
1199 if (window->lowLimit < correction + ZSTD_WINDOW_START_INDEX) { in ZSTD_window_correctOverflow()
1200 window->lowLimit = ZSTD_WINDOW_START_INDEX; in ZSTD_window_correctOverflow()
1202 window->lowLimit -= correction; in ZSTD_window_correctOverflow()
1204 if (window->dictLimit < correction + ZSTD_WINDOW_START_INDEX) { in ZSTD_window_correctOverflow()
1205 window->dictLimit = ZSTD_WINDOW_START_INDEX; in ZSTD_window_correctOverflow()
1207 window->dictLimit -= correction; in ZSTD_window_correctOverflow()
1210 /* Ensure we can still reference the full window. */ in ZSTD_window_correctOverflow()
1214 assert(window->lowLimit <= newCurrent); in ZSTD_window_correctOverflow()
1215 assert(window->dictLimit <= newCurrent); in ZSTD_window_correctOverflow()
1217 ++window->nbOverflowCorrections; in ZSTD_window_correctOverflow()
1220 window->lowLimit); in ZSTD_window_correctOverflow()
1239 * as long as the last byte of the dictionary is in the window.
1240 * Once input has progressed beyond window size, dictionary cannot be referenced anymore.
1248 ZSTD_window_enforceMaxDist(ZSTD_window_t* window, in ZSTD_window_enforceMaxDist() argument
1254 U32 const blockEndIdx = (U32)((BYTE const*)blockEnd - window->base); in ZSTD_window_enforceMaxDist()
1274 if (window->lowLimit < newLowLimit) window->lowLimit = newLowLimit; in ZSTD_window_enforceMaxDist()
1275 if (window->dictLimit < window->lowLimit) { in ZSTD_window_enforceMaxDist()
1277 (unsigned)window->dictLimit, (unsigned)window->lowLimit); in ZSTD_window_enforceMaxDist()
1278 window->dictLimit = window->lowLimit; in ZSTD_window_enforceMaxDist()
1280 /* On reaching window size, dictionaries are invalidated */ in ZSTD_window_enforceMaxDist()
1288 * when input progresses beyond window size.
1290 * loadedDictEnd uses same referential as window->base
1291 * maxDist is the window size */
1293 ZSTD_checkDictValidity(const ZSTD_window_t* window, in ZSTD_checkDictValidity() argument
1301 { U32 const blockEndIdx = (U32)((BYTE const*)blockEnd - window->base); in ZSTD_checkDictValidity()
1307 if (blockEndIdx > loadedDictEnd + maxDist || loadedDictEnd != window->dictLimit) { in ZSTD_checkDictValidity()
1308 /* On reaching window size, dictionaries are invalidated. in ZSTD_checkDictValidity()
1309 * For simplification, if window size is reached anywhere within next block, in ZSTD_checkDictValidity()
1313 * non-contiguous segments, which means that loadedDictEnd != window->dictLimit. in ZSTD_checkDictValidity()
1326 MEM_STATIC void ZSTD_window_init(ZSTD_window_t* window) { in ZSTD_window_init() argument
1327 ZSTD_memset(window, 0, sizeof(*window)); in ZSTD_window_init()
1328 window->base = (BYTE const*)" "; in ZSTD_window_init()
1329 window->dictBase = (BYTE const*)" "; in ZSTD_window_init()
1331window->dictLimit = ZSTD_WINDOW_START_INDEX; /* start from >0, so that 1st position is valid */ in ZSTD_window_init()
1332window->lowLimit = ZSTD_WINDOW_START_INDEX; /* it ensures first and later CCtx usages compress… in ZSTD_window_init()
1333 window->nextSrc = window->base + ZSTD_WINDOW_START_INDEX; /* see issue #1241 */ in ZSTD_window_init()
1334 window->nbOverflowCorrections = 0; in ZSTD_window_init()
1339 * Updates the window by appending [src, src + srcSize) to the window.
1346 U32 ZSTD_window_update(ZSTD_window_t* window, in ZSTD_window_update() argument
1355 assert(window->base != NULL); in ZSTD_window_update()
1356 assert(window->dictBase != NULL); in ZSTD_window_update()
1358 if (src != window->nextSrc || forceNonContiguous) { in ZSTD_window_update()
1360 size_t const distanceFromBase = (size_t)(window->nextSrc - window->base); in ZSTD_window_update()
1361 DEBUGLOG(5, "Non contiguous blocks, new segment starts at %u", window->dictLimit); in ZSTD_window_update()
1362 window->lowLimit = window->dictLimit; in ZSTD_window_update()
1364 window->dictLimit = (U32)distanceFromBase; in ZSTD_window_update()
1365 window->dictBase = window->base; in ZSTD_window_update()
1366 window->base = ip - distanceFromBase; in ZSTD_window_update()
1367 /* ms->nextToUpdate = window->dictLimit; */ in ZSTD_window_update()
1368 …if (window->dictLimit - window->lowLimit < HASH_READ_SIZE) window->lowLimit = window->dictLimit; … in ZSTD_window_update()
1371 window->nextSrc = ip + srcSize; in ZSTD_window_update()
1373 if ( (ip+srcSize > window->dictBase + window->lowLimit) in ZSTD_window_update()
1374 & (ip < window->dictBase + window->dictLimit)) { in ZSTD_window_update()
1375 size_t const highInputIdx = (size_t)((ip + srcSize) - window->dictBase); in ZSTD_window_update()
1376 …U32 const lowLimitMax = (highInputIdx > (size_t)window->dictLimit) ? window->dictLimit : (U32)high… in ZSTD_window_update()
1378 window->lowLimit = lowLimitMax; in ZSTD_window_update()
1379 DEBUGLOG(5, "Overlapping extDict and input : new lowLimit = %u", window->lowLimit); in ZSTD_window_update()
1390 U32 const lowestValid = ms->window.lowLimit; in ZSTD_getLowestMatchIndex()
1394 * is within the window. We invalidate the dictionary (and set loadedDictEnd to 0) when it isn't in ZSTD_getLowestMatchIndex()
1407 U32 const lowestValid = ms->window.dictLimit; in ZSTD_getLowestPrefixIndex()