cleanup/rewrite rgb->YV12 code/copypasta.

note adjustment of rgb->yuv conversion; this one seems more right visually (tested by eog'ing result img->save_png_fn() next to paused video window) both it's pretty hard to tell. as a bonus it seems more consistent with the yuv->rgb code now ...