Found an even daster way to encode signed numbers for short number of bits.
treea80f45e4c5fade39c8d43ba3d500496fbf1c7ce3
-rw-r--r-- 153 .gitignore
-rw-r--r-- 71 Makefile
-rw-r--r-- 265 README
drwxr-xr-x - doc
drwxr-xr-x - exp
drwxr-xr-x - include
drwxr-xr-x - perf
drwxr-xr-x - sql
drwxr-xr-x - test