colconv 0.1.0

SIMD-dispatched color-conversion kernels covering the FFmpeg AVPixelFormat space, with a Sink-based API so consumers pick which derived outputs (RGB / Luma / HSV / custom) they want without paying for the ones they don't.
Documentation

SIMD-dispatched color-conversion kernels covering the FFmpeg AVPixelFormat space, with a Sink-based API so consumers pick which derived outputs (RGB / Luma / HSV / custom) they want without paying for the ones they don't.

English | 简体中文

What it is

colconv is a header-light, no_std-friendly color-conversion library for video pipelines:

  • SIMD-dispatched — every kernel ships AVX-512, AVX2, SSE4.1, and a scalar fallback, selected once at startup via is_x86_feature_detected! (no per-row branching). The scalar path is the reference implementation every other tier is equivalence-tested against.
  • Sink-based output — pick exactly which derived outputs a frame produces (RGB, RGBA, Luma, HSV, …); unused kernels don't compile, so binaries don't carry dead code.
  • FFmpeg-coverage — source-format markers track the FFmpeg AVPixelFormat space (YUV planar / semi-planar / packed / 4:4:4 packed, Y-series, V210, RGB 8/10/16/F16/F32, GBR, Gray, XYZ, Bayer, PAL8 / Mono). Pair colconv with mediaframe for the pixel-data + SourceFormat traits the kernels are generic over.

Installation

[dependencies]
colconv = "0.1"

Feature flags

Capability tiers (additive):

flag role
none (--no-default-features) no_std + no_alloc
alloc no_std + alloc (pulls libm for the scalar path)
std (default) std

Format-family gates (opt out of kernels you don't ship):

flag enables
frame (default) umbrella — every family below
yuv-planar YUV planar 4:0:0 / 4:2:0 / 4:2:2 / 4:4:4 (8/10/12/14/16-bit)
yuv-semi-planar NV-family (NV12 / NV16 / NV21 / NV24 / NV42)
yuva YUVA 4:2:0 / 4:2:2 / 4:4:4 (auto-enables yuv-planar)
yuv-packed packed YUV (UYVY / YUYV / 4:1:1)
yuv-444-packed packed YUV 4:4:4 (AYUV64 / VUYA / Y410 / Y412 / XV30 / XV36)
y2xx Y2-family packed 4:2:2 (Y210 / Y212 / Y216 / V210)
v210 V210 packed 4:2:2 (10-bit, 6-pixels-per-block)
rgb packed RGB 8/16-bit (RGB / RGBA / BGR / BGRA / RGB48 / RGBA64)
rgb-float packed RGB f16 / f32
rgb-legacy legacy packed RGB (RGB565 / RGB555 / RGB444 + BGR variants)
gbr planar GBR / GBRA (8-bit, high-bit, f16, f32)
gray gray Y8 / Y16 / YF16 / YF32 / YA8 / YA16
bayer Bayer 8/16-bit (RGGB / GRBG / GBRG / BGGR)
xyz XYZ 12-bit (DCDM / DCP)
mono 1-bit mono + PAL8 palette

Each family gate forwards to the matching mediaframe/<family> so the source-format markers and Frame types compile in lockstep.

License

colconv is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later).

See LICENSE for the full text, or https://www.gnu.org/licenses/gpl-3.0.html.

Copyright (C) 2026 Findit Studio.