restructure the yuv2rgb code