This is a standalone port of Jan Ondrus' jpeg model from paq8px.
- about 2x faster and compresses a little better than paq8px (likely due to paq main model producing bad predictions for huffman data).
- proper encapsulation (possible to use multiple instances at once, eg. for MT)
- no dynamic memory allocation
This version includes mpais' patch for subsampling and some changes for gcc compatibility ("using" directives etc).
Still needs -fpermissive to compile.
As usual, gcc can't parse templates and skips explicit alignment attributes with #pragma pack(1) set.
Also, had to disable train() inlining - worked incorrectly otherwise.
Works with up to gcc 6.3 like this, doesn't work with gcc7+ (crash).