Lines Matching refs:lmc
28 void ZopfliInitCache(size_t blocksize, ZopfliLongestMatchCache* lmc) { in ZopfliInitCache() argument
30 lmc->length = (unsigned short*)malloc(sizeof(unsigned short) * blocksize); in ZopfliInitCache()
31 lmc->dist = (unsigned short*)malloc(sizeof(unsigned short) * blocksize); in ZopfliInitCache()
33 lmc->sublen = (unsigned char*)malloc(ZOPFLI_CACHE_LENGTH * 3 * blocksize); in ZopfliInitCache()
37 for (i = 0; i < blocksize; i++) lmc->length[i] = 1; in ZopfliInitCache()
38 for (i = 0; i < blocksize; i++) lmc->dist[i] = 0; in ZopfliInitCache()
39 for (i = 0; i < ZOPFLI_CACHE_LENGTH * blocksize * 3; i++) lmc->sublen[i] = 0; in ZopfliInitCache()
42 void ZopfliCleanCache(ZopfliLongestMatchCache* lmc) { in ZopfliCleanCache() argument
43 free(lmc->length); in ZopfliCleanCache()
44 free(lmc->dist); in ZopfliCleanCache()
45 free(lmc->sublen); in ZopfliCleanCache()
50 ZopfliLongestMatchCache* lmc) { in ZopfliSublenToCache() argument
60 cache = &lmc->sublen[ZOPFLI_CACHE_LENGTH * pos * 3]; in ZopfliSublenToCache()
78 assert(bestlength == ZopfliMaxCachedSublen(lmc, pos, length)); in ZopfliSublenToCache()
81 void ZopfliCacheToSublen(const ZopfliLongestMatchCache* lmc, in ZopfliCacheToSublen() argument
85 unsigned maxlength = ZopfliMaxCachedSublen(lmc, pos, length); in ZopfliCacheToSublen()
92 cache = &lmc->sublen[ZOPFLI_CACHE_LENGTH * pos * 3]; in ZopfliCacheToSublen()
107 unsigned ZopfliMaxCachedSublen(const ZopfliLongestMatchCache* lmc, in ZopfliMaxCachedSublen() argument
113 cache = &lmc->sublen[ZOPFLI_CACHE_LENGTH * pos * 3]; in ZopfliMaxCachedSublen()