mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
mpegvideoparse: accelerate search for start code
As the startcode always starts with 0x000001 some iterations can be skipped if values > 1 are detected. ~ 70% faster on HD video stream. https://bugzilla.gnome.org/show_bug.cgi?id=632130
This commit is contained in:
parent
9f4339c059
commit
96a7f9c8b1
1 changed files with 10 additions and 0 deletions
|
@ -108,6 +108,16 @@ mpeg_util_find_start_code (guint32 * sync_word, guint8 * cur, guint8 * end)
|
|||
return cur;
|
||||
}
|
||||
|
||||
/* accelerate search for start code */
|
||||
if (*cur > 1) {
|
||||
while (cur < (end - 4) && *cur > 1)
|
||||
if (cur[3] > 1)
|
||||
cur += 4;
|
||||
else
|
||||
cur++;
|
||||
code = 0xffffff00;
|
||||
}
|
||||
|
||||
/* Add the next available byte to the collected sync word */
|
||||
code |= *cur++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue