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:15
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lzogeneric1x_1_compress

Proto:int lzogeneric1x_1_compress(const unsigned char *in, size_t in_len, unsigned char *out, size_t *out_len, void *wrkmem, const unsigned char bitstream_version)

Type:int

Parameter:

TypeParameterName
const unsigned char *in
size_tin_len
unsigned char *out
size_t *out_len
void *wrkmem
const unsigned charbitstream_version
295  ip = in
296  op = out
298  l = in_len
299  t = 0
300  state_offset = -2
305  If bitstream_version > 0 Then
306  op++ = 17
307  op++ = bitstream_version
308  m4_max_offset = M4_MAX_OFFSET_V1
309  Else
310  m4_max_offset = M4_MAX_OFFSET_V0
313  data_start = op
315  When l > 20 cycle
316  ll = If l <= m4_max_offset + 1 Then l Else m4_max_offset + 1
317  ll_end = ip + ll
318  If ll_end + ( t + ll >> 5) <= ll_end Then Break
320  BUILD_BUG_ON - break compile if a condition is true(D_SIZE * size of lzo_dict_t > LZO Public Kernel Interface* A mini subset of the LZO real-time data compression library* Copyright (C) 1996-2012 Markus F)
321  memset(wrkmem, 0, D_SIZE * size of lzo_dict_t )
322  t = lzo1x_1_do_compress(ip, ll, op, out_len, t, wrkmem, & state_offset, bitstream_version)
324  ip += ll
325  op += out_len
326  l -= ll
328  t += l
330  If t > 0 Then
331  ii = in + in_len - t
333  If op == data_start && t <= 238 Then
334  op++ = 17 + t
335  Else if t <= 3 Then
336  op[state_offset] |= t
337  Else if t <= 18 Then
338  op++ = t - 3
339  Else
340  tt = t - 18
341  op++ = 0
342  When tt > 255 cycle
343  tt -= 255
344  op++ = 0
346  op++ = tt
348  If t >= 16 Then Do
349  COPY8(op, ii)
350  COPY8(op + 8, ii + 8)
351  op += 16
352  ii += 16
353  t -= 16
354  When t >= 16 cycle
355  If t > 0 Then Do
356  op++ = ii++
357  When --t > 0 cycle
360  op++ = M4_MARKER | 1
361  op++ = 0
362  op++ = 0
364  out_len = op - out
365  Return Return values (< 0 = Error)
Caller
NameDescribe
lzo1x_1_compress
lzorle1x_1_compress