Lines Matching full:lzma

15  * Range decoder initialization eats the first five bytes of each LZMA chunk.
20 * Minimum number of usable input buffer to safely decode one LZMA symbol.
139 /* Types of the most recently seen LZMA symbols */
149 * LZMA properties or related bit masks (number of literal
231 /* Uncompressed size of LZMA chunk (2 MiB at maximum) */
235 * Compressed size of LZMA chunk or compressed/uncompressed
242 * the first chunk (LZMA or uncompressed).
247 * True if new LZMA properties are needed. This is false
248 * before the first LZMA chunk.
261 * including lzma.pos_mask are in the first 128 bytes on x86-32,
270 struct lzma_dec lzma; member
502 * we have reached the end of the LZMA chunk.
521 * an extra branch. In this particular version of the LZMA decoder, this
600 * LZMA *
607 uint32_t low = prev_byte >> (8 - s->lzma.lc); in lzma_literal_probs()
608 uint32_t high = (s->dict.pos & s->lzma.literal_pos_mask) << s->lzma.lc; in lzma_literal_probs()
609 return s->lzma.literal[low + high]; in lzma_literal_probs()
624 if (lzma_state_is_literal(s->lzma.state)) { in lzma_literal()
628 match_byte = dict_get(&s->dict, s->lzma.rep0) << 1; in lzma_literal()
647 lzma_state_literal(&s->lzma.state); in lzma_literal()
650 /* Decode the length of the match into s->lzma.len. */
660 s->lzma.len = MATCH_LEN_MIN; in lzma_len()
665 s->lzma.len = MATCH_LEN_MIN + LEN_LOW_SYMBOLS; in lzma_len()
669 s->lzma.len = MATCH_LEN_MIN + LEN_LOW_SYMBOLS in lzma_len()
674 s->lzma.len += rc_bittree(&s->rc, probs, limit) - limit; in lzma_len()
677 /* Decode a match. The distance will be stored in s->lzma.rep0. */
684 lzma_state_match(&s->lzma.state); in lzma_match()
686 s->lzma.rep3 = s->lzma.rep2; in lzma_match()
687 s->lzma.rep2 = s->lzma.rep1; in lzma_match()
688 s->lzma.rep1 = s->lzma.rep0; in lzma_match()
690 lzma_len(s, &s->lzma.match_len_dec, pos_state); in lzma_match()
692 probs = s->lzma.dist_slot[lzma_get_dist_state(s->lzma.len)]; in lzma_match()
696 s->lzma.rep0 = dist_slot; in lzma_match()
699 s->lzma.rep0 = 2 + (dist_slot & 1); in lzma_match()
702 s->lzma.rep0 <<= limit; in lzma_match()
703 probs = s->lzma.dist_special + s->lzma.rep0 in lzma_match()
706 &s->lzma.rep0, limit); in lzma_match()
708 rc_direct(&s->rc, &s->lzma.rep0, limit - ALIGN_BITS); in lzma_match()
709 s->lzma.rep0 <<= ALIGN_BITS; in lzma_match()
710 rc_bittree_reverse(&s->rc, s->lzma.dist_align, in lzma_match()
711 &s->lzma.rep0, ALIGN_BITS); in lzma_match()
718 * seen matches. The distance will be stored in s->lzma.rep0.
724 if (!rc_bit(&s->rc, &s->lzma.is_rep0[s->lzma.state])) { in lzma_rep_match()
725 if (!rc_bit(&s->rc, &s->lzma.is_rep0_long[ in lzma_rep_match()
726 s->lzma.state][pos_state])) { in lzma_rep_match()
727 lzma_state_short_rep(&s->lzma.state); in lzma_rep_match()
728 s->lzma.len = 1; in lzma_rep_match()
732 if (!rc_bit(&s->rc, &s->lzma.is_rep1[s->lzma.state])) { in lzma_rep_match()
733 tmp = s->lzma.rep1; in lzma_rep_match()
735 if (!rc_bit(&s->rc, &s->lzma.is_rep2[s->lzma.state])) { in lzma_rep_match()
736 tmp = s->lzma.rep2; in lzma_rep_match()
738 tmp = s->lzma.rep3; in lzma_rep_match()
739 s->lzma.rep3 = s->lzma.rep2; in lzma_rep_match()
742 s->lzma.rep2 = s->lzma.rep1; in lzma_rep_match()
745 s->lzma.rep1 = s->lzma.rep0; in lzma_rep_match()
746 s->lzma.rep0 = tmp; in lzma_rep_match()
749 lzma_state_long_rep(&s->lzma.state); in lzma_rep_match()
750 lzma_len(s, &s->lzma.rep_len_dec, pos_state); in lzma_rep_match()
753 /* LZMA decoder core */
762 if (dict_has_space(&s->dict) && s->lzma.len > 0) in lzma_main()
763 dict_repeat(&s->dict, &s->lzma.len, s->lzma.rep0); in lzma_main()
766 * Decode more LZMA symbols. One iteration may consume up to in lzma_main()
770 pos_state = s->dict.pos & s->lzma.pos_mask; in lzma_main()
772 if (!rc_bit(&s->rc, &s->lzma.is_match[ in lzma_main()
773 s->lzma.state][pos_state])) { in lzma_main()
776 if (rc_bit(&s->rc, &s->lzma.is_rep[s->lzma.state])) in lzma_main()
781 if (!dict_repeat(&s->dict, &s->lzma.len, s->lzma.rep0)) in lzma_main()
796 * Reset the LZMA decoder and range decoder state. Dictionary is not reset
797 * here, because LZMA state may be reset without resetting the dictionary.
804 s->lzma.state = STATE_LIT_LIT; in lzma_reset()
805 s->lzma.rep0 = 0; in lzma_reset()
806 s->lzma.rep1 = 0; in lzma_reset()
807 s->lzma.rep2 = 0; in lzma_reset()
808 s->lzma.rep3 = 0; in lzma_reset()
809 s->lzma.len = 0; in lzma_reset()
820 probs = s->lzma.is_match[0]; in lzma_reset()
828 * Decode and validate LZMA properties (lc/lp/pb) and calculate the bit masks
829 * from the decoded lp and pb values. On success, the LZMA decoder state is
837 s->lzma.pos_mask = 0; in lzma_props()
840 ++s->lzma.pos_mask; in lzma_props()
843 s->lzma.pos_mask = (1 << s->lzma.pos_mask) - 1; in lzma_props()
845 s->lzma.literal_pos_mask = 0; in lzma_props()
848 ++s->lzma.literal_pos_mask; in lzma_props()
851 s->lzma.lc = props; in lzma_props()
853 if (s->lzma.lc + s->lzma.literal_pos_mask > 4) in lzma_props()
856 s->lzma.literal_pos_mask = (1 << s->lzma.literal_pos_mask) - 1; in lzma_props()
868 * The LZMA decoder assumes that if the input limit (s->rc.in_limit) hasn't
870 * wrapper function takes care of making the LZMA decoder's assumption safe.
872 * As long as there is plenty of input left to be decoded in the current LZMA
961 * Take care of the LZMA2 control layer, and forward the job of actual LZMA
983 * reset, followed by LZMA compressed chunk in xz_dec_lzma2_run()
985 * by LZMA compressed chunk (no dictionary in xz_dec_lzma2_run()
988 * followed by LZMA compressed chunk (no in xz_dec_lzma2_run()
990 * 0x80 LZMA chunk (no dictionary or state reset) in xz_dec_lzma2_run()
992 * For LZMA compressed chunks, the lowest five bits in xz_dec_lzma2_run()
997 * reset. The first LZMA chunk must set new in xz_dec_lzma2_run()
998 * properties and reset the LZMA state. in xz_dec_lzma2_run()
1112 if (s->lzma2.compressed > 0 || s->lzma.len > 0 in xz_dec_lzma2_run()
1276 if (s->lzma2.compressed > 0 || s->lzma.len > 0 in xz_dec_microlzma_run()