mirror of
https://github.com/webmproject/libwebp.git
synced 2025-10-16 23:41:40 +02:00
Evaluate output cluster's bit_costs once in HistogramRefine.
Avoid bit_costs evaluated every time in function HistogramDistance. Also moved VP8LInitBackwardRefs and VP8LClearBackwardRefs to backward_references.h Change-Id: Id507f164d0fc64480aebc4a3ea3e6950ed377a60
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include "../webp/types.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
@@ -172,6 +173,20 @@ static WEBP_INLINE uint32_t PixOrCopyDistance(const PixOrCopy* const p) {
|
||||
return p->argb_or_distance;
|
||||
}
|
||||
|
||||
static WEBP_INLINE void VP8LInitBackwardRefs(VP8LBackwardRefs* const refs) {
|
||||
if (refs != NULL) {
|
||||
refs->refs = NULL;
|
||||
refs->size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static WEBP_INLINE void VP8LClearBackwardRefs(VP8LBackwardRefs* const refs) {
|
||||
if (refs != NULL) {
|
||||
free(refs->refs);
|
||||
VP8LInitBackwardRefs(refs);
|
||||
}
|
||||
}
|
||||
|
||||
// Ridiculously simple backward references for images where it is unlikely
|
||||
// that there are large backward references (photos).
|
||||
void VP8LBackwardReferencesRle(
|
||||
|
Reference in New Issue
Block a user