some optimization in fill_yuv_image