Zoltan Szabadka | c66e4e3 | 2013-10-23 13:06:13 +0200 | [diff] [blame^] | 1 | // Copyright 2013 Google Inc. All Rights Reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | // |
| 15 | // This class models a sequence of literals and a backward reference copy. |
| 16 | |
| 17 | #ifndef BROTLI_ENC_COMMAND_H_ |
| 18 | #define BROTLI_ENC_COMMAND_H_ |
| 19 | |
| 20 | #include <stdint.h> |
| 21 | |
| 22 | namespace brotli { |
| 23 | |
| 24 | // Command holds a sequence of literals and a backward reference copy. |
| 25 | class Command { |
| 26 | public: |
| 27 | Command() : insert_length_(0), copy_length_(0), |
| 28 | copy_distance_(0), distance_code_(0), |
| 29 | distance_prefix_(0), command_prefix_(0), |
| 30 | distance_extra_bits_(0), distance_extra_bits_value_(0) {} |
| 31 | |
| 32 | uint32_t insert_length_; |
| 33 | uint32_t copy_length_; |
| 34 | uint32_t copy_distance_; |
| 35 | // Values <= 16 are short codes, values > 16 are distances shifted by 16. |
| 36 | uint32_t distance_code_; |
| 37 | uint16_t distance_prefix_; |
| 38 | uint16_t command_prefix_; |
| 39 | int distance_extra_bits_; |
| 40 | uint32_t distance_extra_bits_value_; |
| 41 | }; |
| 42 | |
| 43 | } // namespace brotli |
| 44 | |
| 45 | #endif // BROTLI_ENC_COMMAND_H_ |