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

Backport memory optimization for palette mode from dav1d 1.3.0 #838

Merged
merged 7 commits into from
Mar 29, 2024

Conversation

fbossen
Copy link
Collaborator

@fbossen fbossen commented Mar 18, 2024

Allocate memory for palette mode according to bit depth of pixel instead of fixed u16 size.

Copy link
Collaborator

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, still reviewing though.

src/internal.rs Outdated Show resolved Hide resolved
src/internal.rs Show resolved Hide resolved
src/recon.rs Outdated Show resolved Hide resolved
src/recon.rs Outdated Show resolved Hide resolved
src/internal.rs Outdated Show resolved Hide resolved
src/recon.rs Outdated Show resolved Hide resolved
src/recon.rs Outdated Show resolved Hide resolved
src/recon.rs Outdated Show resolved Hide resolved
src/recon.rs Outdated Show resolved Hide resolved
src/recon.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@randomPoison randomPoison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The translations of the C changes to Rust look correct to me. I didn't see an obvious source for the CI test failures though. I'll give this a final approval once CI has been fixed.

src/recon_tmpl.c Show resolved Hide resolved
@fbossen fbossen force-pushed the bp-1.3.0-pal branch 3 times, most recently from 3e7df7c to ef966f2 Compare March 27, 2024 20:30
@fbossen
Copy link
Collaborator Author

fbossen commented Mar 27, 2024

Left some comments, still reviewing though.

@kkysen Have you had a chance to look at it some more?

@kkysen kkysen self-requested a review March 28, 2024 01:08
Copy link
Collaborator

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still looking into the generic alignment issue. Also, I'm assuming the large functions were just moved. The rest looks good except for a couple comments I made. Sorry I forgot to review this again; I know there've been a bunch of merge conflicts.

src/internal.rs Outdated Show resolved Hide resolved
src/internal.rs Outdated Show resolved Hide resolved
src/internal.rs Outdated Show resolved Hide resolved
gramner-twoorioles and others added 7 commits March 28, 2024 21:03
Reduces memory usage by 6 kB per sb128 in 8bpc streams that
uses screen content tools when frame-threading is enabled.
`Rav1dTaskContext_scratch` is already aligned
Copy link
Collaborator

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'll follow-up on how we can improve the alignment stuff, but this way is definitely good enough for now.

@kkysen kkysen merged commit 0521463 into memorysafety:main Mar 29, 2024
18 checks passed
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.

4 participants