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

Create a path toward sharing memory from a numpy buffer #1061

Merged
merged 3 commits into from
Dec 25, 2023

Conversation

hmaarrfk
Copy link
Contributor

I know there is some concern about having the memory aligned.

I didn't know if it needed to be aligned to 16 bits, or 16 bytes.

If you know let me know which it is, I can add a check for it. If you don't want to support this, then that is fine too.

Closes: #1060

@hmaarrfk hmaarrfk force-pushed the from_buffer branch 3 times, most recently from 1c7415a to 615bfa5 Compare March 26, 2023 15:09
@hmaarrfk
Copy link
Contributor Author

hmaarrfk commented Apr 9, 2023

@jlaine I didn't ask but are you interested in something like this? I've been using it with quite a bit of success more recently, I can add checks for continuous buffers too if you want.

@hmaarrfk hmaarrfk force-pushed the from_buffer branch 2 times, most recently from 6c6d398 to 3fbb392 Compare April 9, 2023 21:20
@hmaarrfk
Copy link
Contributor Author

anycomments on the desire to even support this kind of feature?

@hmaarrfk hmaarrfk force-pushed the from_buffer branch 2 times, most recently from 9b176c7 to a78a054 Compare July 23, 2023 17:27
@hmaarrfk hmaarrfk force-pushed the from_buffer branch 2 times, most recently from e4da4df to 172d8a8 Compare November 10, 2023 16:12
@WyattBlue WyattBlue marked this pull request as ready for review November 24, 2023 02:51
This avoids the use of hstack, which inevitiably copies the data to a
new memory locaiton.

The speed up is small, but measurable.

I can go from 185 fps decoding of a ~3000 x 2000  video to 200 fps
decoding.
@hmaarrfk
Copy link
Contributor Author

I've rebased this. this is ready for review.

@WyattBlue
Copy link
Member

For the future, I'm okay with having numpy as a compile time dep if that meant PyAV was faster or smaller.

@WyattBlue WyattBlue merged commit 0afc238 into PyAV-Org:main Dec 25, 2023
17 checks passed
@hmaarrfk
Copy link
Contributor Author

For the future, I'm okay with having numpy as a compile time dep if that meant PyAV was faster or smaller.

Maybe we can discuss this in an issue

WyattBlue added a commit that referenced this pull request Feb 25, 2024
The YUV fastpath did not preserve the underlying byte-order,
which causes issues for applications that rely on it.
WyattBlue added a commit that referenced this pull request Feb 25, 2024
The YUV fastpath did not preserve the underlying byte-order,
which causes issues for applications that rely on it.
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.

Exposing frame buffer array
2 participants