package core:compress/filters

⌘K
Ctrl+K
or
/

    Overview

    Reversible filters that make executables and some other data compress better

    Branch converters (BCJ) for x86, PowerPC, IA-64, ARM, ARM Thumb, SPARC, ARM64 and RISC-V, Delta, and Swap2/Swap4, as used by xz (and so zip method 95) and 7z, plus 7z's four-stream BCJ2. Each filter is a transform only: mapping xz filter IDs and 7z method IDs onto them is up to those containers. It is a port of Igor Pavlov's public domain LZMA SDK, and the output is byte-identical to the SDK's.

    Types

    Bcj2_Streams ¶

    Bcj2_Streams :: struct {
    	main: [dynamic]u8,
    	call: [dynamic]u8,
    	jump: [dynamic]u8,
    	rc:   [dynamic]u8,
    }

    Branch_Arch ¶

    Branch_Arch :: enum u8 {
    	X86, 
    	PowerPC, 
    	IA64, 
    	ARM, 
    	ARM_Thumb, 
    	SPARC, 
    	ARM64, 
    	RISCV, 
    }

    Branch_State ¶

    Branch_State :: struct {
    	arch:     Branch_Arch,
    	pc:       u32,
    	x86_mask: u32,
    }

    Related Procedures With Parameters

    Delta_State ¶

    Delta_State :: struct {
    	distance: int,
    	history:  [256]u8,
    }

    Related Procedures With Parameters

    Error ¶

    Error :: compress.Error

    Related Procedures With Returns

    Constants

    BCJ2_RELAT_LIMIT_DEFAULT ¶

    BCJ2_RELAT_LIMIT_DEFAULT :: u32(0x0F) << 24

    BCJ2_RELAT_LIMIT_MAX ¶

    BCJ2_RELAT_LIMIT_MAX :: u32(1) << 31

    Variables

    Procedures

    bcj2_decode_to_dynamic ¶

    bcj2_decode_to_dynamic :: proc(
    	output:               ^[dynamic]u8, 
    	main, call, jump, rc: []u8, 
    	allocator := context.allocator, 
    ) -> (err: compress.Error) {…}

    bcj2_decode_to_slice ¶

    bcj2_decode_to_slice :: proc(
    	output:               []u8, 
    	main, call, jump, rc: []u8, 
    ) -> (err: compress.Error) {…}

    bcj2_encode ¶

    bcj2_encode :: proc(
    	streams:     ^Bcj2_Streams, 
    	input:       []u8, 
    	relat_limit: u32 = BCJ2_RELAT_LIMIT_DEFAULT, 
    	file_size:   i64 = i64(-1), 
    	allocator := context.allocator, 
    ) -> (err: compress.Error) {…}

    branch_decode ¶

    branch_decode :: proc "contextless" (state: ^Branch_State, data: []u8) -> (processed: int) {…}

    branch_encode ¶

    branch_encode :: proc "contextless" (state: ^Branch_State, data: []u8) -> (processed: int) {…}

    branch_init ¶

    branch_init :: proc "contextless" (
    	state:        ^Branch_State, 
    	arch:         Branch_Arch, 
    	start_offset: u32 = 0, 
    ) -> bool {…}

    delta_decode ¶

    delta_decode :: proc "contextless" (state: ^Delta_State, data: []u8) {…}

    delta_encode ¶

    delta_encode :: proc "contextless" (state: ^Delta_State, data: []u8) {…}

    delta_init ¶

    delta_init :: proc "contextless" (state: ^Delta_State, distance: int) -> bool {…}

    swap2 ¶

    swap2 :: proc "contextless" (data: []u8) -> (processed: int) {…}

    swap4 ¶

    swap4 :: proc "contextless" (data: []u8) -> (processed: int) {…}

    Procedure Groups

    Source Files

    Generation Information

    Generated with odin version dev-2026-11 (vendor "odin") Windows_amd64 @ 2026-11-10 03:07:04.374188700 +0000 UTC