| 1 | mod decoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/decoder/; |
| 2 | mod encoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/encoder/; |
| 3 | mod range_codingrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/; |
| 4 | |
| 5 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::{ |
| 6 | allocrust-analyzer cargo std https://github.com/rust-lang/rust/library/std alloc/::{alloc_zeroedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc alloc/alloc_zeroed()., deallocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc alloc/dealloc()., Layoutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core alloc/layout/Layout#}, |
| 7 | iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::{Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#, Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#}, |
| 8 | memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::ManuallyDroprust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/manually_drop/ManuallyDrop#, |
| 9 | ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#, |
| 10 | }; |
| 11 | |
| 12 | pub(craterust-analyzer cargo ppmd-rust 1.2.1 crate/) use range_codingrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/::{RangeDecoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeDecoder#, RangeEncoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeEncoder#}; |
| 13 | |
| 14 | use superrust-analyzer cargo ppmd-rust 1.2.1 internal/::*; |
| 15 | use craterust-analyzer cargo ppmd-rust 1.2.1 crate/::Errorrust-analyzer cargo ppmd-rust 1.2.1 Error#; |
| 16 | |
| 17 | const MAX_FREQrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/MAX_FREQ.: u8 = 124; |
| 18 | const UNIT_SIZErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/UNIT_SIZE.: isize = 12; |
| 19 | const K_TOP_VALUErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/K_TOP_VALUE.: u32 = 1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<i32>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<i32>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<i32>`]shl().24; |
| 20 | const EMPTY_NODErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/EMPTY_NODE.: u16 = 0; |
| 21 | |
| 22 | static K_EXP_ESCAPErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/K_EXP_ESCAPE.: [u8; 16] = [25, 14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2]; |
| 23 | |
| 24 | static K_INIT_BIN_ESCrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/K_INIT_BIN_ESC.: [u16; 8] = [ |
| 25 | 0x3CDD, 0x1F3F, 0x59BF, 0x48F3, 0x64A1, 0x5ABC, 0x6632, 0x6051, |
| 26 | ]; |
| 27 | |
| 28 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 29 | #[repr(C)] |
| 30 | struct Noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node# { |
| 31 | stamprust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#stamp.: u16, |
| 32 | nurust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#nu.: u16, |
| 33 | nextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#next.: TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#, |
| 34 | prevrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#prev.: TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#, |
| 35 | } |
| 36 | |
| 37 | impl Pointeerust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/Pointee# for Noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node# { |
| 38 | const TAGrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[Node][Pointee]TAG.: u32 = TAG_NODErust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TAG_NODE.; |
| 39 | } |
| 40 | |
| 41 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 42 | #[repr(C)] |
| 43 | union NodeUnionrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion# { |
| 44 | noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion#node.: Noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#, |
| 45 | next_refrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion#next_ref.: TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#, |
| 46 | } |
| 47 | |
| 48 | impl Pointeerust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/Pointee# for NodeUnionrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion# { |
| 49 | const TAGrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[NodeUnion][Pointee]TAG.: u32 = TAG_NODErust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TAG_NODE.; |
| 50 | } |
| 51 | |
| 52 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 53 | #[repr(C)] |
| 54 | struct Contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context# { |
| 55 | num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats.: u16, |
| 56 | union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2.: Union2rust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#, |
| 57 | union4rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union4.: Union4rust-analyzer cargo ppmd-rust 1.2.1 internal/Union4#, |
| 58 | suffixrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#suffix.: TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#, |
| 59 | } |
| 60 | |
| 61 | impl Pointeerust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/Pointee# for Contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context# { |
| 62 | const TAGrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[Context][Pointee]TAG.: u32 = TAG_CONTEXTrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TAG_CONTEXT.; |
| 63 | } |
| 64 | |
| 65 | pub(craterust-analyzer cargo ppmd-rust 1.2.1 crate/) struct PPMd7rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#<RC> { |
| 66 | min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#>, |
| 67 | max_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_context.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#>, |
| 68 | found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Staterust-analyzer cargo ppmd-rust 1.2.1 internal/State#>, |
| 69 | order_fallrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#order_fall.: u32, |
| 70 | init_escrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#init_esc.: u32, |
| 71 | prev_successrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#prev_success.: u32, |
| 72 | max_orderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_order.: u32, |
| 73 | hi_bits_flagrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_bits_flag.: u32, |
| 74 | run_lengthrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#run_length.: i32, |
| 75 | init_rlrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#init_rl.: i32, |
| 76 | sizerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#size.: u32, |
| 77 | glue_countrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#glue_count.: u32, |
| 78 | align_offsetrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#align_offset.: u32, |
| 79 | lo_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#lo_unit.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<u8>, |
| 80 | hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<u8>, |
| 81 | textrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#text.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<u8>, |
| 82 | units_startrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units_start.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<u8>, |
| 83 | index2unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#index2units.: [u8; 40], |
| 84 | units2indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units2index.: [u8; 128], |
| 85 | free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.: [TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#; 38], |
| 86 | ns2bs_indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#ns2bs_index.: [u8; 256], |
| 87 | ns2indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#ns2index.: [u8; 256], |
| 88 | exp_escaperust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#exp_escape.: [u8; 16], |
| 89 | dummy_seerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#dummy_see.: Seerust-analyzer cargo ppmd-rust 1.2.1 internal/See#, |
| 90 | seerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#see.: [[Seerust-analyzer cargo ppmd-rust 1.2.1 internal/See#; 16]; 25], |
| 91 | bin_summrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#bin_summ.: [[u16; 64]; 128], |
| 92 | memory_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#memory_ptr.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<u8>, |
| 93 | memory_layoutrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#memory_layout.: Layoutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core alloc/layout/Layout#, |
| 94 | rcrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#rc.: RC, |
| 95 | } |
| 96 | |
| 97 | impl<RC> Droprust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/drop/Drop# for PPMd7rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#<RC> { |
| 98 | fn droprust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`][Drop]drop().(&mut self) { |
| 99 | unsafe { |
| 100 | deallocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc alloc/dealloc().(self.memory_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#memory_ptr..as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().(), self.memory_layoutrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#memory_layout.); |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | impl<RC> MemoryAllocatorrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/MemoryAllocator# for PPMd7rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#<RC> { |
| 106 | fn base_memory_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`][MemoryAllocator]base_memory_ptr().(&self) -> NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<u8> { |
| 107 | self.memory_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#memory_ptr. |
| 108 | } |
| 109 | |
| 110 | #[cfg(not(feature = "unstable-tagged-offsets"))] |
| 111 | fn units_start(&self) -> NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<u8> { |
| 112 | selfrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/.units_start |
| 113 | } |
| 114 | |
| 115 | #[cfg(feature = "unstable-tagged-offsets")] |
| 116 | fn sizerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`][MemoryAllocator]size().(&self) -> u32 { |
| 117 | self.sizerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#size. |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | impl<RC> PPMd7rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#<RC> { |
| 122 | fn constructrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]construct().(rc: RC, order: u32, mem_size: u32) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`], Errorrust-analyzer cargo ppmd-rust 1.2.1 Error#> { |
| 123 | let mut units2index = [0u8; 128]; |
| 124 | let mut index2units = [0u8; 40]; |
| 125 | |
| 126 | let mut k = 0; |
| 127 | for i in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#PPMD_NUM_INDEXESrust-analyzer cargo ppmd-rust 1.2.1 internal/PPMD_NUM_INDEXES. { |
| 128 | let step: u32 = if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().12 { 4 } else { (i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().2) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().1 }; |
| 129 | for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#step { |
| 130 | units2index[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().k as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). = i as u8; |
| 131 | k rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().1; |
| 132 | } |
| 133 | index2units[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().i as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). = k as u8; |
| 134 | } |
| 135 | |
| 136 | let mut ns2bs_index = [0u8; 256]; |
| 137 | ns2bs_index[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). = (0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl().1) as u8; |
| 138 | ns2bs_index[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). = (1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl().1) as u8; |
| 139 | ns2bs_index[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().2..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#11]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut()..fillrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]fill().((2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl().1) as u8); |
| 140 | ns2bs_index[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().11..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#256]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut()..fillrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]fill().((3 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl().1) as u8); |
| 141 | |
| 142 | let mut ns2index = [0u8; 256]; |
| 143 | for i in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#3 { |
| 144 | ns2index[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().i as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). = i as u8; |
| 145 | } |
| 146 | |
| 147 | let mut m = 3; |
| 148 | let mut k = 1; |
| 149 | for i in 3..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#256 { |
| 150 | ns2index[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().i as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). = m as u8; |
| 151 | k rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign().1; |
| 152 | if k rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().0 { |
| 153 | m rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().1; |
| 154 | k = m rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().2; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | let align_offset = (4u32.wrapping_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]wrapping_sub().(mem_size)) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().3; |
| 159 | let total_size = (align_offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().mem_size) as usize; |
| 160 | |
| 161 | let memory_layout = Layoutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core alloc/layout/Layout#::from_size_alignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core alloc/layout/impl#[Layout]from_size_align().(total_size, align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of().::<usize>()) |
| 162 | .expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Failed to create memory layout"); |
| 163 | |
| 164 | let allocation = unsafe { |
| 165 | assert_nerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_ne!!(total_size, 0); |
| 166 | NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]new().(alloc_zeroedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc alloc/alloc_zeroed().(memory_layout)) |
| 167 | }; |
| 168 | |
| 169 | let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(memory_ptr) = allocation else { |
| 170 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo ppmd-rust 1.2.1 Error#::MemoryAllocationrust-analyzer cargo ppmd-rust 1.2.1 Error#MemoryAllocation#); |
| 171 | }; |
| 172 | |
| 173 | let mut ppmd = Selfrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`] { |
| 174 | min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#::danglingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]dangling().(), |
| 175 | max_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_context.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#::danglingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]dangling().(), |
| 176 | found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#::danglingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]dangling().(), |
| 177 | order_fallrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#order_fall.: 0, |
| 178 | init_escrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#init_esc.: 0, |
| 179 | prev_successrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#prev_success.: 0, |
| 180 | max_orderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_order.: order, |
| 181 | hi_bits_flagrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_bits_flag.: 0, |
| 182 | run_lengthrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#run_length.: 0, |
| 183 | init_rlrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#init_rl.: 0, |
| 184 | sizerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#size.: mem_size, |
| 185 | glue_countrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#glue_count.: 0, |
| 186 | align_offsetrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#align_offset., |
| 187 | lo_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#lo_unit.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#::danglingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]dangling().(), |
| 188 | hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#::danglingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]dangling().(), |
| 189 | textrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#text.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#::danglingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]dangling().(), |
| 190 | units_startrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units_start.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#::danglingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]dangling().(), |
| 191 | units2indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units2index., |
| 192 | index2unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#index2units., |
| 193 | ns2bs_indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#ns2bs_index., |
| 194 | ns2indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#ns2index., |
| 195 | exp_escaperust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#exp_escape.: K_EXP_ESCAPErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/K_EXP_ESCAPE., |
| 196 | dummy_seerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#dummy_see.: Seerust-analyzer cargo ppmd-rust 1.2.1 internal/See#::defaultrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[See][Default]default().(), |
| 197 | seerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#see.: [[Seerust-analyzer cargo ppmd-rust 1.2.1 internal/See#::defaultrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[See][Default]default().(); 16]; 25], |
| 198 | free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.: [TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#::nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]null().(); PPMD_NUM_INDEXESrust-analyzer cargo ppmd-rust 1.2.1 internal/PPMD_NUM_INDEXES. as usize], |
| 199 | bin_summrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#bin_summ.: [[0; 64]; 128], |
| 200 | memory_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#memory_ptr., |
| 201 | memory_layoutrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#memory_layout., |
| 202 | rcrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#rc., |
| 203 | }; |
| 204 | |
| 205 | unsafe { ppmd.restart_modelrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]restart_model().() }; |
| 206 | |
| 207 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(ppmd) |
| 208 | } |
| 209 | |
| 210 | unsafe fn offset_for_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]offset_for_ptr().<T: Pointeerust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/Pointee#>(&self, ptr: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<T>) -> TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset# { |
| 211 | unsafe { TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#::from_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]from_ptr().(self, ptr) } |
| 212 | } |
| 213 | |
| 214 | unsafe fn insert_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]insert_node().(&mut self, node: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#>, indx: u32) { |
| 215 | let mut node_union_ptr = node.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().::<NodeUnionrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion#>(); |
| 216 | node_union_ptr.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().next_refrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion#next_ref. = self.free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().indx as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().; |
| 217 | self.free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().indx as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). = self.offset_for_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]offset_for_ptr().(node); |
| 218 | } |
| 219 | |
| 220 | unsafe fn remove_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]remove_node().(&mut self, indx: u32) -> NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<u8> { |
| 221 | let offset = self.free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().indx as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().; |
| 222 | let node_ptr = offset.as_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]as_ptr().::<Noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#, _>(self); |
| 223 | self.free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().indx as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). = node_ptr.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().::<NodeUnionrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion#>().as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().next_refrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion#next_ref.; |
| 224 | node_ptr.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().() |
| 225 | } |
| 226 | |
| 227 | unsafe fn split_blockrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]split_block().(&mut self, mut ptr: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<u8>, old_index: u32, new_index: u32) { |
| 228 | unsafe { |
| 229 | let nu = (self.index2unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#index2units.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().old_index as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32) |
| 230 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().(self.index2unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#index2units.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().new_index as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32); |
| 231 | ptr = ptr.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(self.index2unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#index2units.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().new_index as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as isize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul().UNIT_SIZErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/UNIT_SIZE.); |
| 232 | let mut i = self.units2indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units2index.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().(nu as usize) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32; |
| 233 | |
| 234 | if self.index2unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#index2units.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().i as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().nu { |
| 235 | i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().1; |
| 236 | let k = self.index2unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#index2units.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().i as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32; |
| 237 | self.insert_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]insert_node().(ptr.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(k as isize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul().UNIT_SIZErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/UNIT_SIZE.).castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().(), nu rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().k rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().1); |
| 238 | } |
| 239 | |
| 240 | self.insert_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]insert_node().(ptr.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().(), i); |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | /// We use the first u16 field of the 12-bytes as record type stamp. |
| 245 | /// State { symbol: u8, freq: u8, .. : freq != 0 |
| 246 | /// Context { num_stats: u16, .. : num_stats != 0 |
| 247 | /// Node { stamp: u16 : stamp == 0 for free record |
| 248 | /// : stamp == 1 for head record and guard |
| 249 | /// Last 12-bytes record in array is always containing the 12-bytes order-0 Context |
| 250 | /// record. |
| 251 | unsafe fn glue_free_blocksrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]glue_free_blocks().(&mut self) { |
| 252 | unsafe { |
| 253 | let mut n = TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#::nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]null().(); |
| 254 | self.glue_countrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#glue_count. = 255; |
| 255 | |
| 256 | // We set guard node at lo_unit. |
| 257 | if self.lo_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#lo_unit. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().self.hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit. { |
| 258 | self.lo_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#lo_unit..castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().::<Noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#>().as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().stamprust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#stamp. = 1; |
| 259 | } |
| 260 | |
| 261 | // Create list of free blocks. We still need one additional list walk pass before glue. |
| 262 | let mut i = 0; |
| 263 | while i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().PPMD_NUM_INDEXESrust-analyzer cargo ppmd-rust 1.2.1 internal/PPMD_NUM_INDEXES. { |
| 264 | let nu = self.index2unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#index2units.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().i as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u16; |
| 265 | let mut next = self.free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().i as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().; |
| 266 | self.free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().i as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). = TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#::nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]null().(); |
| 267 | while next.is_not_nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]is_not_null().() { |
| 268 | let node_ptr = next.as_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]as_ptr().::<Noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#, _>(self); |
| 269 | let un = node_ptr.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().::<NodeUnionrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion#>().as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().(); |
| 270 | let tmp = next; |
| 271 | next = un.next_refrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion#next_ref.; |
| 272 | un.noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion#node..stamprust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#stamp. = EMPTY_NODErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/EMPTY_NODE.; |
| 273 | un.noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion#node..nurust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#nu. = nu; |
| 274 | un.noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/NodeUnion#node..nextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#next. = n; |
| 275 | n = tmp; |
| 276 | } |
| 277 | i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().1; |
| 278 | } |
| 279 | |
| 280 | let mut head = n; |
| 281 | |
| 282 | // Glue and fill must walk the list in same direction. |
| 283 | self.glue_blocksrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]glue_blocks().(n, &mut head); |
| 284 | self.fill_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]fill_list().(head); |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | /// Glue free blocks. |
| 289 | unsafe fn glue_blocksrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]glue_blocks().(&mut self, mut n: TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#, head: *mut TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#) { |
| 290 | unsafe { |
| 291 | let mut prev = head; |
| 292 | while n.is_not_nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]is_not_null().() { |
| 293 | let mut node = n.as_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]as_ptr().::<Noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#, _>(self); |
| 294 | let mut nu = node.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().nurust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#nu. as u32; |
| 295 | n = node.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().nextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#next.; |
| 296 | if nu rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().0 { |
| 297 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().prev = n; |
| 298 | } else { |
| 299 | prev = &raw mut node.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().nextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#next.; |
| 300 | loop { |
| 301 | let node2 = node.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(nu as isize).as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().(); |
| 302 | nu rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().node2.nurust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#nu. as u32; |
| 303 | if node2.stamprust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#stamp. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().EMPTY_NODErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/EMPTY_NODE. || nu rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().0x10000 { |
| 304 | break; |
| 305 | } |
| 306 | (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().node.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().()).nurust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#nu. = nu as u16; |
| 307 | node2.nurust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#nu. = 0; |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | /// Fill lists of free blocks. |
| 315 | unsafe fn fill_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]fill_list().(&mut self, head: TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#) { |
| 316 | unsafe { |
| 317 | let mut n = head; |
| 318 | while n.is_not_nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]is_not_null().() { |
| 319 | let mut node = n.as_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]as_ptr().::<Noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#, _>(self); |
| 320 | let mut nu = node.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().nurust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#nu. as u32; |
| 321 | |
| 322 | n = node.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().nextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Node#next.; |
| 323 | if nu rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().0 { |
| 324 | continue; |
| 325 | } |
| 326 | while nu rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().128 { |
| 327 | self.insert_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]insert_node().(node, PPMD_NUM_INDEXESrust-analyzer cargo ppmd-rust 1.2.1 internal/PPMD_NUM_INDEXES. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().1); |
| 328 | nu rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().128; |
| 329 | node = node.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(128); |
| 330 | } |
| 331 | |
| 332 | let mut index = self.units2indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units2index.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().(nu as usize) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32; |
| 333 | if self.index2unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#index2units.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().index as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().nu { |
| 334 | index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().1; |
| 335 | let k = self.index2unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#index2units.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().index as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32; |
| 336 | self.insert_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]insert_node().(node.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(k as isize).castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().(), nu rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().k rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().1); |
| 337 | } |
| 338 | self.insert_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]insert_node().(node, index); |
| 339 | } |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | #[inline(never)] |
| 344 | unsafe fn alloc_units_rarerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]alloc_units_rare().(&mut self, index: u32) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<u8>> { |
| 345 | unsafe { |
| 346 | if self.glue_countrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#glue_count. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().0 { |
| 347 | self.glue_free_blocksrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]glue_free_blocks().(); |
| 348 | if self.free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().index as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()..is_not_nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]is_not_null().() { |
| 349 | return Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.remove_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]remove_node().(index)); |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | let mut i = index; |
| 354 | |
| 355 | loop { |
| 356 | i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().1; |
| 357 | if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().PPMD_NUM_INDEXESrust-analyzer cargo ppmd-rust 1.2.1 internal/PPMD_NUM_INDEXES. { |
| 358 | let num_bytes = self.index2unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#index2units.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().index as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().UNIT_SIZErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/UNIT_SIZE. as u32; |
| 359 | let us = self.units_startrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units_start.; |
| 360 | self.glue_countrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#glue_count. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().1; |
| 361 | return if us.offset_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset_from().(self.textrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#text.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[isize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[isize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[isize][`PartialOrd<Self>`]gt().num_bytes as isize { |
| 362 | self.units_startrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units_start. = us.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().(num_bytes as isize)); |
| 363 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.units_startrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units_start.) |
| 364 | } else { |
| 365 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 366 | }; |
| 367 | } |
| 368 | if self.free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().i as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()..is_not_nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]is_not_null().() { |
| 369 | break; |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | let block = self.remove_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]remove_node().(i); |
| 374 | self.split_blockrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]split_block().(block, i, index); |
| 375 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(block) |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | unsafe fn alloc_unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]alloc_units().(&mut self, index: u32) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<u8>> { |
| 380 | unsafe { |
| 381 | if self.free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().index as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()..is_not_nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]is_not_null().() { |
| 382 | return Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.remove_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]remove_node().(index)); |
| 383 | } |
| 384 | let num_bytes = self.index2unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#index2units.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().index as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().UNIT_SIZErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/UNIT_SIZE. as u32; |
| 385 | let lo = self.lo_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#lo_unit.; |
| 386 | if self.hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit..offset_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset_from().(lo) as u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().num_bytes { |
| 387 | self.lo_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#lo_unit. = lo.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(num_bytes as isize); |
| 388 | return Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(lo); |
| 389 | } |
| 390 | |
| 391 | self.alloc_units_rarerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]alloc_units_rare().(index) |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | #[inline(never)] |
| 396 | unsafe fn restart_modelrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]restart_model().(&mut self) { |
| 397 | unsafe { |
| 398 | self.free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list. = [TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#::nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]null().(); 38]; |
| 399 | |
| 400 | self.textrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#text. = self.memory_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#memory_ptr..offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(self.align_offsetrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#align_offset. as isize); |
| 401 | self.hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit. = self.textrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#text..offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(self.sizerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#size. as isize); |
| 402 | self.units_startrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units_start. = self |
| 403 | .hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit. |
| 404 | .offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().(self.sizerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#size. as isize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Div<Self>`]div().8 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Div<Self>`]div().UNIT_SIZErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/UNIT_SIZE. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul().7 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul().UNIT_SIZErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/UNIT_SIZE.)); |
| 405 | self.lo_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#lo_unit. = self.units_startrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units_start.; |
| 406 | self.glue_countrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#glue_count. = 0; |
| 407 | |
| 408 | self.order_fallrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#order_fall. = self.max_orderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_order.; |
| 409 | self.init_rlrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#init_rl. = -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().(if self.max_orderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_order. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().12 { |
| 410 | self.max_orderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_order. as i32 |
| 411 | } else { |
| 412 | 12 |
| 413 | }) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().1; |
| 414 | self.run_lengthrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#run_length. = self.init_rlrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#init_rl.; |
| 415 | self.prev_successrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#prev_success. = 0; |
| 416 | |
| 417 | self.hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit. = self.hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit..offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().UNIT_SIZErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/UNIT_SIZE.); |
| 418 | let mut mc = self.hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit..castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().::<Contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#>(); |
| 419 | let s = self.lo_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#lo_unit..castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().::<Staterust-analyzer cargo ppmd-rust 1.2.1 internal/State#>(); |
| 420 | |
| 421 | self.lo_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#lo_unit. = self.lo_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#lo_unit..offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().((256 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Div<Self>`]div().2) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][`Mul<Self>`]mul().UNIT_SIZErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/UNIT_SIZE.); |
| 422 | self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context. = mc; |
| 423 | self.max_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_context. = mc; |
| 424 | self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state. = s; |
| 425 | |
| 426 | { |
| 427 | let mc = mc.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().(); |
| 428 | mc.num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. = 256; |
| 429 | mc.union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. = (256 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().1) as u16; |
| 430 | mc.union4rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union4..statsrust-analyzer cargo ppmd-rust 1.2.1 internal/Union4#stats. = self.offset_for_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]offset_for_ptr().(s); |
| 431 | mc.suffixrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#suffix. = TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#::nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]null().(); |
| 432 | } |
| 433 | |
| 434 | (0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#256).for_eachrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#for_each().(|i| { |
| 435 | let s = s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(i).as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().(); |
| 436 | s.symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. = i as u8; |
| 437 | s.freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. = 1; |
| 438 | s.set_successorrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[State]set_successor().(TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#::nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]null().()); |
| 439 | }); |
| 440 | |
| 441 | (0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#128).for_eachrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#for_each().(|i| { |
| 442 | (0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#8).for_eachrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#for_each().(|k| { |
| 443 | let val = PPMD_BIN_SCALErust-analyzer cargo ppmd-rust 1.2.1 internal/PPMD_BIN_SCALE. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().(K_INIT_BIN_ESCrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/K_INIT_BIN_ESC.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().k]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Div<Self>`]div().(i as u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().2); |
| 444 | |
| 445 | (0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#64).step_byrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#step_by().(8).for_eachrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#for_each().(|m| { |
| 446 | self.bin_summrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#bin_summ.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().k rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().m]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). = val as u16; |
| 447 | }); |
| 448 | }); |
| 449 | }); |
| 450 | |
| 451 | (0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#25).for_eachrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#for_each().(|i| { |
| 452 | let summ = (5 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().i as u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().10) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<Self>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<Self>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<Self>`]shl().(PPMD_PERIOD_BITSrust-analyzer cargo ppmd-rust 1.2.1 internal/PPMD_PERIOD_BITS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().4); |
| 453 | (0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#16).for_eachrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#for_each().(|k| { |
| 454 | let s = &mut self.seerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#see.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().k]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().; |
| 455 | s.summrust-analyzer cargo ppmd-rust 1.2.1 internal/See#summ. = summ as u16; |
| 456 | s.shiftrust-analyzer cargo ppmd-rust 1.2.1 internal/See#shift. = (PPMD_PERIOD_BITSrust-analyzer cargo ppmd-rust 1.2.1 internal/PPMD_PERIOD_BITS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().4) as u8; |
| 457 | s.countrust-analyzer cargo ppmd-rust 1.2.1 internal/See#count. = 4; |
| 458 | }); |
| 459 | }); |
| 460 | |
| 461 | self.dummy_seerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#dummy_see..summrust-analyzer cargo ppmd-rust 1.2.1 internal/See#summ. = 0; |
| 462 | self.dummy_seerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#dummy_see..shiftrust-analyzer cargo ppmd-rust 1.2.1 internal/See#shift. = PPMD_PERIOD_BITSrust-analyzer cargo ppmd-rust 1.2.1 internal/PPMD_PERIOD_BITS. as u8; |
| 463 | self.dummy_seerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#dummy_see..countrust-analyzer cargo ppmd-rust 1.2.1 internal/See#count. = 64; |
| 464 | } |
| 465 | } |
| 466 | |
| 467 | /// It's called when `found_state.successor` is RAW-successor, that is the link to position |
| 468 | /// in raw text. So we create Context records and write the links to `found_state.successor` |
| 469 | /// and to identical RAW-successors in suffix contexts of `min_context`. |
| 470 | /// |
| 471 | /// The function returns: |
| 472 | /// |
| 473 | /// if (`porder_fall` == 0) then `min_context` is already at MAX order, |
| 474 | /// { return pointer to new or existing context of same MAX order } |
| 475 | /// else |
| 476 | /// { return pointer to new real context that will be (order+1) in comparison with `min_context` } |
| 477 | /// |
| 478 | /// also it can return a pointer to a real context of same order. |
| 479 | #[inline(never)] |
| 480 | unsafe fn create_successorsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]create_successors().(&mut self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#>> { |
| 481 | unsafe { |
| 482 | let mut c = self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.; |
| 483 | let up_branch = self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().get_successorrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[State]get_successor().(); |
| 484 | let mut num_ps = 0; |
| 485 | let mut ps: [Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Staterust-analyzer cargo ppmd-rust 1.2.1 internal/State#>>; 64] = [Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; 64]; |
| 486 | |
| 487 | if self.order_fallrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#order_fall. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().0 { |
| 488 | let fresh = num_ps; |
| 489 | num_ps rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().1; |
| 490 | ps[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().fresh as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state.); |
| 491 | } |
| 492 | |
| 493 | while c.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().suffixrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#suffix..is_not_nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]is_not_null().() { |
| 494 | let mut s; |
| 495 | c = self.get_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_context().(c.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().suffixrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#suffix.); |
| 496 | |
| 497 | if c.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().1 { |
| 498 | let sym = self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol.; |
| 499 | s = self.get_multi_state_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_multi_state_stats().(c); |
| 500 | while s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().sym { |
| 501 | s = s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(1); |
| 502 | } |
| 503 | } else { |
| 504 | s = self.get_single_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_single_state().(c); |
| 505 | } |
| 506 | let successor = s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().get_successorrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[State]get_successor().(); |
| 507 | if successor rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().up_branch { |
| 508 | // c is the real record Context here. |
| 509 | c = self.get_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_context().(successor); |
| 510 | if num_ps rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().0 { |
| 511 | // c is the real record MAX Order Context here, |
| 512 | // so we don't need to create any new contexts. |
| 513 | return Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c); |
| 514 | } |
| 515 | break; |
| 516 | } else { |
| 517 | let fresh = num_ps; |
| 518 | num_ps rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().1; |
| 519 | ps[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().fresh as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(s); |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | // All created contexts will have single-symbol with new RAW-successor |
| 524 | // All new RAW-successors will point to next position in RAW text |
| 525 | // after `found_state.successor` |
| 526 | let new_sym = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().up_branch.as_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]as_ptr().::<u8, _>(self).as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().(); |
| 527 | let new_offset = up_branch.get_offsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]get_offset().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().1; |
| 528 | let up_branch = TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#::from_bytes_offsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]from_bytes_offset().(new_offset); |
| 529 | |
| 530 | let new_freq = if c.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().1 { |
| 531 | self.get_single_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_single_state().(c).as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. |
| 532 | } else { |
| 533 | let mut s = self.get_multi_state_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_multi_state_stats().(c); |
| 534 | while s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().new_sym { |
| 535 | s = s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(1); |
| 536 | } |
| 537 | let cf = (s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().1; |
| 538 | let s0 = (c.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. as u32) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().c.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. as u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().cf; |
| 539 | |
| 540 | // cf - is frequency of symbol that will be successor in new context records. |
| 541 | // s0 - is commutative frequency sum of another symbols from parent context. |
| 542 | // max(new_freq) = (s.freq + 1), when (s0 == 1) |
| 543 | // We have a requirement (Context::get_one_state().freq <= 128) in bin_summ |
| 544 | // so (s.freq < 128) - is a requirement for multi-symbol contexts. |
| 545 | 1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Add<Self>`]add().(if 2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().cf rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le().s0 { |
| 546 | (5 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().cf rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().s0) as u32 |
| 547 | } else { |
| 548 | ((2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().cf rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().s0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().1) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Div<Self>`]div().(2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().s0)) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().1 |
| 549 | }) as u8 |
| 550 | }; |
| 551 | |
| 552 | // Create a new single-symbol contexts from low order to high order in loop. |
| 553 | loop { |
| 554 | let mut c1: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#> = if self.hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().self.lo_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#lo_unit. { |
| 555 | self.hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit. = self.hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit..offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().UNIT_SIZErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/UNIT_SIZE.); |
| 556 | self.hi_unitrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_unit..castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().() |
| 557 | } else if self.free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()..is_not_nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]is_not_null().() { |
| 558 | self.remove_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]remove_node().(0).castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().() |
| 559 | } else { |
| 560 | self.alloc_units_rarerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]alloc_units_rare().(0)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Try]branch()..castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().() |
| 561 | }; |
| 562 | |
| 563 | c1.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. = 1; |
| 564 | |
| 565 | { |
| 566 | let state = self.get_single_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_single_state().(c1).as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().(); |
| 567 | state.symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. = new_sym; |
| 568 | state.freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. = new_freq; |
| 569 | state.set_successorrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[State]set_successor().(up_branch); |
| 570 | } |
| 571 | |
| 572 | c1.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().suffixrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#suffix. = self.offset_for_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]offset_for_ptr().(c); |
| 573 | num_ps rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign().1; |
| 574 | |
| 575 | let mut successor = ps[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().num_ps as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()..expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]expect().("successor not set"); |
| 576 | successor.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().set_successorrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[State]set_successor().(self.offset_for_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]offset_for_ptr().(c1)); |
| 577 | |
| 578 | c = c1; |
| 579 | if num_ps rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().0 { |
| 580 | break; |
| 581 | } |
| 582 | } |
| 583 | |
| 584 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | #[inline(never)] |
| 589 | unsafe fn update_modelrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]update_model().(&mut self) { |
| 590 | unsafe { |
| 591 | let mut c: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#>; |
| 592 | |
| 593 | let mc = self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.; |
| 594 | |
| 595 | if self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt().MAX_FREQrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/MAX_FREQ. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Div<Self>`]div().4 && mc.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().suffixrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#suffix..is_not_nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]is_not_null().() { |
| 596 | // Update freqs in suffix context |
| 597 | c = self.get_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_context().(mc.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().suffixrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#suffix.); |
| 598 | |
| 599 | if c.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().1 { |
| 600 | let s = self.get_single_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_single_state().(c).as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().(); |
| 601 | if s.freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt().32 { |
| 602 | s.freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign().1; |
| 603 | } |
| 604 | } else { |
| 605 | let mut s = self.get_multi_state_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_multi_state_stats().(c); |
| 606 | let sym = self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol.; |
| 607 | if s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().sym { |
| 608 | while s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().sym { |
| 609 | s = s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(1); |
| 610 | } |
| 611 | if s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(0).as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]ge().s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1).as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. { |
| 612 | Selfrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]::swap_statesrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]swap_states().(s); |
| 613 | s = s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1); |
| 614 | } |
| 615 | } |
| 616 | if s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt().MAX_FREQrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/MAX_FREQ. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Sub<Self>`]sub().9 { |
| 617 | s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign().2; |
| 618 | c.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign().2; |
| 619 | } |
| 620 | } |
| 621 | } |
| 622 | |
| 623 | if self.order_fallrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#order_fall. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().0 { |
| 624 | // MAX ORDER context |
| 625 | // (found_state.Successor) is RAW-successor. |
| 626 | match self.create_successorsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]create_successors().() { |
| 627 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => { |
| 628 | self.restart_modelrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]restart_model().(); |
| 629 | return; |
| 630 | } |
| 631 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(mc) => { |
| 632 | self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context. = mc; |
| 633 | self.max_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_context. = mc; |
| 634 | } |
| 635 | } |
| 636 | |
| 637 | self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state. |
| 638 | .as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().() |
| 639 | .set_successorrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[State]set_successor().(self.offset_for_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]offset_for_ptr().(self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.)); |
| 640 | return; |
| 641 | } |
| 642 | |
| 643 | // NON MAX ORDER context |
| 644 | let mut text = self.textrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#text.; |
| 645 | let mut fresh = text; |
| 646 | text = text.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(1); |
| 647 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().fresh.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().() = self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol.; |
| 648 | self.textrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#text. = text; |
| 649 | if text rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#ge().self.units_startrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units_start. { |
| 650 | self.restart_modelrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]restart_model().(); |
| 651 | return; |
| 652 | } |
| 653 | let mut max_successor = self.offset_for_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]offset_for_ptr().::<u8>(text); |
| 654 | |
| 655 | let mut min_successor = self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().get_successorrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[State]get_successor().(); |
| 656 | |
| 657 | if min_successor.is_nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]is_null().() { |
| 658 | // found_state has NULL-successor here. |
| 659 | // And only root 0-order context can contain NULL-successors. |
| 660 | // We change successor in found_state to RAW-successor, |
| 661 | // And next context will be same 0-order root Context. |
| 662 | self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().set_successorrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[State]set_successor().(max_successor); |
| 663 | min_successor = self.offset_for_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]offset_for_ptr().(self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.); |
| 664 | } else { |
| 665 | // There is a successor for found_state in min_context. |
| 666 | // So the next context will be one order higher than min_context. |
| 667 | |
| 668 | if min_successor.get_offsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]get_offset().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le().max_successor.get_offsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]get_offset().() { |
| 669 | // min_successor is RAW-successor. So we will create real contexts records: |
| 670 | match self.create_successorsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]create_successors().() { |
| 671 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => { |
| 672 | self.restart_modelrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]restart_model().(); |
| 673 | return; |
| 674 | } |
| 675 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(context) => { |
| 676 | min_successor = self.offset_for_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]offset_for_ptr().(context); |
| 677 | } |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | // min_successor now is real Context pointer that points to existing (Order+1) context. |
| 682 | |
| 683 | self.order_fallrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#order_fall. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().1; |
| 684 | if self.order_fallrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#order_fall. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().0 { |
| 685 | // If we move to max_order context, then min_successor will be common Successor for both: |
| 686 | // min_context that is (max_order - 1) |
| 687 | // max_context that is (max_order) |
| 688 | // so we don't need new RAW-successor, and we can use real min_successor |
| 689 | // as successors for both min_context and max_context. |
| 690 | max_successor = min_successor; |
| 691 | |
| 692 | // if (max_context != min_context) |
| 693 | // { |
| 694 | // There was order fall from max_order, and we don't need current symbol |
| 695 | // to transfer some RAW-successors to real contexts. |
| 696 | // So we roll back pointer in raw data for one position. |
| 697 | // } |
| 698 | self.textrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#text. = self |
| 699 | .textrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#text. |
| 700 | .offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().((self.max_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_context. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.) as isize)); |
| 701 | } |
| 702 | } |
| 703 | |
| 704 | let mc = self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.; |
| 705 | c = self.max_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_context.; |
| 706 | |
| 707 | self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context. = self.get_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_context().(min_successor); |
| 708 | self.max_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_context. = self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.; |
| 709 | |
| 710 | if c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`][`PartialEq<Self>`]eq().mc { |
| 711 | return; |
| 712 | } |
| 713 | |
| 714 | // s0 : is pure escape freq |
| 715 | let ns = mc.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. as u32; |
| 716 | let s0 = (mc.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. as u32) |
| 717 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().ns |
| 718 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().((self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().1); |
| 719 | |
| 720 | while c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().mc { |
| 721 | let mut sum; |
| 722 | let ns1 = c.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. as u32; |
| 723 | if ns1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().1 { |
| 724 | if ns1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().0 { |
| 725 | // Expand for one unit |
| 726 | let old_nu = ns1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().1; |
| 727 | let i = self.units2indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units2index.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().(old_nu as usize) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32; |
| 728 | if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().self.units2indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units2index.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().old_nu as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32 { |
| 729 | let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ptr) = self.alloc_unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]alloc_units().(i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().1) else { |
| 730 | self.restart_modelrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]restart_model().(); |
| 731 | return; |
| 732 | }; |
| 733 | |
| 734 | let old_ptr = self.get_multi_state_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_multi_state_stats().(c).castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().(); |
| 735 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/copy().( |
| 736 | old_ptr.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().().as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().(), |
| 737 | ptr.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().(), |
| 738 | old_nu as usize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().UNIT_SIZErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/UNIT_SIZE. as usize, |
| 739 | ); |
| 740 | self.insert_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]insert_node().(old_ptr, i); |
| 741 | c.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().union4rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union4..statsrust-analyzer cargo ppmd-rust 1.2.1 internal/Union4#stats. = self.offset_for_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]offset_for_ptr().(ptr.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().::<Staterust-analyzer cargo ppmd-rust 1.2.1 internal/State#>()); |
| 742 | } |
| 743 | } |
| 744 | sum = c.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. as u32; |
| 745 | // Max increase of escape_freq is 3 here. |
| 746 | // Total increase of union2.summ_freq for all symbols is less than 256 here. |
| 747 | sum rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().((2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().(ns1) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().ns) as u32) |
| 748 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().((4 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().(ns1) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le().ns) as u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().(sum rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le().(8 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().(ns1))) as u32); |
| 749 | } else { |
| 750 | // Instead of 1-symbol context we create 2-symbol context. |
| 751 | let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(s_ptr) = self.alloc_unitsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]alloc_units().(0) else { |
| 752 | self.restart_modelrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]restart_model().(); |
| 753 | return; |
| 754 | }; |
| 755 | let mut s = s_ptr.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().::<Staterust-analyzer cargo ppmd-rust 1.2.1 internal/State#>(); |
| 756 | |
| 757 | let mut freq = c.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..state2rust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#state2..freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State2#freq. as u32; |
| 758 | s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. = c.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..state2rust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#state2..symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State2#symbol.; |
| 759 | s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().() |
| 760 | .set_successorrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[State]set_successor().(c.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().union4rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union4..state4rust-analyzer cargo ppmd-rust 1.2.1 internal/Union4#state4..get_successorrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[State4]get_successor().()); |
| 761 | c.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().union4rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union4..statsrust-analyzer cargo ppmd-rust 1.2.1 internal/Union4#stats. = self.offset_for_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]offset_for_ptr().(s); |
| 762 | if freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().(MAX_FREQrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/MAX_FREQ. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Div<Self>`]div().4 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Sub<Self>`]sub().1) as u32 { |
| 763 | freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`ShlAssign<i32>`]shl_assign().<<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`ShlAssign<i32>`]shl_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`ShlAssign<i32>`]shl_assign().1; |
| 764 | } else { |
| 765 | freq = (MAX_FREQrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/MAX_FREQ. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Sub<Self>`]sub().4) as u32; |
| 766 | } |
| 767 | // (max(s.freq) == 120), when we convert from 1-symbol into 2-symbol context. |
| 768 | s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. = freq as u8; |
| 769 | // max(init_esc = K_EXP_ESCAPE[*]) is 25. So the max(escape_freq) is 26 here. |
| 770 | sum = freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().self.init_escrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#init_esc. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().((ns rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().3) as u32); |
| 771 | } |
| 772 | |
| 773 | let mut s = self.get_multi_state_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_multi_state_stats().(c).offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(ns1 as isize); |
| 774 | let mut cf = 2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().(sum rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().6) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32; |
| 775 | let sf = s0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().sum; |
| 776 | s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. = self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol.; |
| 777 | c.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. = (ns1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().1) as u16; |
| 778 | |
| 779 | s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().set_successorrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[State]set_successor().(max_successor); |
| 780 | if cf rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().6 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().sf { |
| 781 | cf = 1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().((cf rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().sf) as u32) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().((cf rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().4 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().sf) as u32); |
| 782 | sum rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().3; |
| 783 | // It can add (0, 1, 2) to escape_freq |
| 784 | } else { |
| 785 | cf = 4 |
| 786 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().((cf rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().9 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().sf) as u32) |
| 787 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().((cf rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().12 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().sf) as u32) |
| 788 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().((cf rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]ge().15 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().sf) as u32); |
| 789 | sum rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().cf; |
| 790 | } |
| 791 | |
| 792 | c.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. = sum as u16; |
| 793 | s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. = cf as u8; |
| 794 | |
| 795 | c = self.get_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_context().(c.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().suffixrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#suffix.); |
| 796 | } |
| 797 | } |
| 798 | } |
| 799 | |
| 800 | unsafe fn swap_statesrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]swap_states().(s: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Staterust-analyzer cargo ppmd-rust 1.2.1 internal/State#>) { |
| 801 | let s_ptr = s.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().(); |
| 802 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::swaprust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/swap().(s_ptr, s_ptr.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/mut_ptr/impl#[`*mut T`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1)); |
| 803 | } |
| 804 | |
| 805 | #[inline(never)] |
| 806 | unsafe fn rescalerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]rescale().(&mut self) { |
| 807 | unsafe { |
| 808 | let stats = self.get_multi_state_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_multi_state_stats().(self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.); |
| 809 | let mut s = self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state.; |
| 810 | |
| 811 | // Sort the list by freq |
| 812 | if s rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().stats { |
| 813 | let tmp = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().(); |
| 814 | while s rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().stats { |
| 815 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(0).as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().() = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1).as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().(); |
| 816 | s = s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1); |
| 817 | } |
| 818 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().() = tmp; |
| 819 | } |
| 820 | |
| 821 | let mut sum_freq = s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32; |
| 822 | let mut esc_freq = (self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. as u32) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().sum_freq; |
| 823 | |
| 824 | // if (p.order_fall == 0), adder = 0 : it's allowed to remove symbol from MAX order context |
| 825 | // if (p.order_fall != 0), adder = 1 : it's NOT allowed to remove symbol from NON-MAX order context |
| 826 | |
| 827 | let adder = (self.order_fallrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#order_fall. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().0) as u32; |
| 828 | |
| 829 | sum_freq = (sum_freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().4 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().adder) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().1; |
| 830 | let mut i = (self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. as u32) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().1; |
| 831 | s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. = sum_freq as u8; |
| 832 | |
| 833 | for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#i { |
| 834 | s = s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(1); |
| 835 | let mut freq = s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32; |
| 836 | esc_freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().freq; |
| 837 | freq = (freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().adder) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().1; |
| 838 | sum_freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().freq; |
| 839 | s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. = freq as u8; |
| 840 | if freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1).as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32 { |
| 841 | let tmp = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().(); |
| 842 | let mut s1 = s; |
| 843 | loop { |
| 844 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().s1.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(0).as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().() = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().s1.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1).as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().(); |
| 845 | s1 = s1.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1); |
| 846 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(s1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().stats && freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().s1.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1).as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32) { |
| 847 | break; |
| 848 | } |
| 849 | } |
| 850 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().s1.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().() = tmp; |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | if s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().0 { |
| 855 | // Remove all items with freq == 0 |
| 856 | |
| 857 | i = 0; |
| 858 | while s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().0 { |
| 859 | i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().1; |
| 860 | s = s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1); |
| 861 | } |
| 862 | |
| 863 | // We increase (esc_freq) for the number of removed symbols. |
| 864 | // So we will have (0.5) increase for escape_freq in average per |
| 865 | // removed symbol after escape_freq halving |
| 866 | esc_freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().i; |
| 867 | let mut mc = self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.; |
| 868 | let num_stats = mc.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. as u32; |
| 869 | let num_stats_new = num_stats.wrapping_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]wrapping_sub().(i); |
| 870 | mc.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. = num_stats_new as u16; |
| 871 | let n0 = (num_stats rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().1) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().1; |
| 872 | |
| 873 | if num_stats_new rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().1 { |
| 874 | // Create Single-Symbol context |
| 875 | let mut freq = stats.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32; |
| 876 | loop { |
| 877 | esc_freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`ShrAssign<i32>`]shr_assign().>>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`ShrAssign<i32>`]shr_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`ShrAssign<i32>`]shr_assign().1; |
| 878 | freq = (freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().1) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().1; |
| 879 | if esc_freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]le().1 { |
| 880 | break; |
| 881 | } |
| 882 | } |
| 883 | |
| 884 | s = self.get_single_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_single_state().(mc); |
| 885 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().() = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().stats.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().(); |
| 886 | s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. = freq as u8; // (freq <= 260 / 4) |
| 887 | self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state. = s; |
| 888 | self.insert_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]insert_node().(stats.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().(), self.units2indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units2index.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().(n0 as usize) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32); |
| 889 | return; |
| 890 | } |
| 891 | |
| 892 | let n1 = (num_stats_new rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().1) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().1; |
| 893 | if n0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().n1 { |
| 894 | let i0 = self.units2indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units2index.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().(n0 as usize) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32; |
| 895 | let i1 = self.units2indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#units2index.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().(n1 as usize) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32; |
| 896 | if i0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().i1 { |
| 897 | if self.free_listrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#free_list.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().i1 as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()..is_not_nullrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]is_not_null().() { |
| 898 | let ptr = self.remove_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]remove_node().(i1); |
| 899 | self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context..as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().union4rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union4..statsrust-analyzer cargo ppmd-rust 1.2.1 internal/Union4#stats. = |
| 900 | self.offset_for_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]offset_for_ptr().(ptr.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().::<Staterust-analyzer cargo ppmd-rust 1.2.1 internal/State#>()); |
| 901 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/copy().( |
| 902 | stats.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().().as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().(), |
| 903 | ptr.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().(), |
| 904 | n1 as usize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().UNIT_SIZErust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/UNIT_SIZE. as usize, |
| 905 | ); |
| 906 | self.insert_noderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]insert_node().(stats.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().(), i0); |
| 907 | } else { |
| 908 | self.split_blockrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]split_block().(stats.castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().(), i0, i1); |
| 909 | } |
| 910 | } |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | // escape_freq halving here. |
| 915 | self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context..as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. = |
| 916 | (sum_freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().esc_freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().(esc_freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().1)) as u16; |
| 917 | self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state. = self.get_multi_state_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_multi_state_stats().(self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.); |
| 918 | } |
| 919 | } |
| 920 | |
| 921 | unsafe fn make_esc_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]make_esc_freq().(&mut self, num_masked: u32, esc_freq: &mut u32) -> SeeSourcerust-analyzer cargo ppmd-rust 1.2.1 internal/SeeSource# { |
| 922 | unsafe { |
| 923 | let num_stats = self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. as u32; |
| 924 | |
| 925 | if num_stats rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().256 { |
| 926 | let (base_context_idx, see_table_hash) = |
| 927 | self.calculate_see_table_hashrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]calculate_see_table_hash().(num_masked, num_stats); |
| 928 | |
| 929 | let see = &mut self.seerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#see.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().base_context_idx]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().see_table_hash]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().; |
| 930 | |
| 931 | // If (see.summ) field is larger than 16-bit, we need only low 16 bits of summ. |
| 932 | let summ = see.summrust-analyzer cargo ppmd-rust 1.2.1 internal/See#summ. as u32; |
| 933 | let r = summ rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().see.shiftrust-analyzer cargo ppmd-rust 1.2.1 internal/See#shift. as i32; |
| 934 | see.summrust-analyzer cargo ppmd-rust 1.2.1 internal/See#summ. = (summ rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().r) as u16; |
| 935 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().esc_freq = r rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().(r rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().0) as u32; |
| 936 | |
| 937 | SeeSourcerust-analyzer cargo ppmd-rust 1.2.1 internal/SeeSource#::Tablerust-analyzer cargo ppmd-rust 1.2.1 internal/SeeSource#Table#(base_context_idx, see_table_hash) |
| 938 | } else { |
| 939 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().esc_freq = 1; |
| 940 | SeeSourcerust-analyzer cargo ppmd-rust 1.2.1 internal/SeeSource#::Dummyrust-analyzer cargo ppmd-rust 1.2.1 internal/SeeSource#Dummy# |
| 941 | } |
| 942 | } |
| 943 | } |
| 944 | |
| 945 | fn get_seerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_see().(&mut self, see_source: SeeSourcerust-analyzer cargo ppmd-rust 1.2.1 internal/SeeSource#) -> &mut Seerust-analyzer cargo ppmd-rust 1.2.1 internal/See# { |
| 946 | match see_source { |
| 947 | SeeSourcerust-analyzer cargo ppmd-rust 1.2.1 internal/SeeSource#::Dummyrust-analyzer cargo ppmd-rust 1.2.1 internal/SeeSource#Dummy# => &mut self.dummy_seerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#dummy_see., |
| 948 | SeeSourcerust-analyzer cargo ppmd-rust 1.2.1 internal/SeeSource#::Tablerust-analyzer cargo ppmd-rust 1.2.1 internal/SeeSource#Table#(i, k) => &mut self.seerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#see.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().k]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut()., |
| 949 | } |
| 950 | } |
| 951 | |
| 952 | unsafe fn calculate_see_table_hashrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]calculate_see_table_hash().( |
| 953 | &mut self, |
| 954 | num_masked: u32, |
| 955 | num_stats: u32, |
| 956 | ) -> (usize, usize) { |
| 957 | unsafe { |
| 958 | let non_masked = num_stats rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().num_masked; |
| 959 | let base_context_idx = self.ns2indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#ns2index.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().(non_masked as usize) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as usize; |
| 960 | |
| 961 | let mc = self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().(); |
| 962 | let suffix_context = self.get_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_context().(mc.suffixrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#suffix.); |
| 963 | let suffix_num_stats = suffix_context.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. as u32; |
| 964 | let summ_freq = mc.union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. as u32; |
| 965 | |
| 966 | let context_hierarchy_hash = (non_masked rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().(suffix_num_stats rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().num_stats)) as usize; |
| 967 | let freq_distribution_hash = 2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().(summ_freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().(11 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().num_stats)) as usize; |
| 968 | let symbol_masking_ratio_hash = 4 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().(num_masked rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().non_masked) as usize; |
| 969 | let symbol_characteristics_hash = self.hi_bits_flagrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_bits_flag. as usize; |
| 970 | |
| 971 | let see_table_hash = context_hierarchy_hash |
| 972 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().freq_distribution_hash |
| 973 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().symbol_masking_ratio_hash |
| 974 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().symbol_characteristics_hash; |
| 975 | |
| 976 | (base_context_idx, see_table_hash) |
| 977 | } |
| 978 | } |
| 979 | |
| 980 | unsafe fn next_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]next_context().(&mut self) { |
| 981 | unsafe { |
| 982 | let successor = self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().get_successorrust-analyzer cargo ppmd-rust 1.2.1 internal/impl#[State]get_successor().(); |
| 983 | if self.order_fallrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#order_fall. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]eq().0 && successor.is_real_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]is_real_context().(self) { |
| 984 | let c = self.get_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_context().(successor); |
| 985 | self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context. = c; |
| 986 | self.max_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#max_context. = self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.; |
| 987 | } else { |
| 988 | self.update_modelrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]update_model().(); |
| 989 | }; |
| 990 | } |
| 991 | } |
| 992 | |
| 993 | unsafe fn update1rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]update1().(&mut self) { |
| 994 | unsafe { |
| 995 | let mut s = self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state.; |
| 996 | let freq = s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().4; |
| 997 | self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context..as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign().4; |
| 998 | s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. = freq as u8; |
| 999 | if freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1).as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32 { |
| 1000 | Selfrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]::swap_statesrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]swap_states().(s); |
| 1001 | s = s.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1); |
| 1002 | self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state. = s; |
| 1003 | if freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().MAX_FREQrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/MAX_FREQ. as u32 { |
| 1004 | self.rescalerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]rescale().(); |
| 1005 | } |
| 1006 | } |
| 1007 | self.next_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]next_context().(); |
| 1008 | } |
| 1009 | } |
| 1010 | |
| 1011 | unsafe fn update1_0rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]update1_0().(&mut self) { |
| 1012 | unsafe { |
| 1013 | let s = self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().(); |
| 1014 | let mc = self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context..as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().(); |
| 1015 | let mut freq = s.freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32; |
| 1016 | let summ_freq = mc.union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. as u32; |
| 1017 | self.prev_successrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#prev_success. = ((2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().freq) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().summ_freq) as u32; |
| 1018 | self.run_lengthrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#run_length. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().self.prev_successrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#prev_success. as i32; |
| 1019 | mc.union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. = (summ_freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().4) as u16; |
| 1020 | freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().4; |
| 1021 | s.freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. = freq as u8; |
| 1022 | if freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().MAX_FREQrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/MAX_FREQ. as u32 { |
| 1023 | self.rescalerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]rescale().(); |
| 1024 | } |
| 1025 | self.next_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]next_context().(); |
| 1026 | } |
| 1027 | } |
| 1028 | |
| 1029 | unsafe fn update2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]update2().(&mut self) { |
| 1030 | unsafe { |
| 1031 | let s = self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().(); |
| 1032 | let freq = s.freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().4; |
| 1033 | self.run_lengthrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#run_length. = self.init_rlrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#init_rl.; |
| 1034 | self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context..as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2..summ_freqrust-analyzer cargo ppmd-rust 1.2.1 internal/Union2#summ_freq. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign().4; |
| 1035 | s.freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. = freq as u8; |
| 1036 | if freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().MAX_FREQrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/MAX_FREQ. as u32 { |
| 1037 | self.rescalerust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]rescale().(); |
| 1038 | } |
| 1039 | self.update_modelrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]update_model().(); |
| 1040 | } |
| 1041 | } |
| 1042 | |
| 1043 | unsafe fn update_binrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]update_bin().(&mut self, mut s: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Staterust-analyzer cargo ppmd-rust 1.2.1 internal/State#>) { |
| 1044 | unsafe { |
| 1045 | let freq = s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as u32; |
| 1046 | self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state. = s; |
| 1047 | self.prev_successrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#prev_success. = 1; |
| 1048 | self.run_lengthrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#run_length. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().1; |
| 1049 | s.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign().((freq rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().128) as u32) as u8; |
| 1050 | self.next_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]next_context().(); |
| 1051 | } |
| 1052 | } |
| 1053 | |
| 1054 | unsafe fn mask_symbolsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]mask_symbols().(char_mask: &mut [u8; 256], s: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Staterust-analyzer cargo ppmd-rust 1.2.1 internal/State#>, mut s2: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Staterust-analyzer cargo ppmd-rust 1.2.1 internal/State#>) { |
| 1055 | unsafe { |
| 1056 | char_mask[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().s.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = 0; |
| 1057 | while s2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#lt().s { |
| 1058 | let sym0 = s2.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(0).as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. as u32; |
| 1059 | let sym1 = s2.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(1).as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. as u32; |
| 1060 | s2 = s2.offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]offset().(2); |
| 1061 | char_mask[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().sym0 as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = 0; |
| 1062 | char_mask[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().sym1 as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = 0; |
| 1063 | } |
| 1064 | } |
| 1065 | } |
| 1066 | |
| 1067 | const fn hi_bits_flag3rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]hi_bits_flag3().(symbol: u32) -> u32 { |
| 1068 | (symbol rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().0xC0) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().(8 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().3) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().(1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<i32>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<i32>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<i32>`]shl().3) |
| 1069 | } |
| 1070 | |
| 1071 | const fn hi_bits_flag4rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]hi_bits_flag4().(symbol: u32) -> u32 { |
| 1072 | (symbol rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().0xC0) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().(8 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().4) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().(1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<i32>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<i32>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<i32>`]shl().4) |
| 1073 | } |
| 1074 | |
| 1075 | unsafe fn get_bin_summrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_bin_summ().(&mut self) -> &mut u16 { |
| 1076 | unsafe { |
| 1077 | let state = self.get_single_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_single_state().(self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context.); |
| 1078 | |
| 1079 | let hi_bits_flag3 = Selfrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]::hi_bits_flag3rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]hi_bits_flag3().(self.found_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#found_state..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. as u32); |
| 1080 | let symbol = state.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().symbolrust-analyzer cargo ppmd-rust 1.2.1 internal/State#symbol. as u32; |
| 1081 | let hi_bits_flag4 = Selfrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]::hi_bits_flag4rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]hi_bits_flag4().(symbol); |
| 1082 | |
| 1083 | self.hi_bits_flagrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#hi_bits_flag. = hi_bits_flag3; |
| 1084 | |
| 1085 | let freq_bin_idx = state.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().freqrust-analyzer cargo ppmd-rust 1.2.1 internal/State#freq. as usize; |
| 1086 | |
| 1087 | let num_stats = self |
| 1088 | .get_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_context().(self.min_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#min_context..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().().suffixrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#suffix.) |
| 1089 | .as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ref().() |
| 1090 | .num_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#num_stats. as usize; |
| 1091 | |
| 1092 | let context_idx = (self.prev_successrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#prev_success. |
| 1093 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().((self.run_lengthrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#run_length. as u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().26) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().0x20) |
| 1094 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().self.ns2bs_indexrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#ns2bs_index.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().num_stats rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as u32 |
| 1095 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().hi_bits_flag4 |
| 1096 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().hi_bits_flag3) as usize; |
| 1097 | |
| 1098 | &mut self.bin_summrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#bin_summ.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().freq_bin_idx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().context_idx]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut(). |
| 1099 | } |
| 1100 | } |
| 1101 | |
| 1102 | #[inline(always)] |
| 1103 | unsafe fn get_contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_context().(&mut self, suffix: TaggedOffsetrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/TaggedOffset#) -> NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#> { |
| 1104 | unsafe { suffix.as_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]as_ptr().(self) } |
| 1105 | } |
| 1106 | |
| 1107 | #[inline(always)] |
| 1108 | fn get_single_staterust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_single_state().(&mut self, context: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#>) -> NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Staterust-analyzer cargo ppmd-rust 1.2.1 internal/State#> { |
| 1109 | let context_ptr = context.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().(); |
| 1110 | unsafe { |
| 1111 | // Safety: We know that context is not null, so a field address from it can't be null. |
| 1112 | let single_state = &raw mut (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().context_ptr).union2rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union2.; |
| 1113 | NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#::new_uncheckedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]new_unchecked().(single_state).castrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]cast().() |
| 1114 | } |
| 1115 | } |
| 1116 | |
| 1117 | #[inline(always)] |
| 1118 | unsafe fn get_multi_state_statsrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]get_multi_state_stats().(&mut self, mut context: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Contextrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#>) -> NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<Staterust-analyzer cargo ppmd-rust 1.2.1 internal/State#> { |
| 1119 | unsafe { context.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().().union4rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/Context#union4..statsrust-analyzer cargo ppmd-rust 1.2.1 internal/Union4#stats..as_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/tagged_offset/impl#[TaggedOffset]as_ptr().(self) } |
| 1120 | } |
| 1121 | } |
| 1122 | |
| 1123 | impl<R: Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#> PPMd7rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#<RangeDecoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeDecoder#<R>> { |
| 1124 | pub(craterust-analyzer cargo ppmd-rust 1.2.1 crate/) fn new_decoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RangeDecoder<R>>`]new_decoder().( |
| 1125 | reader: R, |
| 1126 | order: u32, |
| 1127 | mem_size: u32, |
| 1128 | ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<PPMd7rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#<RangeDecoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeDecoder#<R>>, Errorrust-analyzer cargo ppmd-rust 1.2.1 Error#> { |
| 1129 | let range_decoder = RangeDecoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeDecoder#::newrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/impl#[`RangeDecoder<R>`]new().(reader)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1130 | Selfrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RangeDecoder<R>>`]::constructrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]construct().(range_decoder, order, mem_size) |
| 1131 | } |
| 1132 | |
| 1133 | pub(craterust-analyzer cargo ppmd-rust 1.2.1 crate/) fn into_innerrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RangeDecoder<R>>`]into_inner().(self) -> R { |
| 1134 | let manual_drop_self = ManuallyDroprust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/manually_drop/ManuallyDrop#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/manually_drop/impl#[`ManuallyDrop<T>`]new().(self); |
| 1135 | unsafe { |
| 1136 | deallocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc alloc/dealloc().( |
| 1137 | manual_drop_self.memory_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#memory_ptr..as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().(), |
| 1138 | manual_drop_self.memory_layoutrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#memory_layout., |
| 1139 | ); |
| 1140 | } |
| 1141 | let rc = unsafe { stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::readrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/read().(&manual_drop_self.rcrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#rc.) }; |
| 1142 | let RangeDecoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeDecoder# { readerrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeDecoder#reader., .. } = rc; |
| 1143 | reader |
| 1144 | } |
| 1145 | |
| 1146 | pub(craterust-analyzer cargo ppmd-rust 1.2.1 crate/) fn range_decoder_coderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RangeDecoder<R>>`]range_decoder_code().(&self) -> u32 { |
| 1147 | self.rcrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#rc..coderust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeDecoder#code. |
| 1148 | } |
| 1149 | } |
| 1150 | |
| 1151 | impl<W: Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#> PPMd7rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#<RangeEncoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeEncoder#<W>> { |
| 1152 | pub(craterust-analyzer cargo ppmd-rust 1.2.1 crate/) fn new_encoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RangeEncoder<W>>`]new_encoder().( |
| 1153 | writer: W, |
| 1154 | order: u32, |
| 1155 | mem_size: u32, |
| 1156 | ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<PPMd7rust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#<RangeEncoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeEncoder#<W>>, Errorrust-analyzer cargo ppmd-rust 1.2.1 Error#> { |
| 1157 | let range_encoder = RangeEncoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeEncoder#::newrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/impl#[`RangeEncoder<W>`]new().(writer); |
| 1158 | Selfrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RangeEncoder<W>>`]::constructrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RC>`]construct().(range_encoder, order, mem_size) |
| 1159 | } |
| 1160 | |
| 1161 | pub(craterust-analyzer cargo ppmd-rust 1.2.1 crate/) fn into_innerrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RangeEncoder<W>>`]into_inner().(self) -> W { |
| 1162 | let manual_drop_self = ManuallyDroprust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/manually_drop/ManuallyDrop#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/manually_drop/impl#[`ManuallyDrop<T>`]new().(self); |
| 1163 | unsafe { |
| 1164 | deallocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc alloc/dealloc().( |
| 1165 | manual_drop_self.memory_ptrrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#memory_ptr..as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().(), |
| 1166 | manual_drop_self.memory_layoutrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#memory_layout., |
| 1167 | ); |
| 1168 | } |
| 1169 | let rc = unsafe { stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::readrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/read().(&manual_drop_self.rcrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#rc.) }; |
| 1170 | let RangeEncoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeEncoder# { writerrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/RangeEncoder#writer., .. } = rc; |
| 1171 | writer |
| 1172 | } |
| 1173 | |
| 1174 | pub(craterust-analyzer cargo ppmd-rust 1.2.1 crate/) fn flush_range_encoderrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/impl#[`PPMd7<RangeEncoder<W>>`]flush_range_encoder().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> { |
| 1175 | self.rcrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/PPMd7#rc..flushrust-analyzer cargo ppmd-rust 1.2.1 internal/ppmd7/range_coding/impl#[`RangeEncoder<W>`]flush().() |
| 1176 | } |
| 1177 | } |