gstreamer/gst-libs/gst
Gwenole Beauchesne 3bc6078f32 mpeg2: optimize scan for start codes.
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.
2013-01-09 16:05:18 +01:00
..
codecparsers codecparsers: always build parserutils first. 2012-11-16 16:18:52 +01:00
vaapi mpeg2: optimize scan for start codes. 2013-01-09 16:05:18 +01:00
video Add videoutils submodule for GstVideoDecoder APIs. 2012-12-21 16:01:16 +01:00
Makefile.am Add videoutils submodule for GstVideoDecoder APIs. 2012-12-21 16:01:16 +01:00