public void CompressBlock() { for (int i = 0; i < this.last_lit; i++) { int num = (int)(this.l_buf[i] & 255); int num2 = (int)this.d_buf[i]; if (num2-- != 0) { int num3 = DeflaterHuffman.Lcode(num); this.literalTree.WriteSymbol(num3); int num4 = (num3 - 261) / 4; if (num4 > 0 && num4 <= 5) { this.pending.WriteBits(num & (1 << num4) - 1, num4); } int num5 = DeflaterHuffman.Dcode(num2); this.distTree.WriteSymbol(num5); num4 = num5 / 2 - 1; if (num4 > 0) { this.pending.WriteBits(num2 & (1 << num4) - 1, num4); } } else { this.literalTree.WriteSymbol(num); } } this.literalTree.WriteSymbol(256); }
public bool TallyDist(int distance, int length) { this.d_buf[this.last_lit] = (short)distance; this.l_buf[this.last_lit++] = (byte)(length - 3); int num = DeflaterHuffman.Lcode(length - 3); short[] expr_45_cp_0 = this.literalTree.freqs; int expr_45_cp_1 = num; expr_45_cp_0[expr_45_cp_1] += 1; if (num >= 265 && num < 285) { this.extra_bits += (num - 261) / 4; } int num2 = DeflaterHuffman.Dcode(distance - 1); short[] expr_91_cp_0 = this.distTree.freqs; int expr_91_cp_1 = num2; expr_91_cp_0[expr_91_cp_1] += 1; if (num2 >= 4) { this.extra_bits += num2 / 2 - 1; } return(this.IsFull()); }
public bool TallyDist(int distance, int length) { this.d_buf[this.last_lit] = (short)distance; this.l_buf[this.last_lit++] = (byte)(length - 3); int num = DeflaterHuffman.Lcode(length - 3); short[] freqs = this.literalTree.freqs; int num2 = num; freqs[num2] += 1; if (num >= 265 && num < 285) { this.extra_bits += (num - 261) / 4; } int num3 = DeflaterHuffman.Dcode(distance - 1); short[] freqs2 = this.distTree.freqs; int num4 = num3; freqs2[num4] += 1; if (num3 >= 4) { this.extra_bits += num3 / 2 - 1; } return(this.IsFull()); }