Fix small entropy analysis bug.

Change-Id: I70554b5a898b38930dfd03ca1ed78a075261e84b
This commit is contained in:
Vincent Rabaud 2017-02-24 13:38:41 +01:00
parent 6e7caf06ee
commit 7d985bd1d0

View File

@ -198,12 +198,10 @@ static int AnalyzeEntropy(const uint32_t* argb,
const uint32_t* prev_row = argb; const uint32_t* prev_row = argb;
const uint32_t* curr_row = argb + argb_stride; const uint32_t* curr_row = argb + argb_stride;
for (y = 1; y < height; ++y) { for (y = 1; y < height; ++y) {
uint32_t prev_pix = curr_row[0];
for (x = 1; x < width; ++x) { for (x = 1; x < width; ++x) {
const uint32_t pix = curr_row[x]; const uint32_t pix = curr_row[x];
const uint32_t pix_diff = VP8LSubPixels(pix, prev_pix); const uint32_t pix_diff = VP8LSubPixels(pix, curr_row[x - 1]);
if ((pix_diff == 0) || (pix == prev_row[x])) continue; if ((pix_diff == 0) || (pix == prev_row[x])) continue;
prev_pix = pix;
AddSingle(pix, AddSingle(pix,
&histo[kHistoAlpha * 256], &histo[kHistoAlpha * 256],
&histo[kHistoRed * 256], &histo[kHistoRed * 256],