avfilter/vf_hflip: refactor plane dimensions calculation