Don't allocate VP8LHashChain, but treat like automatic object

the unique instance of VP8LHashChain (1MB size corresponding to hash_to_first_index_)
is now wholy part of VP8LEncoder, instead of maintaining the pointer to VP8LHashChain
in the encoder.

Change-Id: Ib6fe52019fdd211fbbc78dc0ba731a4af0728677
This commit is contained in:
skal
2014-04-30 14:10:48 -07:00
parent b7f19b8311
commit d3bcf72bf5
4 changed files with 39 additions and 38 deletions

View File

@ -14,6 +14,7 @@
#ifndef WEBP_ENC_VP8LI_H_
#define WEBP_ENC_VP8LI_H_
#include "./backward_references.h"
#include "./histogram.h"
#include "../utils/bit_writer.h"
#include "../webp/encode.h"
@ -23,8 +24,6 @@
extern "C" {
#endif
struct VP8LHashChain; // Defined in backward_references.h
typedef struct {
const WebPConfig* config_; // user configuration and parameters
const WebPPicture* pic_; // input picture.
@ -35,11 +34,6 @@ typedef struct {
uint32_t* transform_data_; // Scratch memory for transform data.
int current_width_; // Corresponds to packed image width.
struct VP8LHashChain* hash_chain_; // HashChain data for constructing
// backward references.
struct VP8LBackwardRefs* refs_[2]; // Backward Refs array corresponding to
// LZ77 & RLE coding.
// Encoding parameters derived from quality parameter.
int histo_bits_;
int transform_bits_;
@ -52,6 +46,12 @@ typedef struct {
int use_palette_;
int palette_size_;
uint32_t palette_[MAX_PALETTE_SIZE];
// Some 'scratch' (potentially large) objects.
struct VP8LBackwardRefs* refs_[2]; // Backward Refs array corresponding to
// LZ77 & RLE coding.
VP8LHashChain hash_chain_; // HashChain data for constructing
// backward references.
} VP8LEncoder;
//------------------------------------------------------------------------------