Create LUT for PrefixEncode.

This speeds up lossless compression by 5%.
Change-Id: Ifd114b1d9850dc3aac74593809e7d48529d35e3d
This commit is contained in:
Vikas Arora
2013-08-05 10:19:24 -07:00
parent 988b70844e
commit 69257f70df
6 changed files with 191 additions and 80 deletions

View File

@ -90,12 +90,10 @@ void VP8LHistogramAddSinglePixOrCopy(VP8LHistogram* const histo,
int literal_ix = 256 + NUM_LENGTH_CODES + PixOrCopyCacheIdx(v);
++histo->literal_[literal_ix];
} else {
int code, extra_bits_count, extra_bits_value;
PrefixEncode(PixOrCopyLength(v),
&code, &extra_bits_count, &extra_bits_value);
int code, extra_bits, extra_bits_val;
VP8LPrefixEncode(PixOrCopyLength(v), &code, &extra_bits, &extra_bits_val);
++histo->literal_[256 + code];
PrefixEncode(PixOrCopyDistance(v),
&code, &extra_bits_count, &extra_bits_value);
VP8LPrefixEncode(PixOrCopyDistance(v), &code, &extra_bits, &extra_bits_val);
++histo->distance_[code];
}
}