Skip to content

v0.34.0

Choose a tag to compare

@github-actions github-actions released this 07 Oct 02:09
· 152 commits to main since this release
60c2727

Added

  • Interpolation control for convert(). ImageProcessorConfig::interpolation takes Interpolation::Bilinear (default) or Interpolation::Nearest; ImageProcessor::set_interpolation changes it, and EDGEFIRST_INTERPOLATION=nearest|bilinear overrides both. It is also exposed in Python (ImageProcessor(interpolation=...), set_interpolation) and the C API (ef_image_processor_set_interpolation). The CPU backend switches its resizer and the GL backend its source filtering. G2D's scaling filter is fixed, so under Nearest G2D declines converts that resize and leaves them to GL or the CPU backend. Converts that do not resize read each source pixel exactly in either mode. GlCacheStats::nv_uv reports the new cache of chroma-plane imports used by hardware-filtered NV resizes, and its totals include it.

Changed

  • edgefirst-codec uses edgefirst-v4l2 for V4L2. The V4L2 JPEG backend uses the shared edgefirst-v4l2 crate for device discovery, its buffer queues, events and UAPI definitions. Its private copies of these are gone, and edgefirst-codec no longer depends on nix or libc directly. Decoding is unchanged.
    • The decoder opens the device non-blocking.
    • It refuses to stage a JPEG into an OUTPUT buffer the driver still holds.
    • After a failed setup it also releases queues it had started, so the next decode starts clean instead of failing until the circuit breaker trips.

Fixed

  • GL conversion from NV12, NV16 and NV24 used nearest-neighbour sampling when it resized. The in-shader YUV path read one source texel per output pixel. It is the default on NVIDIA, Mali, V3D, Tegra and Adreno, and Vivante takes it in ColorimetryMode::Exact. Letterbox, upscale and downscale converts therefore came out aliased: on VisDrone, YOLOv8n scored 0.012–0.026 mAP50-95 below the CPU backend. These converts now resample bilinearly with half-pixel centres, which matches OpenCV INTER_LINEAR. The texture units do the filtering, sampling luma from the combined plane and chroma from a view of the chroma plane. Where that view cannot be bound, a shader blend takes over; EDGEFIRST_GL_NO_NV_HW_FILTER=1 forces it. Converts that do not resize are unchanged.
  • GL converts of a source crop were shifted and blurred. The filtered GL paths mapped a crop's edges half a texel inward, to keep sampling inside the crop. This changed the crop's scale. A crop drawn at its own size, such as a SAHI tile, was sampled up to half a pixel off and blurred: a one-pixel checkerboard came out grey. Resized crops were stretched by the same amount. Crops now map from their true edges, and each sample is clamped to the crop instead. 1:1 crops are exact, and resized crops resample with OpenCV INTER_LINEAR geometry. This applies to every GL source path, including the i.MX 8M Plus NV12 default.