Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using boyer-more algorithm to optimize start code scanning #36

Open
ndufresne opened this issue Apr 24, 2023 · 1 comment
Open

Comments

@ndufresne
Copy link

In

size_t VulkanVideoDecoder::next_start_code(const uint8_t *pdatain, size_t datasize, bool& found_start_code)
it seems the scanner will read every bytes of the stream. This is commonly optimized with a reduce Boyer-More algorithm, allowing to read only a third of the bytes.

An example can be found here: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gstreamer/libs/gst/base/gstbytereader.c#L865 which has been reduced from https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string-search_algorithm

@ndufresne ndufresne changed the title Consider using boyer-more alogorithm to optimize start code scanning Consider using boyer-more algorithm to optimize start code scanning Apr 24, 2023
@zlatinski
Copy link
Contributor

Thank you for bringing this parser performance issue to our attention, Nicolas. We are already aware of this issue and have an internal task (not started yet) to address it.
We would also gladly take code contributions to the parser :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants