Figure 7: compressing zeroes

Sample output from 3r-simple.c:


Initial data:
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0

Encoding:
00001
[skipping 0]
0
[the remaining zeroes are skipped]
1
1
0
[the remaining zeroes are skipped]
[the remaining zeroes are skipped]

    Result: 9 bits
(including the header's fixed overhead)

Decoding:
00001
[skipping 0]
0
[skipping 0]
[skipping 0]
[skipping 0]
  [ 0] = 0000
  [ 1] = 0000
[skipping 0]
  [ 2] = 0000
  [ 3] = 0000
[skipping 0]
[skipping 0]
  [ 4] = 0000
  [ 5] = 0000
[skipping 0]
  [ 6] = 0000
  [ 7] = 0000
1
1
0
  [ 8] = 0000
  [ 9] = 0001
[skipping 0]
  [10] = 0000
  [11] = 0000
[skipping 0]
[skipping 0]
  [12] = 0000
  [13] = 0000
[skipping 0]
  [14] = 0000
  [15] = 0000

Decoded data:
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0