Lines Matching full:refs
84 extern void VP8LClearBackwardRefs(VP8LBackwardRefs* const refs);
85 void VP8LClearBackwardRefs(VP8LBackwardRefs* const refs) { in VP8LClearBackwardRefs() argument
86 assert(refs != NULL); in VP8LClearBackwardRefs()
87 if (refs->tail_ != NULL) { in VP8LClearBackwardRefs()
88 *refs->tail_ = refs->free_blocks_; // recycle all blocks at once in VP8LClearBackwardRefs()
90 refs->free_blocks_ = refs->refs_; in VP8LClearBackwardRefs()
91 refs->tail_ = &refs->refs_; in VP8LClearBackwardRefs()
92 refs->last_block_ = NULL; in VP8LClearBackwardRefs()
93 refs->refs_ = NULL; in VP8LClearBackwardRefs()
96 void VP8LBackwardRefsClear(VP8LBackwardRefs* const refs) { in VP8LBackwardRefsClear() argument
97 assert(refs != NULL); in VP8LBackwardRefsClear()
98 VP8LClearBackwardRefs(refs); in VP8LBackwardRefsClear()
99 while (refs->free_blocks_ != NULL) { in VP8LBackwardRefsClear()
100 PixOrCopyBlock* const next = refs->free_blocks_->next_; in VP8LBackwardRefsClear()
101 WebPSafeFree(refs->free_blocks_); in VP8LBackwardRefsClear()
102 refs->free_blocks_ = next; in VP8LBackwardRefsClear()
106 void VP8LBackwardRefsInit(VP8LBackwardRefs* const refs, int block_size) { in VP8LBackwardRefsInit() argument
107 assert(refs != NULL); in VP8LBackwardRefsInit()
108 memset(refs, 0, sizeof(*refs)); in VP8LBackwardRefsInit()
109 refs->tail_ = &refs->refs_; in VP8LBackwardRefsInit()
110 refs->block_size_ = in VP8LBackwardRefsInit()
114 VP8LRefsCursor VP8LRefsCursorInit(const VP8LBackwardRefs* const refs) { in VP8LRefsCursorInit() argument
116 c.cur_block_ = refs->refs_; in VP8LRefsCursorInit()
117 if (refs->refs_ != NULL) { in VP8LRefsCursorInit()
135 static PixOrCopyBlock* BackwardRefsNewBlock(VP8LBackwardRefs* const refs) { in BackwardRefsNewBlock() argument
136 PixOrCopyBlock* b = refs->free_blocks_; in BackwardRefsNewBlock()
139 sizeof(*b) + refs->block_size_ * sizeof(*b->start_); in BackwardRefsNewBlock()
142 refs->error_ |= 1; in BackwardRefsNewBlock()
147 refs->free_blocks_ = b->next_; in BackwardRefsNewBlock()
149 *refs->tail_ = b; in BackwardRefsNewBlock()
150 refs->tail_ = &b->next_; in BackwardRefsNewBlock()
151 refs->last_block_ = b; in BackwardRefsNewBlock()
157 extern void VP8LBackwardRefsCursorAdd(VP8LBackwardRefs* const refs,
159 void VP8LBackwardRefsCursorAdd(VP8LBackwardRefs* const refs, in VP8LBackwardRefsCursorAdd() argument
161 PixOrCopyBlock* b = refs->last_block_; in VP8LBackwardRefsCursorAdd()
162 if (b == NULL || b->size_ == refs->block_size_) { in VP8LBackwardRefsCursorAdd()
163 b = BackwardRefsNewBlock(refs); in VP8LBackwardRefsCursorAdd()
164 if (b == NULL) return; // refs->error_ is set in VP8LBackwardRefsCursorAdd()
394 VP8LBackwardRefs* const refs) { in AddSingleLiteral() argument
407 VP8LBackwardRefsCursorAdd(refs, v); in AddSingleLiteral()
412 int cache_bits, VP8LBackwardRefs* const refs) { in BackwardReferencesRle() argument
421 VP8LClearBackwardRefs(refs); in BackwardReferencesRle()
423 AddSingleLiteral(argb[0], use_color_cache, &hashers, refs); in BackwardReferencesRle()
431 VP8LBackwardRefsCursorAdd(refs, PixOrCopyCreateCopy(1, rle_len)); in BackwardReferencesRle()
437 VP8LBackwardRefsCursorAdd(refs, PixOrCopyCreateCopy(xsize, prev_row_len)); in BackwardReferencesRle()
445 AddSingleLiteral(argb[i], use_color_cache, &hashers, refs); in BackwardReferencesRle()
450 return !refs->error_; in BackwardReferencesRle()
456 VP8LBackwardRefs* const refs) { in BackwardReferencesLz77() argument
469 VP8LClearBackwardRefs(refs); in BackwardReferencesLz77()
505 AddSingleLiteral(argb[i], use_color_cache, &hashers, refs); in BackwardReferencesLz77()
507 VP8LBackwardRefsCursorAdd(refs, PixOrCopyCreateCopy(offset, len)); in BackwardReferencesLz77()
515 ok = !refs->error_; in BackwardReferencesLz77()
529 VP8LBackwardRefs* const refs) { in BackwardReferencesLz77Box() argument
671 refs); in BackwardReferencesLz77Box()
677 const VP8LBackwardRefs* const refs) { in BackwardReferences2DLocality() argument
678 VP8LRefsCursor c = VP8LRefsCursorInit(refs); in BackwardReferences2DLocality()
695 const VP8LBackwardRefs* const refs, in CalculateBestCacheSize() argument
702 VP8LRefsCursor c = VP8LRefsCursorInit(refs); in CalculateBestCacheSize()
796 VP8LBackwardRefs* const refs) { in BackwardRefsWithLocalCache() argument
799 VP8LRefsCursor c = VP8LRefsCursorInit(refs); in BackwardRefsWithLocalCache()
815 // refs was created without local cache, so it can not have cache indexes. in BackwardRefsWithLocalCache()