This will be used later in both the mpeg2_metadata filter and the VAAPI MPEG-2 encoder. Also adds a unit test. (cherry picked from commit b5859e0b04)
b5859e0b04