MTF 当前定义了一种基于 Stac Technologies LZS221 compression libraries 数据压缩算法。 LZS221压缩算法的定义是为了提供支持生产环境的磁带切换的软件压缩 流。 它假设了你已经知道如何使用 LZS221 compression libraries 进行工作。
名称 | 说明 | 值 |
---|---|---|
MTF_LZS221 | Stac Technologies LZS221 | 0x0ABE |
数据集中的 Common Block Headers 需要设置来表明会出现压缩流。 需要设置 Block Attributes 字段的 MTF_COMPRESSION 比特以及 Software Compression Algorithm 需要设为 0x0ABE。
注意:压缩不能用于 End of Set(MTF_ESET)的数据流。
在 Stream Header 的 Stream Tape Format Attributes 字段设置 STREAM_COMPRESSED 比特以及设置 Data Compression Algorith 字段为 0x0ABE 来表示这个流是压缩的。 如果压缩流是变长的(STREAM_VARIABLE)所有组成变长流的 Stream Headers 都需要指定使用压缩。 当启用压缩,所有的流数据都必须被 Compression Frame Headers 封装。
The size of the buffers used by the Compress and Decompress routines are provided in the table below.
名称 | 说明 | 大小 |
---|---|---|
src | Source buffer | 62 1024 |
dst | Destination buffer | (62 1024) + 32 |
scratchRAM | Scratch buffer used by LZS221. This is defined in the LZS221 header file. | LZS_HISTORY_SIZE |
LZS221 compression library 定义了压缩 API。 未压缩的数据通过 src buffer 传进,而压缩后数据通过 dst buffer 返回。 以下的原型来自于 LZS221-86 compression library。
extern void OS2_API Compress(char **src,
char **dst,
unsigned long *srcCnt,
unsigned long *dstCnt,
char *scratchRAM);
LZS221 compression library 定义了解压 API。 压缩后的数据通过 src buffer 传进,而解缩后数据通过 dst buffer 返回。 以下的原型来自于 LZS221-86 compression library。
extern int OS2_API Decompress(char **src,
char **dst,
unsigned long *srcCnt,
unsigned long *dstCnt,
char *scratchRAM);
The following compress and decompress pseudo code integrates into the LZS221-86 compression library and is provided to assist in development.
代码略