libfor 整数压缩 C 语言库

程序名称:libfor

授权协议: Apache

操作系统: 跨平台

开发语言: C/C++

libfor 介绍

libfor 是一个 ANSI C 库,是参考框架(Frame Of Reference)整数压缩的快速标量实现。

libfor 可以压缩顺序或者乱序的数列,另外,此库可以在压缩数据上直接执行操作:

  • 选择:在指定索引处返回一个值;

  • 线性搜索:对于未排序数列,或者短排序数列

  • 下界搜索:对排序数列的二进制搜索

示例代码:

#define LEN 100
uint32_t in[LEN] = {0};
uint8_t out[512];

// Fill |in| with numbers of your choice
for (int i = 0; i < LEN; i++)
  in[i] = i;

// Now compress; can also use for_compress_sorted() if the numbers
// are sorted. This is slightly faster.
uint32_t size = for_compress_unsorted(&in[0], &out[0], LEN);
printf("compressing %u integers (%u bytes) into %u bytes\n",
        LEN, LEN * 4, size);

// Decompress again
uint32_t decompressed[LEN];
for_uncompress(&out[0], &decompressed[0], LEN);

libfor 官网

https://github.com/cruppstahl/for#libfor---fast-c-library-for-frame-of-reference-integer-compression

相关编程语言

Pacman 是一个软件包管理器, 作为 ArchLinux 发行版...
Smb4K 是KDE下的网络共享浏览器 更多屏幕截图请看:...
Wine (“Wine Is Not an Emulator” 的首字母缩写)...
虚拟桌面软件,可管理最多9个虚拟桌面,你可以用热键...
UNetbootin (Universal Netboot Installer)为一种跨...
Cobbler 可以用来快速建立 Linux 网络安装环境,它已...