Implementation for the lossy JPEG codec pipeline