Research JPEG encoder