Compression of xpilot recordings (xpr) using `xz'

Discussions related to other programs which are a part of BloodsPilot, e.g. xp-replay
Post Reply
Angeba
Posts: 88
Joined: Sun Feb 06, 2011 11:23 pm

Compression of xpilot recordings (xpr) using `xz'

Post by Angeba »

Xprs are usually compressed with the `gzip' tool.
The `bzip2' tool had generally worse (lower) compression ratios.
But the newer `xz' tool gives much better ratios than gzip.

I've created a small sh(-awk)-script, which was useful to do a quick analysis of my xpr collection. I'll attach it to this post for the interested audience. Here are some of my results:

total number of processed uncompressed bytes: 1.88977e+10 (about 17.6 GiB)
total number of processed sample xpr files: 560

### Compression ratio calculation and summary ###

lowest gzip ratio: 1.88181
lowest xz ratio: 2.77

highest gzip ratio: 73.3192
highest xz ratio: 125.332

average gzip ratio: 3.44946
average xz ratio: 5.80506


The xpilot replay programs do not have built-in support for xz compression.
Therefor you will have to decompress the file explicitly before playback.
On the fly (without creating a new file or modifying the xz compressed xpr) you can use:
xzcat recording.xpr.xz | bloodspilot-replay -


P.S.: Had to add a `.xp' suffix to the attachment to have it accepted by the board ...
Attachments
xpr-gzip-xz-comparison.sh.xp
shell-script for comparison of gzip and xz compression on xpilot recordings.
(3.48 KiB) Downloaded 323 times
Post Reply