A jpeg encoder implemented in C++