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

Alloc a single array for all planar stuff. #66

Closed
wants to merge 11 commits into from
Closed

Conversation

toots
Copy link
Member

@toots toots commented Oct 19, 2024

This PR optimizes swscale in two ways:

Make sure that we allocate the right amount of memory for all planes.

We were not taking sub-sampling into account when allocating planes, resulting in memory allocations that were too big.

Allocate all planes in a single memory region

This makes it possible to e.g. pass a single pointer to APIs that expect planar formats to be a single memory pointer without having to do copies

With liquidsoap, I noticed a serious drop in memory used during video operations:

Before

Screenshot 2024-10-19 at 10 43 52 AM

After

Screenshot 2024-10-19 at 10 45 53 AM

The relevant part is the private memory.

@toots toots force-pushed the pack-swscale-ba branch 2 times, most recently from b103aaf to 4d82d5a Compare October 19, 2024 22:39
@toots toots closed this Oct 20, 2024
@toots toots deleted the pack-swscale-ba branch October 20, 2024 16:41
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

Successfully merging this pull request may close these issues.

1 participant