-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix(ffmpeg_player): increase align to 32 #9166
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
Conversation
|
Hi 👋, thank you for your PR! We've run benchmarks in an emulated environment. Here are the results: ARM Emulated 32b - lv_conf_perf32b
Detailed Results Per Scene
ARM Emulated 64b - lv_conf_perf64b
Detailed Results Per Scene
Disclaimer: These benchmarks were run in an emulated environment using QEMU with instruction counting mode. 🤖 This comment was automatically generated by a bot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this and the many other great ffmpeg updates!
|
Upps, I just noticed that a test is failing. This is the incorrect screenshot: screenshot-errors-amd64 (2).zip The new alignment messes up with the image decoder part. |
You're right, I mainly used it for decoding videos before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the ffmpeg_image_allocate function to accept a configurable alignment parameter instead of using a hardcoded value of 4. The alignment value is now specified at the call site based on the use case.
- Added an
alignparameter toffmpeg_image_allocatefunction - Player code uses alignment of 32 for video playback
- Decoder code uses alignment of 4 for static image decoding
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you!
On my x86 computer, AV images aligned to 4 bytes cause memory corruption during sws_scale. This manifests as sigsegv errors, disrupting SDL2 functionality and other operations.
However, 32-byte alignment works without issues. I suspect this may be related to SIMD.
32-byte alignment has also been tested on my MIPS board and functions correctly.
Notes
lv_conf_template.hrun lv_conf_internal_gen.py and update Kconfig.scripts/code-format.py(astyle v3.4.12needs to installed by runningcd scripts; ./install_astyle.sh) and follow the Code Conventions.