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

call_inverse_func incorrectly shortens width #3258

Open
kornelski opened this issue Sep 30, 2023 · 2 comments
Open

call_inverse_func incorrectly shortens width #3258

kornelski opened this issue Sep 30, 2023 · 2 comments

Comments

@kornelski
Copy link
Contributor

kornelski commented Sep 30, 2023

If the input is a 2d array, then width.min(32) is inappropriate - it will cause a skew instead of narrowing the width. It needs to be something like input.chunks_exact(width).map(|row| &row[..width.min(32)]) to preserve the stride.

let input: &[T::Coeff] = &input[..width.min(32) * height.min(32)];

@barrbrain
Copy link
Collaborator

This is an example of a misleading comment. It is a precondition of call_inverse_func() that the stride of input is width.min(32).

@kornelski
Copy link
Contributor Author

kornelski commented Oct 26, 2023

Stride can't be shorter than the width? I assume you mean the width can't be > 32, but if I put debug_assert!(width <= 32), then these tests fail:

asm::shared::transform::inverse::test::inv_txfm2d_add_dct_dct_64x16
asm::shared::transform::inverse::test::inv_txfm2d_add_dct_dct_64x32
asm::shared::transform::inverse::test::inv_txfm2d_add_dct_dct_64x64

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

No branches or pull requests

2 participants