libopenjpegenc: Simplify gray encoding.