pub(crate) const ZSTD_FRAME_MAGIC_LE: u32 = 0xFD2F_B528;
pub(crate) const ZSTD_SKIPPABLE_MAGIC_MIN: u32 = 0x184D_2A50;
pub(crate) const ZSTD_SKIPPABLE_MAGIC_MAX: u32 = 0x184D_2A5F;
pub(crate) const ZSTD_MAX_BLOCK_SIZE: usize = 128 * 1024;
pub(crate) const ZSTD_MAX_WINDOW_SIZE: usize = 128 * 1024 * 1024;
pub(crate) const ZSTD_MAX_OUTPUT_SIZE: usize = 512 * 1024 * 1024;
pub(crate) const ZSTD_HUFFMAN_MAX_BITS: u8 = 11;
pub(crate) const ZSTD_HUFFMAN_MAX_SYMBOLS: usize = 256;
pub(crate) const ZSTD_FSE_MAX_LOG_HUFFMAN: u8 = 6;
pub(crate) const ZSTD_FSE_MAX_LOG_LL: u8 = 9;
pub(crate) const ZSTD_FSE_MAX_LOG_ML: u8 = 9;
pub(crate) const ZSTD_FSE_MAX_LOG_OF: u8 = 8;
pub(crate) const ZSTD_PREDEF_LL_LOG: u8 = 6;
pub(crate) const ZSTD_PREDEF_LL_DIST: [i16; 36] = [
4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 1, 1, 1, 1, 1,
-1, -1, -1, -1,
];
pub(crate) const ZSTD_PREDEF_ML_LOG: u8 = 6;
pub(crate) const ZSTD_PREDEF_ML_DIST: [i16; 53] = [
1, 4, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1,
];
pub(crate) const ZSTD_PREDEF_OF_LOG: u8 = 5;
pub(crate) const ZSTD_PREDEF_OF_DIST: [i16; 29] = [
1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1,
];
pub(crate) const ZSTD_LL_BASELINES: [u32; 36] = [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 22, 24, 28, 32, 40, 48, 64,
128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536,
];
pub(crate) const ZSTD_LL_EXTRA_BITS: [u8; 36] = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16,
];
pub(crate) const ZSTD_ML_BASELINES: [u32; 53] = [
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41, 43, 47, 51, 59, 67, 83, 99, 131, 259, 515, 1027,
2051, 4099, 8195, 16387, 32771, 65539,
];
pub(crate) const ZSTD_ML_EXTRA_BITS: [u8; 53] = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
];
pub(crate) const ZSTD_INITIAL_REPEAT_OFFSETS: [usize; 3] = [1, 4, 8];
pub(crate) const ERR_BLEND_ZSTD_BAD_MAGIC: &str = "blend: invalid zstd frame magic signature";
pub(crate) const ERR_BLEND_ZSTD_TRUNCATED: &str = "blend: truncated zstd stream";
pub(crate) const ERR_BLEND_ZSTD_HEADER: &str = "blend: malformed or unsupported zstd frame header";
pub(crate) const ERR_BLEND_ZSTD_BLOCK: &str = "blend: invalid zstd block header or size";
pub(crate) const ERR_BLEND_ZSTD_HUFFMAN: &str = "blend: malformed zstd huffman literals section";
pub(crate) const ERR_BLEND_ZSTD_FSE: &str = "blend: malformed zstd fse table or sequence section";
pub(crate) const ERR_BLEND_ZSTD_SEQUENCE: &str = "blend: invalid zstd sequence offset or length";
pub(crate) const ERR_BLEND_ZSTD_SIZE: &str = "blend: zstd output size mismatch or limit exceeded";