Skip to content

Commit ccff880

Browse files
committed
test: cover integrated RGB to YUV matrix invariants
1 parent 884d389 commit ccff880

4 files changed

Lines changed: 555 additions & 0 deletions

File tree

memory-bank/coverage.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ sources and test vectors.
7070
| `Convert/Planar` | Packed YUY2 luma extraction, YUY2-to-YV16 split, and YV16-to-YUY2 interleave | SSE2 kernels | Fixed Y0-U0-Y1-V0 channel ramps with independent packed/planar byte-layout references and distinct packed, luma, and chroma pitches; active-output hashes, all-source immutability, row padding, and allocation guard checks; public scalar counterparts are unavailable |
7171
| `Convert/Planar` | YV24-to-packed BGR matrix conversion | BGR24 SSE2, SSSE3, and AVX2; BGR32 opaque-alpha and source-alpha SSE2, SSSE3, and AVX2 | Independent 8-bit fixed-point references cover BT.709, BT.601-family, BT.2020 NCL/CL, BT470-M, and ST240-M; representative packed cases collectively cover all four source/destination range combinations with range-derived coefficients and offsets, neutral gray, luma endpoints, and saturated chroma anchors. BGR24 SIMD tails, BGR32 bottom-up layout, default and source alpha, active-output hashes, source immutability, padding, and allocation guard checks are asserted |
7272
| `Convert/Planar` | Planar YUV/RGB matrix conversion | 8-bit, 10-bit, exact 16-bit, and representative 32-bit float C, SSE2, and AVX2 templates for YUV-to-RGB and RGB-to-YUV; public `ConvertYUV444ToRGB` planar RGB/RGBA dispatch | Independent YUV-to-RGB references cover BT.709, all four BT.601-family range combinations, BT.2020 NCL/CL, BT470-M, and ST240-M with neutral-gray, luma-endpoint, and saturated chroma anchors; RGB-to-YUV covers BT.601-family, BT.709, BT.2020 NCL/CL, BT470-M, and ST240-M with asymmetric full/limited ranges, 8/10/16-bit widths including non-vector tails, 32-bit float normalized range paths, and post-rounding chroma-neutrality correction. Exact integer C/SIMD output and active-plane hashes, float tolerance checks, source immutability, row padding, and allocation guard checks are applied throughout. Public direct-constructor cases cover limited 8-bit to 10-bit RGBP, limited 16-bit YUVA to RGBAP with alpha preservation, and full-range float YUV444 to RGBPS against an independent matrix/range reference, with frame properties, requests, cache hints, and output memory checks. |
73+
| `Convert/Planar` | Integrated matrix-route invariants | Public `ConvertRGBToYUV444` and `ConvertYUV444ToRGB` direct-constructor routes for planar RGB/RGBA | Independent grayscale endpoint and luma-monotonicity checks, neutral output chroma, BT.709/BT.2020 matrix anchors, asymmetric RGB/YUV range mapping, alpha preservation, bounded RGB-to-YUV-to-RGB error, matrix/range frame properties, source immutability, request traces, and separate source/output memory checks. |
7374
| `Convert/Planar` | RGB-to-Y luma-only conversion | 8-/10-/16-bit and 32-bit float C, SSE2, and AVX2 templates plus the public `ConvertRGBToYUV444(..., to_y=true)` class dispatch | Independent BT.709, BT.601-family, and BT.2020 luma references cover pure R/G/B and gray anchors, full/limited source and destination ranges, native integer and force-float quality paths, representative target-depth changes, exact C/SIMD agreement, target Y-only geometry, output range properties, source immutability, frame requests, and cache hints. Three cases remain red for confirmed upstream defects: SSE2 8-bit RGBP to 10-bit limited luma is one LSB low on the widening path, and AVX2 RGBP10 to 16-bit full luma dispatches with the source-range check and produces source-range-scaled output; C and the other instruction-set variants pass. |
7475
| `Convert/Planar` | Fused YUV-to-YUV matrix conversion | 8-bit, exact 16-bit, and 32-bit float C, SSE2, and AVX2 templates | Independent BT.601-to-BT.709 and BT.601-to-BT.2020 NCL references cover limited/full range changes, odd widths, integer coefficient rounding, chroma diagonals, neutral gray, source immutability, SIMD tail allowances, row padding, and allocation guards. C, 8-bit SIMD, and float SIMD pass under the current upstream revision. The current upstream 16-bit SSE2/AVX2 pivot patch remains red: it uses luma coefficients `m.y_b`/`m.y_r` and the luma output offset for chroma outputs instead of `m.u_b`/`m.v_r` and the chroma offset, matching the upstream `FIXME: untested` comment. |
7576
| `Convert/Matrix` | Matrix IDs, range constants, and matrix precision | Public `GetKrKb`, `get_bits_conv_constants`, `do_BuildMatrix_Rgb2Yuv`, and `do_BuildMatrix_Yuv2Rgb` for RGB, BT.709, BT470-BG/ST170-M, BT470-M, ST240-M, BT.2020 NCL/CL, and AVERAGE | Independent Kr/Kb table and range equations cover both directions, all full/limited combinations at 8-bit, RGB identity handling, initialized integer/float/fallback fields, unsupported YCGCO/ICTCP-style IDs, and invalid range rejection. Luma/chroma spans and offsets cover 8/10/12/14/16-bit integer depths plus 32-bit float boundaries; direction-specific 15/13-bit coefficient scales, luma/chroma neutrality, symmetric negative rounding, the 16-bit RGB identity coefficient boundary, 14-bit YUV identity conversion, and guarded 16-bit RGB float workflows are checked independently |

tests/convert_planar/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ add_executable(convert_planar_tests
22
convert_yuy2_tests.cpp
33
convert_yv24_rgb_tests.cpp
44
convert_yuv444_rgb_tests.cpp
5+
convert_rgb_to_yuv444_tests.cpp
56
convert_planar_matrix_tests.cpp
67
convert_yuv_to_yuv_tests.cpp
78
convert_rgb_to_y_tests.cpp

0 commit comments

Comments
 (0)