Skip to content

Replace Arc<Vec<YCbCr422>> with Arc<[YCbCr422]> - #1912

Closed
oleflb wants to merge 1 commit into
HULKs:mainfrom
oleflb:remove-vec-from-ycbcr422
Closed

Replace Arc<Vec<YCbCr422>> with Arc<[YCbCr422]>#1912
oleflb wants to merge 1 commit into
HULKs:mainfrom
oleflb:remove-vec-from-ycbcr422

Conversation

@oleflb

@oleflb oleflb commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

Why? What?

YCbCr422 image had an unnecessary double indirection.

Fixes #

ToDo / Known Issues

If this is a WIP describe which problems are to be fixed.

Ideas for Next Iterations (Not This PR)

If there are some improvements that could be done in a next iteration, describe them here.

How to Test

  • CI takes care of that

@oleflb oleflb added the is:Cleanup Nothing new here, just tidying up. label Jul 9, 2025
@github-project-automation github-project-automation Bot moved this to Request for Review in Development Jul 9, 2025
@oleflb oleflb changed the title Replace Arc<Vec<YCbCr422>> with Arc<[YCbCr422]> Replace Arc<Vec<YCbCr422>> with Arc<[YCbCr422]> Jul 9, 2025
@oleflb
oleflb enabled auto-merge July 10, 2025 15:41
width_422,
height,
buffer: Arc::new(data),
buffer: Arc::from(data),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How does this behave with respect to copying? Is this just taking ownership and moving the pointers behind Vec?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this takes ownership. It's the same as Box<[u8; N]> but with an Arc

@schmidma

Copy link
Copy Markdown
Member

This does not work, as this From is copying every element into a newly allocated slice.

@schmidma schmidma closed this Jul 15, 2025
auto-merge was automatically disabled July 15, 2025 12:28

Pull request was closed

@github-project-automation github-project-automation Bot moved this from Request for Review to Done in Development Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

is:Cleanup Nothing new here, just tidying up.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants