vout_subpictures: refactor code and use more const
On top of !4521 (merged) and !4522 (merged), only the last 7 commits matter.
On top of !4534 (merged), only the last 4 commits matter.
Split some code in functions to clarify things and make it more modular/flexible.
Edited by Steve Lhomme