README_HEADER.rst 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Blosc Header Format
  2. ===================
  3. Blosc (as of Version 1.0.0) has the following 16 byte header that stores
  4. information about the compressed buffer::
  5. |-0-|-1-|-2-|-3-|-4-|-5-|-6-|-7-|-8-|-9-|-A-|-B-|-C-|-D-|-E-|-F-|
  6. ^ ^ ^ ^ | nbytes | blocksize | ctbytes |
  7. | | | |
  8. | | | +--typesize
  9. | | +------flags
  10. | +----------versionlz
  11. +--------------version
  12. Datatypes of the Header Entries
  13. -------------------------------
  14. All entries are little endian.
  15. :version:
  16. (``uint8``) Blosc format version.
  17. :versionlz:
  18. (``uint8``) Version of the internal compressor used.
  19. :flags and compressor enumeration:
  20. (``bitfield``) The flags of the buffer
  21. :bit 0 (``0x01``):
  22. Whether the byte-shuffle filter has been applied or not.
  23. :bit 1 (``0x02``):
  24. Whether the internal buffer is a pure memcpy or not.
  25. :bit 2 (``0x04``):
  26. Whether the bit-shuffle filter has been applied or not.
  27. :bit 3 (``0x08``):
  28. Reserved, must be zero.
  29. :bit 4 (``0x10``):
  30. If set, the blocks will not be split in sub-blocks during compression.
  31. :bit 5 (``0x20``):
  32. Part of the enumeration for compressors.
  33. :bit 6 (``0x40``):
  34. Part of the enumeration for compressors.
  35. :bit 7 (``0x80``):
  36. Part of the enumeration for compressors.
  37. The last three bits form an enumeration that allows to use alternative
  38. compressors.
  39. :``0``:
  40. ``blosclz``
  41. :``1``:
  42. ``lz4`` or ``lz4hc``
  43. :``2``:
  44. ``snappy``
  45. :``3``:
  46. ``zlib``
  47. :``4``:
  48. ``zstd``
  49. :typesize:
  50. (``uint8``) Number of bytes for the atomic type.
  51. :nbytes:
  52. (``uint32``) Uncompressed size of the buffer.
  53. :blocksize:
  54. (``uint32``) Size of internal blocks.
  55. :ctbytes:
  56. (``uint32``) Compressed size of the buffer.