however, old algorithm scan each byte one by one, and has bad efficiency, 90Mbps from test.
If skip by size of one ts packet during the parsing, it increase a lot the efficiency, about 1500Mbps from test.
A fact, that most streams sequence header and picture header are located in the first two ts packets when playload_start_indicator is set in ts header.
I had programmed a tool and scan many streams, and got such result at last.
Then this PR will adopt this fact, also find the way to cover those streams beyond the assumpation.
The new algorithm, first skip bytes one by one as old algorithm, we have a counter(matchcount), when we located a header and satify the assumption, increase matchcount by one, else clear it to zero.
if matchcount reach a value, such as 10, enable skip by ts packet size each step, during this, we compare frame count between two sequence header, if the increase number less then a value, such as 2, it means, the new algothrim miss some frames during parsing, then switch back to old mechanism.