Nick Terrell | 4aaa36f | 2018-11-20 12:37:43 -0800 | [diff] [blame] | 1 | /* |
Elliott Hughes | 44aba64 | 2023-09-12 20:18:59 +0000 | [diff] [blame] | 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
Nick Terrell | 4aaa36f | 2018-11-20 12:37:43 -0800 | [diff] [blame] | 3 | * All rights reserved. |
| 4 | * |
| 5 | * This source code is licensed under both the BSD-style license (found in the |
| 6 | * LICENSE file in the root directory of this source tree) and the GPLv2 (found |
| 7 | * in the COPYING file in the root directory of this source tree). |
| 8 | * You may select, at your option, one of the above-listed licenses. |
| 9 | */ |
| 10 | |
| 11 | #ifndef LEVEL |
| 12 | # error LEVEL(x) must be defined |
| 13 | #endif |
| 14 | #ifndef FAST_LEVEL |
| 15 | # error FAST_LEVEL(x) must be defined |
| 16 | #endif |
Sen Huang | 4d63d6e | 2021-04-02 08:07:10 -0700 | [diff] [blame] | 17 | #ifndef ROW_LEVEL |
| 18 | # error ROW_LEVEL(x, y) must be defined |
| 19 | #endif |
Nick Terrell | 4aaa36f | 2018-11-20 12:37:43 -0800 | [diff] [blame] | 20 | |
| 21 | /** |
| 22 | * The levels are chosen to trigger every strategy in every source size, |
| 23 | * as well as some fast levels and the default level. |
| 24 | * If you change the compression levels, you should probably update these. |
| 25 | */ |
| 26 | |
| 27 | FAST_LEVEL(5) |
| 28 | |
| 29 | FAST_LEVEL(3) |
| 30 | |
| 31 | FAST_LEVEL(1) |
| 32 | LEVEL(0) |
| 33 | LEVEL(1) |
| 34 | |
| 35 | LEVEL(3) |
| 36 | LEVEL(4) |
Sen Huang | 4d63d6e | 2021-04-02 08:07:10 -0700 | [diff] [blame] | 37 | /* ROW_LEVEL triggers the row hash (force enabled and disabled) with different |
senhuang42 | e411040 | 2021-06-03 10:54:31 +0300 | [diff] [blame] | 38 | * dictionary strategies, and 16/32/64 row entries based on the level/searchLog. |
senhuang42 | b5c35d7 | 2021-09-20 09:04:07 -0400 | [diff] [blame] | 39 | * 1 == enabled, 2 == disabled. |
Sen Huang | 4d63d6e | 2021-04-02 08:07:10 -0700 | [diff] [blame] | 40 | */ |
| 41 | ROW_LEVEL(5, 1) |
senhuang42 | e411040 | 2021-06-03 10:54:31 +0300 | [diff] [blame] | 42 | ROW_LEVEL(5, 2) /* 16-entry rows */ |
Nick Terrell | 4aaa36f | 2018-11-20 12:37:43 -0800 | [diff] [blame] | 43 | LEVEL(5) |
| 44 | LEVEL(6) |
Sen Huang | 4d63d6e | 2021-04-02 08:07:10 -0700 | [diff] [blame] | 45 | ROW_LEVEL(7, 1) |
senhuang42 | e411040 | 2021-06-03 10:54:31 +0300 | [diff] [blame] | 46 | ROW_LEVEL(7, 2) /* 16-entry rows */ |
Nick Terrell | 4aaa36f | 2018-11-20 12:37:43 -0800 | [diff] [blame] | 47 | LEVEL(7) |
| 48 | |
| 49 | LEVEL(9) |
| 50 | |
senhuang42 | e411040 | 2021-06-03 10:54:31 +0300 | [diff] [blame] | 51 | ROW_LEVEL(11, 1) |
| 52 | ROW_LEVEL(11, 2) /* 32-entry rows */ |
Sen Huang | 4d63d6e | 2021-04-02 08:07:10 -0700 | [diff] [blame] | 53 | ROW_LEVEL(12, 1) |
senhuang42 | e411040 | 2021-06-03 10:54:31 +0300 | [diff] [blame] | 54 | ROW_LEVEL(12, 2) /* 64-entry rows */ |
Nick Terrell | 4aaa36f | 2018-11-20 12:37:43 -0800 | [diff] [blame] | 55 | LEVEL(13) |
| 56 | |
| 57 | LEVEL(16) |
| 58 | |
| 59 | LEVEL(19) |