-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat(image_decoder): add webp decoder #9175
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
base: master
Are you sure you want to change the base?
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.
3 issues found across 24 files
Prompt for AI agents (all 3 issues)
Understand the root cause of the following 3 issues and fix them.
<file name="docs/src/details/libs/libwebp.rst">
<violation number="1" location="docs/src/details/libs/libwebp.rst:42">
Link the WebP libraries to the `lvgl` target so the dependency follows LVGL; otherwise shared builds or other consumers miss the WebP symbols.</violation>
</file>
<file name="examples/libs/libwebp/index.rst">
<violation number="1" location="examples/libs/libwebp/index.rst:2">
The heading underline is shorter than the title text, which causes a "Title underline too short" error in Sphinx/docutils. Please extend the underline by at least one hyphen so it matches or exceeds the title length.</violation>
</file>
<file name="scripts/gen_json/gen_json.py">
<violation number="1" location="scripts/gen_json/gen_json.py:67">
Add a trailing comma after `'LV_USE_LIBWEBP'` so the tuple contains separate entries for WEBP and GIF; without it, both config macros stay disabled.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
docs/src/details/libs/libwebp.rst
Outdated
| find_package(PkgConfig REQUIRED) | ||
| pkg_check_modules(WebP REQUIRED IMPORTED_TARGET libwebp) | ||
| target_include_directories(lvgl PUBLIC ${WebP_INCLUDE_DIRS}) | ||
| target_link_libraries(main ${WebP_LIBRARIES}) |
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.
Link the WebP libraries to the lvgl target so the dependency follows LVGL; otherwise shared builds or other consumers miss the WebP symbols.
Prompt for AI agents
Address the following comment on docs/src/details/libs/libwebp.rst at line 42:
<comment>Link the WebP libraries to the `lvgl` target so the dependency follows LVGL; otherwise shared builds or other consumers miss the WebP symbols.</comment>
<file context>
@@ -0,0 +1,71 @@
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(WebP REQUIRED IMPORTED_TARGET libwebp)
+ target_include_directories(lvgl PUBLIC ${WebP_INCLUDE_DIRS})
+ target_link_libraries(main ${WebP_LIBRARIES})
+
+.. _libwebp_usage:
</file context>
3814184 to
eda7ef8
Compare
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 adds WebP image format support to LVGL by integrating the libwebp library. The implementation follows the existing pattern used by other image decoders in LVGL.
Key changes:
- Added libwebp decoder integration with functions for initialization, deinitialization, and decoding WebP images
- WebP images are decoded into ARGB8888 format with support for lossy, lossless, and transparent variants
- Updated build system (CMake, Kconfig) to include libwebp dependencies and configuration options
Reviewed Changes
Copilot reviewed 19 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/libs/libwebp/lv_libwebp.c | Core decoder implementation with info, open, and close callbacks |
| src/libs/libwebp/lv_libwebp.h | Public API header declaring init/deinit functions |
| src/lv_init.c | Calls lv_libwebp_init() during LVGL initialization |
| src/lv_conf_internal.h | Configuration macro for enabling libwebp |
| lv_conf_template.h | User-facing configuration template |
| tests/CMakeLists.txt | CMake integration for linking libwebp in tests |
| tests/src/test_cases/libs/test_libwebp.c | Test case covering lossy, lossless, and transparent WebP files |
| examples/libs/libwebp/lv_example_libwebp_1.c | Example demonstrating WebP image loading |
| docs/src/details/libs/libwebp.rst | Documentation covering installation, integration, and usage |
| Kconfig | Configuration option for libwebp |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0e91aca to
6a7081c
Compare
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
Copilot reviewed 20 out of 26 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/libs/libwebp/lv_libwebp.c:1
- Line 104 comment appears to have a copy-paste error: it says 'VP8(L)' in the calculation but should say 'VP8' since this is describing the VP8 format (not VP8L). The chunk header and frame header should refer to VP8, not VP8(L).
/**
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2a2c5ac to
50c9bbf
Compare
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
Copilot reviewed 20 out of 26 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a0bd50f to
b7a45a8
Compare
b7a45a8 to
a6e053a
Compare
2d7d31e to
d746277
Compare
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
d746277 to
dda6059
Compare
Add webp image format support
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.