From 0fc1a3a07297df907e6544becf96f5286fc13147 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 5 Feb 2013 19:42:23 +0100 Subject: [PATCH] speed-up lossless in BackwardTrace we special-case code=2 (with a later TODO to adapt this on quality) Change-Id: I93d43f5b3f8f1ef9f211cce253bb4b415918ee57 --- src/enc/backward_references.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/enc/backward_references.c b/src/enc/backward_references.c index 5723e7fc..821ccaf8 100644 --- a/src/enc/backward_references.c +++ b/src/enc/backward_references.c @@ -486,6 +486,7 @@ static int BackwardReferencesHashChainDistanceOnly( VP8LColorCache hashers; const double mul0 = (recursive_cost_model != 0) ? 1.0 : 0.68; const double mul1 = (recursive_cost_model != 0) ? 1.0 : 0.82; + const int min_distance_code = 2; // TODO(vikasa): tune as function of quality int window_size = WINDOW_SIZE; int iter_pos = 1; int iter_limit = -1; @@ -543,7 +544,7 @@ static int BackwardReferencesHashChainDistanceOnly( } // This if is for speedup only. It roughly doubles the speed, and // makes compression worse by .1 %. - if (len >= 128 && code < 2) { + if (len >= 128 && code <= min_distance_code) { // Long copy for short distances, let's skip the middle // lookups for better copies. // 1) insert the hashes.