Function init [src]

Prototype

pub fn init( allocator: Allocator, lzma_props: Properties, unpacked_size: ?u64, ) !DecoderState

Parameters

allocator: Allocatorlzma_props: Propertiesunpacked_size: ?u64

Source

pub fn init( allocator: Allocator, lzma_props: Properties, unpacked_size: ?u64, ) !DecoderState { return .{ .lzma_props = lzma_props, .unpacked_size = unpacked_size, .literal_probs = try Vec2D(u16).init(allocator, 0x400, .{ @as(usize, 1) << (lzma_props.lc + lzma_props.lp), 0x300 }), .pos_slot_decoder = @splat(.{}), .align_decoder = .{}, .pos_decoders = @splat(0x400), .is_match = @splat(0x400), .is_rep = @splat(0x400), .is_rep_g0 = @splat(0x400), .is_rep_g1 = @splat(0x400), .is_rep_g2 = @splat(0x400), .is_rep_0long = @splat(0x400), .state = 0, .rep = @splat(0), .len_decoder = .{}, .rep_len_decoder = .{}, }; }