Skip to content

capture_scaled and capture_yuy2 through ppa (media Phase 5) - #11

Merged
bdbarnett merged 1 commit into
mainfrom
media/5-ppa
Oct 7, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
media/5-ppa

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

cameraif stops talking to the PPA itself. capture_scaled() and capture_yuy2() call ppa's C API (micropython-pydevices modules/ppa), declared weak, so a firmware without ppa still builds and the two calls say ppa is missing. cameraif's own YUY2 converter is gone.

What changes for a caller:

  • capture_yuy2() scales for real. The old integer decimation took a step of 1 for 800x800 to 640x480, which sent the top-left corner. It now samples chroma as the PPA does (U from the left pixel of a pair, V from the right).
  • A misaligned capture_scaled() buffer gets the right picture from ppa's software path, instead of an error.

Proven on the P4 panel (pre-rev3), firmware built with --modules all: camera_transform.py (every orientation, and the cropped inset), camera_snapshot.py and camera_frame.py run. capture_scaled runs at 34.9 fps to the 720x720 panel, capture_yuy2 at 35.8 fps for 320x240 and 11.7 fps for 640x480, and capture_jpeg is unchanged. The pairing micropython-pydevices PR moves its cameraif pin to this.

…s own YUY2 converter is gone

capture_yuy2() now scales properly (the old decimation took the top-left
640x480 of an 800x800 frame) and samples chroma as the PPA does. A
misaligned capture_scaled() buffer gets software instead of an error.
Media modules roadmap, Phase 5.
@bdbarnett
bdbarnett merged commit fdb65ca into main Oct 7, 2026
2 checks passed
@bdbarnett
bdbarnett deleted the media/5-ppa branch October 7, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant