swscale: use a function for isGray