mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
3bc6078f32
Accelerate scan for start codes by skipping up to 3 bytes per iteration. A start code prefix is defined by the following bytes: 00 00 01. Thus, for any group of 3 bytes (xx yy zz), we have the following possible cases: 1. If zz != 1, this cannot be a start code, then skip 3 bytes; 2. If yy != 0, this cannot be a start code, then skip 2 bytes; 3. If xx != 0 or zz != 1, this cannot be a start code, then skip 1 byte; 4. xx == 00, yy == 00, zz == 1, we have match! This algorithm requires to peek bytes from the adapter. This increases the amount of bytes copied to a temporary buffer, but this process is much faster than scanning for all the bytes and using shift/masks. So, overall, this is a win. |
||
---|---|---|
.. | ||
codecparsers | ||
vaapi | ||
video | ||
Makefile.am |