#ifndef WEBP_DEC_VP8LI_DEC_H_
#define WEBP_DEC_VP8LI_DEC_H_
#include <string.h>
#include "src/dec/webpi_dec.h"
#include "src/utils/bit_reader_utils.h"
#include "src/utils/color_cache_utils.h"
#include "src/utils/huffman_utils.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
READ_DATA = 0,
READ_HDR = 1,
READ_DIM = 2
} VP8LDecodeState;
typedef struct VP8LTransform VP8LTransform;
struct VP8LTransform {
VP8LImageTransformType type_; int bits_; int xsize_; int ysize_; uint32_t* data_; };
typedef struct {
int color_cache_size_;
VP8LColorCache color_cache_;
VP8LColorCache saved_color_cache_;
int huffman_mask_;
int huffman_subsample_bits_;
int huffman_xsize_;
uint32_t* huffman_image_;
int num_htree_groups_;
HTreeGroup* htree_groups_;
HuffmanTables huffman_tables_;
} VP8LMetadata;
typedef struct VP8LDecoder VP8LDecoder;
struct VP8LDecoder {
VP8StatusCode status_;
VP8LDecodeState state_;
VP8Io* io_;
const WebPDecBuffer* output_;
uint32_t* pixels_; uint32_t* argb_cache_;
VP8LBitReader br_;
int incremental_; VP8LBitReader saved_br_; int saved_last_pixel_;
int width_;
int height_;
int last_row_; int last_pixel_; int last_out_row_;
VP8LMetadata hdr_;
int next_transform_;
VP8LTransform transforms_[NUM_TRANSFORMS];
uint32_t transforms_seen_;
uint8_t* rescaler_memory; WebPRescaler* rescaler; };
struct ALPHDecoder;
int VP8LDecodeAlphaHeader(struct ALPHDecoder* const alph_dec,
const uint8_t* const data, size_t data_size);
int VP8LDecodeAlphaImageStream(struct ALPHDecoder* const alph_dec,
int last_row);
VP8LDecoder* VP8LNew(void);
int VP8LDecodeHeader(VP8LDecoder* const dec, VP8Io* const io);
int VP8LDecodeImage(VP8LDecoder* const dec);
void VP8LClear(VP8LDecoder* const dec);
void VP8LDelete(VP8LDecoder* const dec);
#ifdef __cplusplus
} #endif
#endif