Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: : nb of bytes read from src (< srcSize )

Proto:size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx *dctx, const void *src, size_t srcSize)

Type:size_t

Parameter:

TypeParameterName
ZSTD_DCtx *dctx
const void *src
size_tsrcSize

Brief:! ZSTD_decodeLiteralsBlock() :

434  If srcSize < r a non-null block Then Return -***************************************** Error codes handling(corruption_detected)
438  istart = src
439  litEncType = istart[0] & 3
442  Case litEncType == set_repeat
446  Case litEncType == set_compressed
451  singleStream = 0
452  lhlCode = istart[0] >> 2 & 3
455  Case lhlCode == 0
456  Case lhlCode == 1
457  Default
459  singleStream = Not lhlCode
460  lhSize = 3
461  litSize = lhc >> 4 & 0x3FF
462  litCSize = lhc >> 14 & 0x3FF
463  Break
464  Case lhlCode == 2
466  lhSize = 4
467  litSize = lhc >> 4 & 0x3FFF
468  litCSize = lhc >> 18
469  Break
470  Case lhlCode == 3
472  lhSize = 5
473  litSize = lhc >> 4 & 0x3FFFF
474  litCSize = (lhc >> 22) + (istart[4] << 10)
475  Break
493  litPtr = litBuffer
494  litSize = litSize
495  litEntropy = 1
499  Return litCSize + lhSize
502  Case litEncType == set_basic
504  lhlCode = istart[0] >> 2 & 3
506  Case lhlCode == 0
507  Case lhlCode == 2
508  Default
509  lhSize = 1
510  litSize = istart[0] >> 3
511  Break
512  Case lhlCode == 1
513  lhSize = 2
515  Break
516  Case lhlCode == 3
517  lhSize = 3
518  litSize = ZSTD_readLE24(istart) >> 4
519  Break
526  litPtr = litBuffer
527  litSize = litSize
529  Return lhSize + litSize
532  litPtr = istart + lhSize
533  litSize = litSize
534  Return lhSize + litSize
537  Case litEncType == set_rle
538  lhlCode = istart[0] >> 2 & 3
541  Case lhlCode == 0
542  Case lhlCode == 2
543  Default
544  lhSize = 1
545  litSize = istart[0] >> 3
546  Break
547  Case lhlCode == 1
548  lhSize = 2
550  Break
551  Case lhlCode == 3
552  lhSize = 3
553  litSize = ZSTD_readLE24(istart) >> 4
556  Break
558  If litSize > Define for static allocation Then Return -***************************************** Error codes handling(corruption_detected)
560  memset(litBuffer, istart[lhSize], litSize + ! ZSTD_wildcopy() :* custom version of memcpy(), can copy up to 7 bytes too many (8 bytes if length==0) )
561  litPtr = litBuffer
562  litSize = litSize
563  Return lhSize + 1
565  Default
566  Return -***************************************** Error codes handling(corruption_detected)
Caller
NameDescribe
ZSTD_decompressBlock_internal