Skip to content

Commit

Permalink
Remove unused argument in VP8LBitsEntropy.
Browse files Browse the repository at this point in the history
The function is only used once and does not use the extra argument.

Change-Id: I9735383784746cb02b5a643b7a4a2037f2874bf9
  • Loading branch information
vrabaud committed Feb 16, 2018
1 parent 3005237 commit 551948e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
9 changes: 2 additions & 7 deletions src/enc/histogram_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,9 @@ static WEBP_INLINE double BitsEntropyRefine(const VP8LBitEntropy* entropy) {
}
}

double VP8LBitsEntropy(const uint32_t* const array, int n,
uint32_t* const trivial_symbol) {
double VP8LBitsEntropy(const uint32_t* const array, int n) {
VP8LBitEntropy entropy;
VP8LBitsEntropyUnrefined(array, n, &entropy);
if (trivial_symbol != NULL) {
*trivial_symbol =
(entropy.nonzeros == 1) ? entropy.nonzero_code : VP8L_NON_TRIVIAL_SYM;
}

return BitsEntropyRefine(&entropy);
}
Expand Down Expand Up @@ -605,7 +600,7 @@ static void HistogramCombineEntropyBin(VP8LHistogramSet* const image_histo,
}

// Implement a Lehmer random number generator with a multiplicative constant of
// 48271 and a modulo constant of 2^31 1.
// 48271 and a modulo constant of 2^31 - 1.
static uint32_t MyRand(uint32_t* const seed) {
*seed = (uint32_t)(((uint64_t)(*seed) * 48271u) % 2147483647u);
assert(*seed > 0);
Expand Down
5 changes: 1 addition & 4 deletions src/enc/histogram_enc.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ int VP8LGetHistoImageSymbols(int xsize, int ysize,
uint16_t* const histogram_symbols);

// Returns the entropy for the symbols in the input array.
// Also sets trivial_symbol to the code value, if the array has only one code
// value. Otherwise, set it to VP8L_NON_TRIVIAL_SYM.
double VP8LBitsEntropy(const uint32_t* const array, int n,
uint32_t* const trivial_symbol);
double VP8LBitsEntropy(const uint32_t* const array, int n);

// Estimate how many bits the combined entropy of literals and distance
// approximately maps to.
Expand Down
2 changes: 1 addition & 1 deletion src/enc/vp8l_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static int AnalyzeEntropy(const uint32_t* argb,
++histo[kHistoAlphaPred * 256];

for (j = 0; j < kHistoTotal; ++j) {
entropy_comp[j] = VP8LBitsEntropy(&histo[j * 256], 256, NULL);
entropy_comp[j] = VP8LBitsEntropy(&histo[j * 256], 256);
}
entropy[kDirect] = entropy_comp[kHistoAlpha] +
entropy_comp[kHistoRed] +
Expand Down

0 comments on commit 551948e

Please sign in to comment.