003 File Manager
Current Path:
/usr/src/contrib/xz/src/liblzma/lzma
usr
/
src
/
contrib
/
xz
/
src
/
liblzma
/
lzma
/
📁
..
📄
fastpos.h
(3.9 KB)
📄
fastpos_table.c
(33.16 KB)
📄
fastpos_tablegen.c
(1.24 KB)
📄
lzma2_decoder.c
(7.4 KB)
📄
lzma2_decoder.h
(819 B)
📄
lzma2_encoder.c
(10.25 KB)
📄
lzma2_encoder.h
(1.16 KB)
📄
lzma_common.h
(6.78 KB)
📄
lzma_decoder.c
(26.68 KB)
📄
lzma_decoder.h
(1.52 KB)
📄
lzma_encoder.c
(18.08 KB)
📄
lzma_encoder.h
(1.57 KB)
📄
lzma_encoder_optimum_fast.c
(4.3 KB)
📄
lzma_encoder_optimum_normal.c
(22.74 KB)
📄
lzma_encoder_presets.c
(1.72 KB)
📄
lzma_encoder_private.h
(3.82 KB)
Editing: fastpos_tablegen.c
/////////////////////////////////////////////////////////////////////////////// // /// \file fastpos_tablegen.c /// \brief Generates the lzma_fastpos[] lookup table /// // Authors: Igor Pavlov // Lasse Collin // // This file has been put into the public domain. // You can do whatever you want with this file. // /////////////////////////////////////////////////////////////////////////////// #include <inttypes.h> #include <stdio.h> #include "fastpos.h" int main(void) { uint8_t fastpos[1 << FASTPOS_BITS]; const uint8_t fast_slots = 2 * FASTPOS_BITS; uint32_t c = 2; fastpos[0] = 0; fastpos[1] = 1; for (uint8_t slot_fast = 2; slot_fast < fast_slots; ++slot_fast) { const uint32_t k = 1 << ((slot_fast >> 1) - 1); for (uint32_t j = 0; j < k; ++j, ++c) fastpos[c] = slot_fast; } printf("/* This file has been automatically generated " "by fastpos_tablegen.c. */\n\n" "#include \"common.h\"\n" "#include \"fastpos.h\"\n\n" "const uint8_t lzma_fastpos[1 << FASTPOS_BITS] = {"); for (size_t i = 0; i < (1 << FASTPOS_BITS); ++i) { if (i % 16 == 0) printf("\n\t"); printf("%3u", (unsigned int)(fastpos[i])); if (i != (1 << FASTPOS_BITS) - 1) printf(","); } printf("\n};\n"); return 0; }
Upload File
Create Folder