Added support for encoding quality levels