#ifndef WEBP_ENC_BACKWARD_REFERENCES_ENC_H_
#define WEBP_ENC_BACKWARD_REFERENCES_ENC_H_
#include <assert.h>
#include <stdlib.h>
#include "src/webp/types.h"
#include "src/webp/encode.h"
#include "src/webp/format_constants.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_COLOR_CACHE_BITS …
enum Mode { … };
PixOrCopy;
static WEBP_INLINE PixOrCopy PixOrCopyCreateCopy(uint32_t distance,
uint16_t len) { … }
static WEBP_INLINE PixOrCopy PixOrCopyCreateCacheIdx(int idx) { … }
static WEBP_INLINE PixOrCopy PixOrCopyCreateLiteral(uint32_t argb) { … }
static WEBP_INLINE int PixOrCopyIsLiteral(const PixOrCopy* const p) { … }
static WEBP_INLINE int PixOrCopyIsCacheIdx(const PixOrCopy* const p) { … }
static WEBP_INLINE int PixOrCopyIsCopy(const PixOrCopy* const p) { … }
static WEBP_INLINE uint32_t PixOrCopyLiteral(const PixOrCopy* const p,
int component) { … }
static WEBP_INLINE uint32_t PixOrCopyLength(const PixOrCopy* const p) { … }
static WEBP_INLINE uint32_t PixOrCopyCacheIdx(const PixOrCopy* const p) { … }
static WEBP_INLINE uint32_t PixOrCopyDistance(const PixOrCopy* const p) { … }
#define HASH_BITS …
#define HASH_SIZE …
#define MAX_LENGTH_BITS …
#define WINDOW_SIZE_BITS …
#define MAX_LENGTH …
#if MAX_LENGTH_BITS + WINDOW_SIZE_BITS > 32
#error "MAX_LENGTH_BITS + WINDOW_SIZE_BITS > 32"
#endif
VP8LHashChain;
struct VP8LHashChain { … };
int VP8LHashChainInit(VP8LHashChain* const p, int size);
int VP8LHashChainFill(VP8LHashChain* const p, int quality,
const uint32_t* const argb, int xsize, int ysize,
int low_effort, const WebPPicture* const pic,
int percent_range, int* const percent);
void VP8LHashChainClear(VP8LHashChain* const p);
static WEBP_INLINE int VP8LHashChainFindOffset(const VP8LHashChain* const p,
const int base_position) { … }
static WEBP_INLINE int VP8LHashChainFindLength(const VP8LHashChain* const p,
const int base_position) { … }
static WEBP_INLINE void VP8LHashChainFindCopy(const VP8LHashChain* const p,
int base_position,
int* const offset_ptr,
int* const length_ptr) { … }
#define MAX_REFS_BLOCK_PER_IMAGE …
PixOrCopyBlock;
VP8LBackwardRefs;
struct VP8LBackwardRefs { … };
void VP8LBackwardRefsInit(VP8LBackwardRefs* const refs, int block_size);
void VP8LBackwardRefsClear(VP8LBackwardRefs* const refs);
VP8LRefsCursor;
VP8LRefsCursor VP8LRefsCursorInit(const VP8LBackwardRefs* const refs);
static WEBP_INLINE int VP8LRefsCursorOk(const VP8LRefsCursor* const c) { … }
void VP8LRefsCursorNextBlock(VP8LRefsCursor* const c);
static WEBP_INLINE void VP8LRefsCursorNext(VP8LRefsCursor* const c) { … }
enum VP8LLZ77Type { … };
int VP8LGetBackwardReferences(
int width, int height, const uint32_t* const argb, int quality,
int low_effort, int lz77_types_to_try, int cache_bits_max, int do_no_cache,
const VP8LHashChain* const hash_chain, VP8LBackwardRefs* const refs,
int* const cache_bits_best, const WebPPicture* const pic, int percent_range,
int* const percent);
#ifdef __cplusplus
}
#endif
#endif