Make tile size a function of encoding method.

Higher method implies more encoding effort (CPU) achieved with
smaller tile sizes (lower histo_bits).

Change-Id: Ic39c8d882c87835f74fde41172afb002ac3fd1c3
This commit is contained in:
Vikas Arora 2012-05-18 12:14:50 +05:30
parent 778c52284b
commit 831bd13168

View File

@ -810,7 +810,8 @@ static int GetHistoBits(const WebPConfig* const config,
const int width = pic->width; const int width = pic->width;
const int height = pic->height; const int height = pic->height;
const size_t hist_size = sizeof(VP8LHistogram); const size_t hist_size = sizeof(VP8LHistogram);
int histo_bits = 9 - (int)(config->quality / 16.f + .5f); // Make tile size a function of encoding method (Range: 0 to 6).
int histo_bits = 8 - config->method;
while (1) { while (1) {
const size_t huff_image_size = VP8LSubSampleSize(width, histo_bits) * const size_t huff_image_size = VP8LSubSampleSize(width, histo_bits) *
VP8LSubSampleSize(height, histo_bits) * VP8LSubSampleSize(height, histo_bits) *