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

QOA: Remove unnecessary memory allocation #95463

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

DeeJayLSP
Copy link
Contributor

@DeeJayLSP DeeJayLSP commented Aug 13, 2024

qoa_desc has a fixed size of 264 bytes, therefore no need to use a pointer.

*dec highly depends on the amount of channels and whether the result has more than 5120 samples per channel or not, so it remains variable.

This change shouldn't affect existing projects on vanilla Godot.

@DeeJayLSP
Copy link
Contributor Author

DeeJayLSP commented Aug 22, 2024

Would it be useful to turn *dec into a Vector<int16_t> or a LocalVector<int16_t> too? This way the entire QOA implementation would have zero memallocs (at least from the class' side).

The entire original implementation was based on the reference implementation, so I didn't think of it.

Edit: done in another PR

@akien-mga akien-mga modified the milestones: 4.x, 4.4 Aug 29, 2024
@akien-mga akien-mga merged commit 653a888 into godotengine:master Aug 30, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

4 participants