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

drivers: video: introduce an API for collecting statistics #85811

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

josuah
Copy link
Collaborator

@josuah josuah commented Feb 14, 2025

This is an implementation for this RFC:

This is an implementation used on a private repo to implement a basic ISP that does auto-exposure from main().

Hardware -> RGB stats -> YRGB stats -> Y channel used for computing how far we are from a "goal" value -> video controls.

@josuah josuah added RFC Request For Comments: want input from the community area: API Changes to public APIs area: Video Video subsystem labels Feb 14, 2025
@josuah josuah marked this pull request as draft February 14, 2025 22:01
@josuah
Copy link
Collaborator Author

josuah commented Feb 14, 2025

Roadmap:

  • Implement a library to convert data between pixel formats
  • Use this to implement a video_sw_stats.c driver that randomly samples pixels through a frame and converts them from i.e. RGB565 to RGB888, and use that to provide statistics to any hardware that does not have built-in statistics.
  • Come back to this PR and use that software video statistics device to add unit tests to that PR
  • Provide a very basic ISP to Zephyr using this API, maybe in subsys/video/video_isp.c

@josuah josuah force-pushed the pr-video-stats branch 3 times, most recently from bc382bc to e854911 Compare March 9, 2025 15:12
@josuah josuah marked this pull request as ready for review March 9, 2025 15:15
@zephyrbot zephyrbot added the area: Samples Samples label Mar 9, 2025
@zephyrbot zephyrbot requested review from kartben and nashif March 9, 2025 15:15
@josuah josuah force-pushed the pr-video-stats branch 2 times, most recently from 05fe9a6 to 4483961 Compare March 11, 2025 16:44
@kartben kartben assigned josuah and unassigned kartben Mar 12, 2025
josuah added 2 commits March 12, 2025 21:44
Introduce an abstraction layer handling the diversity of ways hardware
have to report statistics. This allows to take advantage of the various
channel average or histograms present on some hardware, that skip the
need to manually compute statistics.
Fixes zephyrproject-rtos#85457

Signed-off-by: Josuah Demangeon <me@josuah.net>
Add support for the new API video_set_stats() to the emulated video RX
driver, and use it to implement simple API tests. The data returned
is arbitrary for the sake of testing the API itself.

Signed-off-by: Josuah Demangeon <me@josuah.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Samples Samples area: Video Video subsystem RFC Request For Comments: want input from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants