Lines Matching refs:costs
215 float* costs; in GetBestLengths() local
229 costs = (float*)malloc(sizeof(float) * (blocksize + 1)); in GetBestLengths()
230 if (!costs) exit(-1); /* Allocation failed. */ in GetBestLengths()
238 for (i = 1; i < blocksize + 1; i++) costs[i] = ZOPFLI_LARGE_FLOAT; in GetBestLengths()
239 costs[0] = 0; /* Because it's the start. */ in GetBestLengths()
259 costs[j + ZOPFLI_MAX_MATCH] = costs[j] + symbolcost; in GetBestLengths()
273 double newCost = costs[j] + costmodel(in[i], 0, costcontext); in GetBestLengths()
275 if (newCost < costs[j + 1]) { in GetBestLengths()
276 costs[j + 1] = newCost; in GetBestLengths()
286 if (costs[j + k] - costs[j] <= mincost) continue; in GetBestLengths()
288 newCost = costs[j] + costmodel(k, sublen[k], costcontext); in GetBestLengths()
290 if (newCost < costs[j + k]) { in GetBestLengths()
292 costs[j + k] = newCost; in GetBestLengths()
298 assert(costs[blocksize] >= 0); in GetBestLengths()
299 result = costs[blocksize]; in GetBestLengths()
302 free(costs); in GetBestLengths()