2014-03-20 13:32:35 +00:00
|
|
|
// Copyright 2013 Google Inc. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
// Class to model the static dictionary.
|
|
|
|
|
|
|
|
#ifndef BROTLI_ENC_STATIC_DICT_H_
|
|
|
|
#define BROTLI_ENC_STATIC_DICT_H_
|
|
|
|
|
2015-10-01 10:08:14 +00:00
|
|
|
#include "./types.h"
|
2015-04-01 14:29:04 +00:00
|
|
|
|
2014-03-20 13:32:35 +00:00
|
|
|
namespace brotli {
|
|
|
|
|
2015-06-12 14:45:17 +00:00
|
|
|
static const int kMaxDictionaryMatchLen = 37;
|
|
|
|
static const int kInvalidMatch = 0xfffffff;
|
|
|
|
|
|
|
|
// Matches data against static dictionary words, and for each length l,
|
|
|
|
// for which a match is found, updates matches[l] to be the minimum possible
|
|
|
|
// (distance << 5) + len_code.
|
|
|
|
// Prerequisites:
|
|
|
|
// matches array is at least kMaxDictionaryMatchLen + 1 long
|
|
|
|
// all elements are initialized to kInvalidMatch
|
|
|
|
bool FindAllStaticDictionaryMatches(const uint8_t* data,
|
|
|
|
int min_length,
|
2015-08-10 11:13:58 +00:00
|
|
|
int max_length,
|
2015-06-12 14:45:17 +00:00
|
|
|
int* matches);
|
2014-03-20 13:32:35 +00:00
|
|
|
|
|
|
|
} // namespace brotli
|
|
|
|
|
|
|
|
#endif // BROTLI_ENC_STATIC_DICT_H_
|