package core:compress/ppmd
⌘K
Ctrl+K
or
/
Overview
An implementation of the PPMd compression methods
Reads and writes raw PPMd var.H streams as stored in 7z (method 03 04 01), and raw PPMd var.I rev.1 streams as stored in zip (method 98). It is a port of Igor Pavlov's public domain code from the LZMA SDK and 7-Zip, and the encoder's output is byte-identical to 7-Zip's.
Index
Types (7)
Variables (0)
This section is empty.
Procedure Groups (2)
Types
Error ¶
Error :: compress.Error
Related Procedures With Returns
- compress_to_dynamic
- compress_to_slice
- decode_properties_7z
- decode_properties_zip
- decompress_from_bytes
- decompress_from_context
- encode_properties_7z
- encode_properties_zip
- compress (procedure groups)
- decompress (procedure groups)
General_Error ¶
General_Error :: compress.General_Error
Level ¶
Level :: enum i32 { Level_0 = 0, Level_1 = 1, Level_2 = 2, Level_3 = 3, Level_4 = 4, Level_5 = 5, Level_6 = 6, Level_7 = 7, Level_8 = 8, Level_9 = 9, Fastest = Level_0, Default = Level_5, Best = Level_9, }
PPMd_Error ¶
PPMd_Error :: compress.PPMd_Error
Properties ¶
Properties :: struct { variant: Variant, order: u8, mem_size: u32, restore: Restore_Method, }
Related Procedures With Parameters
- compress_to_dynamic
- compress_to_slice
- decompress_from_bytes
- decompress_from_context
- encode_properties_7z
- encode_properties_zip
- compress (procedure groups)
- decompress (procedure groups)
Related Procedures With Returns
Restore_Method ¶
Restore_Method :: enum u8 { Restart = 0, Cut_Off = 1, Freeze = 2, }
Constants
CUT_OFF_MEM_SIZE_MIN ¶
CUT_OFF_MEM_SIZE_MIN :: (1 + 256 / 2) * 12 * 4 / 3
H_ORDER_MAX ¶
H_ORDER_MAX :: 64
I_ORDER_MAX ¶
I_ORDER_MAX :: 16
MEMORY_MAX ¶
MEMORY_MAX :: int(#config(PPMD_MEMORY_MAX, MEM_SIZE_MAX))
MEM_SIZE_MAX ¶
MEM_SIZE_MAX :: 0xFFFF_FFFF - 12 * 3
MEM_SIZE_MIN ¶
MEM_SIZE_MIN :: 1 << 11
ORDER_MIN ¶
ORDER_MIN :: 2
PROPERTIES_7Z_SIZE ¶
PROPERTIES_7Z_SIZE :: 5
PROPERTIES_ZIP_SIZE ¶
PROPERTIES_ZIP_SIZE :: 2
ZIP_MEM_SIZE_MAX ¶
ZIP_MEM_SIZE_MAX :: 256 << 20
Variables
This section is empty.
Procedures
compress_to_dynamic ¶
compress_to_dynamic :: proc( output: ^[dynamic]u8, input: []u8, props: Properties, end_marker: bool = false, allocator := context.allocator, ) -> (err: compress.Error) {…}
compress_to_slice ¶
compress_to_slice :: proc( output, input: []u8, props: Properties, end_marker: bool = false, allocator := context.allocator, ) -> (written: int, err: compress.Error) {…}
decode_properties_7z ¶
decode_properties_7z :: proc "contextless" (data: []u8) -> (props: Properties, err: compress.Error) {…}
decode_properties_zip ¶
decode_properties_zip :: proc "contextless" (data: []u8) -> (props: Properties, err: compress.Error) {…}
decompress_from_bytes ¶
decompress_from_bytes :: proc( output: ^[dynamic]u8, input: []u8, props: Properties, expected_output_size: int = -1, max_output_size: int = compress.COMPRESS_OUTPUT_ALLOCATE_MAX, allocator := context.allocator, ) -> (err: compress.Error) {…}
decompress_from_context ¶
decompress_from_context :: proc( z: ^compress.Context, props: Properties, expected_output_size: int = -1, max_output_size: int = compress.COMPRESS_OUTPUT_ALLOCATE_MAX, allocator := context.allocator, ) -> (err: compress.Error) {…}
encode_properties_7z ¶
encode_properties_7z :: proc "contextless" (props: Properties) -> (data: [5]u8, err: compress.Error) {…}
encode_properties_zip ¶
encode_properties_zip :: proc "contextless" (props: Properties) -> (data: [2]u8, err: compress.Error) {…}
level_properties ¶
level_properties :: proc "contextless" ( variant: Variant, level: Level = Level.Default, input_size: int = -1, ) -> (props: Properties) {…}
Procedure Groups
compress ¶
compress :: proc{ compress_to_slice, compress_to_dynamic, }
decompress ¶
decompress :: proc{ decompress_from_bytes, decompress_from_context, }
Source Files
Generation Information
Generated with odin version dev-2026-11 (vendor "odin") Windows_amd64 @ 2026-11-10 03:07:04.374188700 +0000 UTC