函数逻辑报告 |
Source Code:lib\zstd\compress.c |
Create Date:2022-07-27 08:00:53 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:ZSTD_compressSequences_internal
函数原型:ZSTD_STATIC size_t ZSTD_compressSequences_internal(ZSTD_CCtx *zc, void *dst, size_t dstCapacity)
返回类型:size_t
参数:
类型 | 参数 | 名称 |
---|---|---|
ZSTD_CCtx * | zc | |
void * | dst | |
size_t | dstCapacity |
589 | seqStorePtr等于seqStore的地址 |
594 | sequences等于sequencesStart |
595 | ofCodeTable等于ofCode |
596 | llCodeTable等于llCode |
597 | mlCodeTable等于mlCode |
599 | oend等于ostart加dstCapacity |
601 | nbSeq等于sequences减sequencesStart |
607 | workspaceSize等于tmpCounters的长度 |
609 | spaceUsed32等于0 |
610 | count等于tmpCounters加spaceUsed32 |
612 | norm等于tmpCounters加spaceUsed32 |
613 | spaceUsed32加等于@a is a power of 2 value (sizeof(S16) * (Assumption : MaxOff < MaxLL,MaxML + 1), sizeof(U32))右移2位 |
616 | workspaceSize减等于spaceUsed32左移2位 |
623 | cSize等于ZSTD_compressLiterals(zc, op, dstCapacity, literals, litSize) |
630 | 如果oend减op小于3加1则返回:-***************************************** Error codes handling(dstSize_tooSmall) |
653 | mostFrequent等于FSE_countFast_wksp() :* Same as FSE_countFast(), but using an externally provided scratch buffer.* `workSpace` size must be table of >= `1024` unsigned |
654 | 如果mostFrequent恒等于nbSeq且nbSeq大于2则 |
658 | 否则如果flagStaticTables且nbSeq小于MAX_SEQ_FOR_STATIC_FSE则 |
659 | LLtype等于set_repeat |
660 | 否则如果nbSeq小于seqHead : flags for FSE encoding type 或mostFrequent小于nbSeq右移LL_defaultNormLog减1位则 |
663 | 否则 |
665 | tableLog等于FSE_optimalTableLog(LLFSELog, nbSeq, max) |
666 | 如果count[llCodeTable[nbSeq - 1]]大于1则 |
667 | count[llCodeTable[nbSeq - 1]]自减 |
668 | nbSeq_1自减 |
672 | NCountSize等于FSE_writeNCount(op, oend - op, norm, max, tableLog) |
673 | 如果Error Management 则返回:NCountSize |
675 | op加等于NCountSize |
678 | LLtype等于set_compressed |
685 | mostFrequent等于FSE_countFast_wksp() :* Same as FSE_countFast(), but using an externally provided scratch buffer.* `workSpace` size must be table of >= `1024` unsigned |
686 | 如果mostFrequent恒等于nbSeq且nbSeq大于2则 |
687 | op自加等于ofCodeTable[0] |
690 | 否则如果flagStaticTables且nbSeq小于MAX_SEQ_FOR_STATIC_FSE则 |
691 | Offtype等于set_repeat |
692 | 否则如果nbSeq小于seqHead : flags for FSE encoding type 或mostFrequent小于nbSeq右移OF_defaultNormLog减1位则 |
695 | 否则 |
697 | tableLog等于FSE_optimalTableLog(OffFSELog, nbSeq, max) |
698 | 如果count[ofCodeTable[nbSeq - 1]]大于1则 |
699 | count[ofCodeTable[nbSeq - 1]]自减 |
700 | nbSeq_1自减 |
704 | NCountSize等于FSE_writeNCount(op, oend - op, norm, max, tableLog) |
705 | 如果Error Management 则返回:NCountSize |
707 | op加等于NCountSize |
710 | Offtype等于set_compressed |
717 | mostFrequent等于FSE_countFast_wksp() :* Same as FSE_countFast(), but using an externally provided scratch buffer.* `workSpace` size must be table of >= `1024` unsigned |
718 | 如果mostFrequent恒等于nbSeq且nbSeq大于2则 |
722 | 否则如果flagStaticTables且nbSeq小于MAX_SEQ_FOR_STATIC_FSE则 |
723 | MLtype等于set_repeat |
724 | 否则如果nbSeq小于seqHead : flags for FSE encoding type 或mostFrequent小于nbSeq右移ML_defaultNormLog减1位则 |
727 | 否则 |
729 | tableLog等于FSE_optimalTableLog(MLFSELog, nbSeq, max) |
730 | 如果count[mlCodeTable[nbSeq - 1]]大于1则 |
731 | count[mlCodeTable[nbSeq - 1]]自减 |
732 | nbSeq_1自减 |
736 | NCountSize等于FSE_writeNCount(op, oend - op, norm, max, tableLog) |
737 | 如果Error Management 则返回:NCountSize |
739 | op加等于NCountSize |
742 | MLtype等于set_compressed |
747 | flagStaticTables等于0 |
762 | BIT_addBits( & blockStream, litLength, LL_bits[llCodeTable[nbSeq - 1]]) |
763 | 如果-*************************************************************** Memory I/O则BIT_flushBits( & blockStream) |
765 | BIT_addBits( & blockStream, matchLength, ML_bits[mlCodeTable[nbSeq - 1]]) |
766 | 如果-*************************************************************** Memory I/O则BIT_flushBits( & blockStream) |
768 | 如果longOffsets则 |
769 | ofBits等于ofCodeTable[nbSeq - 1] |
770 | extraBits等于ofBits减-************************************** shared macros(ofBits, STREAM_ACCUMULATOR_MIN - 1) |
771 | 如果extraBits则 |
772 | BIT_addBits( & blockStream, offset, extraBits) |
773 | BIT_flushBits( & blockStream) |
775 | BIT_addBits( & blockStream, offset >> extraBits, ofBits - extraBits) |
776 | 否则 |
777 | BIT_addBits( & blockStream, offset, ofCodeTable[nbSeq - 1]) |
779 | BIT_flushBits( & blockStream) |
784 | llCode等于llCodeTable[n] |
785 | ofCode等于ofCodeTable[n] |
786 | mlCode等于mlCodeTable[n] |
791 | FSE_encodeSymbol( & blockStream, & stateOffsetBits, ofCode) |
792 | FSE_encodeSymbol( & blockStream, & stateMatchLength, mlCode) |
793 | 如果-*************************************************************** Memory I/O则BIT_flushBits( & blockStream) |
795 | FSE_encodeSymbol( & blockStream, & stateLitLength, llCode) |
796 | 如果-*************************************************************** Memory I/O或ofBits加mlBits加llBits大于等于64减7减LLFSELog加MLFSELog加OffFSELog则BIT_flushBits( & blockStream) |
798 | BIT_addBits( & blockStream, litLength, llBits) |
799 | 如果-*************************************************************** Memory I/O且llBits加mlBits大于24则BIT_flushBits( & blockStream) |
801 | BIT_addBits( & blockStream, matchLength, mlBits) |
802 | 如果-*************************************************************** Memory I/O则BIT_flushBits( & blockStream) |
804 | 如果longOffsets则 |
805 | extraBits等于ofBits减-************************************** shared macros(ofBits, STREAM_ACCUMULATOR_MIN - 1) |
806 | 如果extraBits则 |
807 | BIT_addBits( & blockStream, offset, extraBits) |
808 | BIT_flushBits( & blockStream) |
810 | BIT_addBits( & blockStream, offset >> extraBits, ofBits - extraBits) |
811 | 否则 |
812 | BIT_addBits( & blockStream, offset, ofBits) |
814 | BIT_flushBits( & blockStream) |
818 | FSE_flushCState( & blockStream, & stateMatchLength) |
819 | FSE_flushCState( & blockStream, & stateOffsetBits) |
820 | FSE_flushCState( & blockStream, & stateLitLength) |
823 | streamSize等于BIT_closeCStream( & blockStream) |
824 | 如果streamSize恒等于0则返回:-***************************************** Error codes handling(dstSize_tooSmall) |
826 | op加等于streamSize |
名称 | 描述 |
---|---|
ZSTD_compressSequences |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |