Merge pull request #8 from szabadka/master

Minor tuning of encoder heuristics.
This commit is contained in:
szabadka 2014-10-28 12:54:47 +01:00
commit f580616386
2 changed files with 4 additions and 3 deletions

View File

@ -33,7 +33,7 @@ namespace brotli {
static const int kMaxLiteralHistograms = 100;
static const int kMaxCommandHistograms = 50;
static const double kLiteralBlockSwitchCost = 26;
static const double kLiteralBlockSwitchCost = 28.1;
static const double kCommandBlockSwitchCost = 13.5;
static const double kDistanceBlockSwitchCost = 14.6;
static const int kLiteralStrideLength = 70;

View File

@ -194,8 +194,9 @@ class HashLongestMatch {
bool match_found = false;
// Don't accept a short copy from far away.
double best_score = 8.115;
if (insert_length_ < 4) {
double cost_diff[4] = { 0.10, 0.04, 0.02, 0.01 };
if (insert_length_ < 8) {
double cost_diff[8] =
{ 0.1, 0.038, 0.019, 0.013, 0.001, 0.001, 0.001, 0.001 };
best_score += cost_diff[insert_length_];
}
size_t best_len = *best_len_out;