refactor video_redraw to C