Skip to content

Fix SumOfFrame for extremely wide frames#3958

Open
sprangerik wants to merge 1 commit into
cisco:masterfrom
sprangerik:super_duper_wide_screen
Open

Fix SumOfFrame for extremely wide frames#3958
sprangerik wants to merge 1 commit into
cisco:masterfrom
sprangerik:super_duper_wide_screen

Conversation

@sprangerik

Copy link
Copy Markdown
Contributor

When using very large strides (e.g. with wide resolutions like 21824x16), the value of 3 * kiRefStride exceeds 65535 and sets the 17th bit of r6.

Inside the loop, r6w is used to load a 16-bit value from memory. However, the 16-bit move does not clear the upper bits of r6, leaving the stale high bits from the stride calculation intact. This leads to incorrect index calculations when r6 is subsequently used.

This PR resolves the issue by using movzx to zero-extend the 16-bit load into r6d, ensuring the upper bits of the register are cleared.

@sprangerik

Copy link
Copy Markdown
Contributor Author

A workaround had to be added to meson.build because otherwise compilation of the gtest library failed. The correct fix there is probably just to uprev the gtest dependency.

Other than that this now passes the tests on all platforms and is ready for review.

@BenzhengZhang

Copy link
Copy Markdown
Collaborator

A workaround had to be added to meson.build because otherwise compilation of the gtest library failed. The correct fix there is probably just to uprev the gtest dependency.

Other than that this now passes the tests on all platforms and is ready for review.

The gtest dependency has been upgraded on master to fix the compiler failure, so the -Wno-uninitialized-const-pointer workaround is no longer needed. Could you please merge the latest master into your branch and drop that workaround? Thanks! @sprangerik

@sprangerik sprangerik force-pushed the super_duper_wide_screen branch 2 times, most recently from 1d0c0d9 to 247f9a6 Compare July 9, 2026 12:49
@sprangerik sprangerik force-pushed the super_duper_wide_screen branch from 247f9a6 to 1f0dced Compare July 9, 2026 13:04
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.

2 participants