header clean-up

remove unused VP8LHistogramRemove function
make HistogramEstimateBitsHeader static

Change-Id: I0dc6a6f4c41d3c5f55a8153cd7d710c9f84582a7
This commit is contained in:
Pascal Massimino 2012-07-16 19:13:01 -07:00
parent 8130c4cc64
commit 23d34f3142
2 changed files with 8 additions and 32 deletions

View File

@ -88,8 +88,7 @@ VP8LHistogramSet* VP8LAllocateHistogramSet(int size, int cache_bits) {
// -----------------------------------------------------------------------------
void VP8LConvertPopulationCountTableToBitEstimates(
int num_symbols, const int* const population_counts,
double* const output) {
int num_symbols, const int population_counts[], double output[]) {
int sum = 0;
int nonzeros = 0;
int i;
@ -206,9 +205,6 @@ double VP8LHistogramEstimateBitsBulk(const VP8LHistogram* const p) {
return retval;
}
double VP8LHistogramEstimateBits(const VP8LHistogram* const p) {
return VP8LHistogramEstimateBitsHeader(p) + VP8LHistogramEstimateBitsBulk(p);
}
// Returns the cost encode the rle-encoded entropy code.
// The constants in this function are experimental.
@ -249,7 +245,8 @@ static double HuffmanCost(const int* const population, int length) {
return retval;
}
double VP8LHistogramEstimateBitsHeader(const VP8LHistogram* const p) {
// Estimates the Huffman dictionary + other block overhead size.
static double HistogramEstimateBitsHeader(const VP8LHistogram* const p) {
return HuffmanCost(&p->alpha_[0], 256) +
HuffmanCost(&p->red_[0], 256) +
HuffmanCost(&p->literal_[0], VP8LHistogramNumCodes(p)) +
@ -257,6 +254,10 @@ double VP8LHistogramEstimateBitsHeader(const VP8LHistogram* const p) {
HuffmanCost(&p->distance_[0], NUM_DISTANCE_CODES);
}
double VP8LHistogramEstimateBits(const VP8LHistogram* const p) {
return HistogramEstimateBitsHeader(p) + VP8LHistogramEstimateBitsBulk(p);
}
static void HistogramBuildImage(int xsize, int histo_bits,
const VP8LBackwardRefs* const backward_refs,
VP8LHistogramSet* const image) {

View File

@ -76,10 +76,6 @@ void VP8LHistogramAddSinglePixOrCopy(VP8LHistogram* const histo,
// approximately maps to.
double VP8LHistogramEstimateBits(const VP8LHistogram* const p);
// This function estimates the Huffman dictionary + other block overhead
// size for creating a new deflate block.
double VP8LHistogramEstimateBitsHeader(const VP8LHistogram* const p);
// This function estimates the cost in bits excluding the bits needed to
// represent the entropy code itself.
double VP8LHistogramEstimateBitsBulk(const VP8LHistogram* const p);
@ -100,34 +96,13 @@ static WEBP_INLINE void VP8LHistogramAdd(VP8LHistogram* const p,
}
}
static WEBP_INLINE void VP8LHistogramRemove(VP8LHistogram* const p,
const VP8LHistogram* const a) {
int i;
for (i = 0; i < PIX_OR_COPY_CODES_MAX; ++i) {
p->literal_[i] -= a->literal_[i];
assert(p->literal_[i] >= 0);
}
for (i = 0; i < NUM_DISTANCE_CODES; ++i) {
p->distance_[i] -= a->distance_[i];
assert(p->distance_[i] >= 0);
}
for (i = 0; i < 256; ++i) {
p->red_[i] -= a->red_[i];
p->blue_[i] -= a->blue_[i];
p->alpha_[i] -= a->alpha_[i];
assert(p->red_[i] >= 0);
assert(p->blue_[i] >= 0);
assert(p->alpha_[i] >= 0);
}
}
static WEBP_INLINE int VP8LHistogramNumCodes(const VP8LHistogram* const p) {
return 256 + NUM_LENGTH_CODES +
((p->palette_code_bits_ > 0) ? (1 << p->palette_code_bits_) : 0);
}
void VP8LConvertPopulationCountTableToBitEstimates(
int n, const int* const population_counts, double* const output);
int num_symbols, const int population_counts[], double output[]);
// Builds the histogram image.
int VP8LGetHistoImageSymbols(int xsize, int ysize,