You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Changed
Packed RGB DMA-BUF sources convert on the GPU (edgefirst-image, Linux). A packed Rgb source in DMA-BUF memory, such as a fused RGB JPEG decode, used to convert on the CPU. The GL backend now imports it natively where the GPU reads the 24-bit BG24 format (Mali-G310), and elsewhere as an R8 view of the buffer that a shader assembles three bytes per pixel (Vivante GC7000UL, V3D, Adreno, where the BG24 import reads past the end of the buffer). A buffer neither import accepts (a 4K row on Vivante, an unaligned plane offset on Mali or Adreno) still converts on the CPU, which is faster than uploading it. Bilinear resizes blend rows in the texture unit and columns in the shader by default (EDGEFIRST_GL_NO_NV_HW_FILTER=1 selects the exact shader blend). Crop, letterbox, rotation, flip and packed, planar, int8 and F16 destinations are covered. Other platforms still convert such a source on the CPU. Decoding a JPEG to its native NV12 and converting that on the GPU remains faster overall on every board measured (for example 3.7 ms against 5.2 ms per 720p frame on a Raspberry Pi 5, and 5.9 ms against 14.3 ms on an i.MX 95, whose hardware decoder has no RGB output), so clients should keep favouring the NV12 workflow and reserve the fused RGB decode for when they need RGB pixels from the decode itself.
Dependencies updated. Every lockfile, including the standalone C API crates', takes the latest semver-compatible releases (rustix 1.1.6, and zip 9.1.2 for the model-files feature of edgefirst-decoder); pyo3 stays on 0.29 to keep the Python 3.8 abi3 wheels.
Fixed
CPU YUV→RGB conversion is exact (edgefirst-image). NV12, NV16 and NV24 sources convert to RGB on the CPU within one level of the exact BT.601/BT.709 matrix, with no bias. Previously the output was off by up to two levels and biased by up to half a level per channel, in opposite directions on Cortex-A53 cores and on everything else, so CPU and GL preprocessing disagreed. On COCO val2017 with yolov8n-seg, CPU-preprocessed box AP50-95 changes by +0.021 pp, and CPU and GL agree on all but 0.41% of confident boxes (1.06% before). The conversion is 5–9% faster on i.MX 8M Plus; on newer Arm cores a 720p letterbox takes 0.3–1.5 ms longer (Orin Nano 2.9 → 3.6 ms).
GL convert() into a Grey destination writes luma (edgefirst-image). A colour source converted into Grey on the OpenGL backend produced its red channel; it now produces the same luma as the CPU backend (see crates/image/ARCHITECTURE.md, Grey destinations).
A GL source import refused after a letterbox clear no longer races the CPU fallback (edgefirst-image). When the GL backend refused a source import after queuing a letterbox clear on a zero-copy DMA-BUF destination, the CPU conversion that followed could write the buffer while the clear was still pending, so pad pixels could overwrite converted ones. The GL backend now waits for queued work before falling back, and the planar route imports its source before clearing.