Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\lzo\lzo1x_compress.c Create Date:2022-07-28 07:00:12
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lzo1x_1_do_compress

Proto:static noinline size_t lzo1x_1_do_compress(const unsigned char *in, size_t in_len, unsigned char *out, size_t *out_len, size_t ti, void *wrkmem, signed char *state_offset, const unsigned char bitstream_version)

Type:size_t

Parameter:

TypeParameterName
const unsigned char *in
size_tin_len
unsigned char *out
size_t *out_len
size_tti
void *wrkmem
signed char *state_offset
const unsigned charbitstream_version
29  in_end = in + in_len
30  ip_end = in + in_len - 20
32  dict = wrkmem
34  op = out
35  ip = in
36  ii = ip
37  ip += If ti < 4 Then 4 - ti Else 0
39  cycle
40  const unsigned char * m_pos = NULL
43  run_length = 0
44  literal :
45  ip += 1 + ( ip - ii >> 5)
46  :
47  If Value for the false possibility is greater at compile time(ip >= ip_end) Then Break
49  dv = get_unaligned_le32(ip)
51  If dv == 0 && bitstream_version Then
52  ir = ip + 4
53  limit = If ip_end < ip + MAX_ZERO_RUN_LENGTH + 1 Then ip_end Else ip + MAX_ZERO_RUN_LENGTH + 1
82  When ir < @a is a power of 2 value ((uintptr_t)ir, 4) && ir < limit && ir == 0 cycle
85  ir++
86  If IS_ALIGNED((uintptr_t)ir, 4) Then
87  When ir + 4 <= limit cycle
88  dv = *ir
89  If dv Then
91  ir += __builtin_ctz(dv) >> 3
97  Break
103  ir++
104  run_length = ir - ip
107  Else
108  t = dv * 0x1824429d >> 32 - D_BITS & D_MASK
109  m_pos = in + dict[t]
110  dict[t] = (lzo_dict_t)(ip - in)
115  ii -= ti
116  ti = 0
117  t = ip - ii
118  If t != 0 Then
119  If t <= 3 Then
120  op[ * state_offset] |= t
121  COPY4(op, ii)
122  op += t
123  Else if t <= 16 Then
124  op++ = t - 3
125  COPY8(op, ii)
126  COPY8(op + 8, ii + 8)
127  op += t
128  Else
129  If t <= 18 Then
130  op++ = t - 3
131  Else
132  tt = t - 18
133  op++ = 0
135  tt -= 255
136  op++ = 0
138  op++ = tt
140  Do
141  COPY8(op, ii)
142  COPY8(op + 8, ii + 8)
143  op += 16
144  ii += 16
145  t -= 16
146  When t >= 16 cycle
147  If t > 0 Then Do
148  op++ = ii++
149  When --t > 0 cycle
153  If Value for the false possibility is greater at compile time(run_length) Then
154  ip += run_length
155  run_length -= MIN_ZERO_RUN_LENGTH
156  put_unaligned_le32((run_length << 21) | 0xfffc18 | (run_length & 0x7), op)
158  op += 4
159  run_length = 0
160  state_offset = -3
161  Go to finished_writing_instruction
164  m_len = 4
213  Do
214  m_len += 1
215  If ip[m_len] != m_pos[m_len] Then Break
217  m_len += 1
218  If ip[m_len] != m_pos[m_len] Then Break
220  m_len += 1
221  If ip[m_len] != m_pos[m_len] Then Break
223  m_len += 1
224  If ip[m_len] != m_pos[m_len] Then Break
226  m_len += 1
227  If ip[m_len] != m_pos[m_len] Then Break
229  m_len += 1
230  If ip[m_len] != m_pos[m_len] Then Break
232  m_len += 1
233  If ip[m_len] != m_pos[m_len] Then Break
235  m_len += 1
238  When ip[m_len] == m_pos[m_len] cycle
242  m_len_done :
244  m_off = ip - m_pos
245  ip += m_len
246  If m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET Then
247  m_off -= 1
248  op++ = m_len - 1 << 5 | (m_off & 7) << 2
249  op++ = m_off >> 3
250  Else if m_off <= M3_MAX_OFFSET Then
251  m_off -= 1
252  If m_len <= M3_MAX_LEN Then op++ = M3_MARKER | m_len - 2
254  Else
255  m_len -= M3_MAX_LEN
256  op++ = M3_MARKER | 0
258  m_len -= 255
259  op++ = 0
261  op++ = m_len
263  op++ = m_off << 2
264  op++ = m_off >> 6
265  Else
266  m_off -= 0x4000
267  If m_len <= M4_MAX_LEN Then op++ = M4_MARKER | m_off >> 11 & 8 | m_len - 2
270  Else
271  m_len -= M4_MAX_LEN
272  op++ = M4_MARKER | m_off >> 11 & 8
274  m_len -= 255
275  op++ = 0
277  op++ = m_len
279  op++ = m_off << 2
280  op++ = m_off >> 6
282  state_offset = -2
283  finished_writing_instruction :
284  ii = ip
285  Go to next
287  out_len = op - out
288  Return in_end - ii - ti
Caller
NameDescribe
lzogeneric1x_1_compress