mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-17 06:19:54 +02:00
use 16bit counters for recording proba counts
This proved being ok, even for large pictures, provided one takes care of overflow. When an overflow is bound to occur, the counters are renormalized. Overall, shaves ~12k of memory. Change-Id: I2ba21a407964fe1a34c352371cba15166e0c4548
This commit is contained in:
@ -165,8 +165,9 @@ extern const uint8_t VP8Zigzag[16];
|
||||
//------------------------------------------------------------------------------
|
||||
// Headers
|
||||
|
||||
typedef uint32_t proba_t; // 16b + 16b
|
||||
typedef uint8_t ProbaArray[NUM_CTX][NUM_PROBAS];
|
||||
typedef uint64_t StatsArray[NUM_CTX][NUM_PROBAS][2];
|
||||
typedef proba_t StatsArray[NUM_CTX][NUM_PROBAS];
|
||||
typedef uint16_t CostArray[NUM_CTX][MAX_VARIABLE_LEVEL + 1];
|
||||
typedef double LFStats[NUM_MB_SEGMENTS][MAX_LF_LEVELS]; // filter stats
|
||||
|
||||
@ -185,7 +186,7 @@ typedef struct {
|
||||
uint8_t segments_[3]; // probabilities for segment tree
|
||||
uint8_t skip_proba_; // final probability of being skipped.
|
||||
ProbaArray coeffs_[NUM_TYPES][NUM_BANDS]; // 924 bytes
|
||||
StatsArray stats_[NUM_TYPES][NUM_BANDS]; // 7.4k
|
||||
StatsArray stats_[NUM_TYPES][NUM_BANDS]; // 4224 bytes
|
||||
CostArray level_cost_[NUM_TYPES][NUM_BANDS]; // 11.4k
|
||||
int use_skip_proba_; // Note: we always use skip_proba for now.
|
||||
int nb_skip_; // number of skipped blocks
|
||||
|
Reference in New Issue
Block a user