mirror of
https://github.com/samsonjs/media.git
synced 2026-03-30 10:15:48 +00:00
I'm not really a fan of micro-optimizations, but given this method scans through every H264 frame in the HLS case, it seems worthwhile. The trick here is to examine the first 7 bits of the third byte first. If they're not all 0s, then we know that we haven't found a NAL unit, and also that we wont find one at the next two positions. This allows the loop to increment 3 bytes at a time. Speedup is around 60% on Art according to some ad-hoc benchmarking. |
||
|---|---|---|
| .. | ||
| exoplayer | ||