aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/fst/block_format.txt
blob: 0cab3a44370fc451edd23b3b9a0a031339b5aa7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
See fstapi.h for the values for the FST_BL_XXX enums.

===========================================================================

compressed wrapper (typically over whole file)

uint8_t		FST_BL_ZWRAPPER
uint64_t        section length
uint64_t        length of uncompressed data
[zlib compressed data]

===========================================================================

header block

uint8_t		FST_BL_HDR
uint64_t	section length
uint64_t	start time
uint64_t	end time
double		endian test for "e"
uint64_t	memory used by writer
uint64_t	scope creation count
uint64_t	var creation count
uint64_t	max var idcode
uint64_t	vc section count
int8_t		timescale exponent
[128 bytes]	version
[128 bytes]	date

===========================================================================

geometry block

uint8_t         FST_BL_GEOM
uint64_t        section length
uint64_t        length of uncompressed geometry data
uint64_t        maxhandle
[compressed data]

(length of compressed data is section length - 24)

===========================================================================

hierarchy block

uint8_t         FST_BL_HIER
uint64_t        section length
uint64_t        length of uncompressed hier data
[zlib compressed data]

or

uint8_t         FST_BL_HIER_LZ4
uint64_t        section length
uint64_t        length of uncompressed hier data
[lz4 compressed data]

uint8_t         FST_BL_HIER_LZ4DUO
uint64_t        section length
uint64_t        length of uncompressed hier data
varint		length of hier data compressed once with lz4
[lz4 double compressed data]


===========================================================================

dumpon/off block

uint8_t         FST_BL_BLACKOUT
uint64_t        section length
varint		num blackouts (section below is repeated this # times)
[
uint8_t		on/off (nonzero = on)
varint		delta time
]

===========================================================================

1..n value change blocks:

// header

uint8_t		FST_BL_VCDATA (or FST_BL_VCDATA_DYN_ALIAS)
uint64_t	section length
uint64_t	begin time of section
uint64_t	end time of section
uint64_t	amount of buffer memory required in reader for full vc traversal
varint		maxvalpos (length of uncompressed data)
varint		length of compressed data
varint		maxhandle associated with this checkpoint data
[compressed data]

---

// value changes

varint		maxhandle associated with the value change data
uint8_t		pack type ('F' is fastlz, '4' is lz4, 
			others ['Z'/'!'] are zlib)

varint		chain 0 compressed data length (0 = uncompressed)
[compressed data]	
...
varint		chain n compressed data length (0 = uncompressed)
[compressed data]	

---

// index: chain pointer table (from 0..maxhandle-1)

varint		if &1 == 1, this is <<1 literal delta
		if &1 == 0, this is <<1 RLE count of zeros
		if == 0, next varint is handle of prev chain to use,
			bit only if FST_BL_VCDATA_DYN_ALIAS or
			later VCDATA format

---

uint64_t	index length (subtract from here to get index position)

---

[compressed data for time section]
uint64_t	uncompressed data length in bytes
uint64_t	compressed data length in bytes
uint64_t	number of time items

// end of section

===========================================================================