Skip to content

Commit 953fbf3

Browse files
committed
test: fix Layer planar RGB Mul reference for upstream MagicDiv change
1 parent 353fdee commit 953fbf3

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

memory-bank/coverage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ submodule checkout cannot build `AvsCore` reliably.
7979
| `Layer` | Generic planar fast average blend | 8- and 16-bit SSE2 and AVX2 | Fixed boundary-value planes plus fixed-seed dual-input dimensions with SIMD blocks and scalar tails, distinct pitches, and valid even 16-bit alignment offsets; independent rounded integer average; active-output hashes, overlay immutability, row padding, and allocation guard checks |
8080
| `Layer` | Packed RGB32 alpha blend | 8-bit SSE4.1 and AVX2 wrappers; overlay-alpha and separate-mask paths | Fixed packed channel and alpha anchors plus a fixed-seed width-13 partial-opacity case for both mask paths; independent magic-divide reference; vector blocks plus scalar tail; active-output hashes, input immutability, row padding, and allocation guard checks. Public C counterpart is file-local. |
8181
| `Layer` | Planar RGB alpha-weighted add | 8-/16-bit C/SSE4.1/AVX2 paths and 32-bit float C templates reached through the AVX2 getter; three-plane and four-plane alpha branches | Fixed boundary-anchor RGB/RGBA planes with full and partial opacity plus fixed-seed 8-bit RGBA and 16-bit RGB partial-opacity cases, and finite-anchor width-7/height-3 float cases with distinct pitches; independent integer/float per-plane and luma-weight references; integer active-output hashes, float tolerance checks, overlay/mask immutability, row padding, and allocation guard checks. Public C counterpart is file-local. |
82-
| `Layer` | Planar RGB multiply blend | 8-/16-bit C and 32-bit float C templates reached through the AVX2 getter; per-channel and overlay-luma multiply; no alpha, overlay-alpha masking, and RGBA alpha blending branches | Fixed-seed width-13/height-5 8-bit and width-19/height-3 16-bit cases plus finite-anchor width-7/height-3 float cases with distinct pitches; independent integer and floating-point luma, per-channel product, alpha-weight, and alpha-plane references; active-output hashes for integer cases, float tolerance checks, overlay/mask immutability, row padding, and allocation guard checks. Public C getter is file-local, so coverage uses the exported AVX2 getter wrapper. |
82+
| `Layer` | Planar RGB multiply blend | 8-/16-bit C and 32-bit float C templates reached through the AVX2 getter; per-channel and overlay-luma multiply; no alpha, overlay-alpha masking, and RGBA alpha blending branches | Fixed-seed width-13/height-5 8-bit and width-19/height-3 16-bit cases plus finite-anchor width-7/height-3 float cases with distinct pitches; independent integer products normalized by the sample maximum (`2^bits-1`), plus floating-point luma, per-channel product, alpha-weight, and alpha-plane references; active-output hashes for integer cases, float tolerance checks, overlay/mask immutability, row padding, and allocation guard checks. Public C getter is file-local, so coverage uses the exported AVX2 getter wrapper. |
8383
| `Layer` | Planar RGB lighten/darken threshold blend | 8-/16-bit C and 32-bit float C templates reached through the AVX2 getter; Lighten and Darken modes; no alpha, overlay-alpha masking, and RGBA alpha blending branches | Fixed-seed width-13/height-5 8-bit and width-19/height-3 16-bit cases with distinct pitches and thresholds plus finite-anchor width-7/height-3 float cases; independent Rec.601 luma threshold selection, integer/float alpha weighting, and alpha-plane references; integer active-output hashes, float tolerance checks, overlay/mask immutability, row padding, and allocation guard checks. Public C getter is file-local, so coverage uses the exported AVX2 getter wrapper. |
8484
| `Turn` | Planar quarter-turn rotation, left and right | 8-, 16-, and 32-bit C, SSE2, and AVX2 kernels | Fixed deterministic input; independent coordinate reference; scalar differential comparison; active-output hash; padding, guards, and source immutability checks |
8585
| `Turn` | Packed RGB quarter-turn rotation, left and right | RGB24/RGB48 C kernels; RGB32/RGB64 C, SSE2, and AVX2 kernels | Fixed deterministic input; pixel-group coordinate reference using the upstream packed-RGB direction convention; scalar differential comparison; active-output hash; padding and guard checks |

tests/layer/layer_planarrgb_mul_test_helpers.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,19 @@ void apply_layer_planarrgb_mul_reference(
180180
std::uint64_t target = 0;
181181
if (test_case.chroma) {
182182
target = (static_cast<std::uint64_t>(overlay[plane]->view().row(y)[x]) *
183-
destination_value) >>
184-
test_case.bits_per_pixel;
183+
destination_value) /
184+
max_value;
185185
} else if (plane < 3) {
186186
const auto overlay_luma =
187187
(kCyb * static_cast<std::uint64_t>(overlay[1]->view().row(y)[x]) +
188188
kCyg * static_cast<std::uint64_t>(overlay[0]->view().row(y)[x]) +
189189
kCyr * static_cast<std::uint64_t>(overlay[2]->view().row(y)[x])) >>
190190
15;
191-
target = (overlay_luma * destination_value) >> test_case.bits_per_pixel;
191+
target = (overlay_luma * destination_value) / max_value;
192192
} else {
193193
target = (static_cast<std::uint64_t>(overlay[3]->view().row(y)[x]) *
194-
destination_value) >>
195-
test_case.bits_per_pixel;
194+
destination_value) /
195+
max_value;
196196
}
197197
destination[plane]->view().row(y)[x] = static_cast<T>(
198198
(destination_value * inverse_alpha + target * alpha + half) / max_value);

tests/layer/layer_tests.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,22 +1054,22 @@ std::vector<LayerPlanarRgbMulCase> layer_planarrgb_mul_cases() {
10541054
return {
10551055
make_layer_planarrgb_mul_case(
10561056
true, false, false, 8, width_8, height_8, destination_pitch_8, overlay_pitch_8, 0,
1057-
opacity_8, "Partial173", seed_8, "4526897b232aa349"),
1057+
opacity_8, "Partial173", seed_8, "d7d14f69613e8ab7"),
10581058
make_layer_planarrgb_mul_case(
10591059
true, true, false, 8, width_8, height_8, destination_pitch_8, overlay_pitch_8,
1060-
mask_pitch_8, opacity_8, "Partial173", seed_8, "b4eb9f389ef05d26"),
1060+
mask_pitch_8, opacity_8, "Partial173", seed_8, "cbde729c940360ea"),
10611061
make_layer_planarrgb_mul_case(
10621062
false, true, true, 8, width_8, height_8, destination_pitch_8, overlay_pitch_8,
1063-
mask_pitch_8, opacity_8, "Partial173", seed_8, "6d45d21ee6daf4f9"),
1063+
mask_pitch_8, opacity_8, "Partial173", seed_8, "5da3d80d721eb390"),
10641064
make_layer_planarrgb_mul_case(
10651065
false, false, false, 16, width_16, height_16, destination_pitch_16, overlay_pitch_16, 0,
1066-
opacity_16, "Partial39321", seed_16, "ad3c8ab8c4db317a"),
1066+
opacity_16, "Partial39321", seed_16, "22b6fd463dc8a1df"),
10671067
make_layer_planarrgb_mul_case(
10681068
false, true, false, 16, width_16, height_16, destination_pitch_16, overlay_pitch_16,
1069-
mask_pitch_16, opacity_16, "Partial39321", seed_16, "ac465b016bff2ec2"),
1069+
mask_pitch_16, opacity_16, "Partial39321", seed_16, "f14bf6c13c9f2146"),
10701070
make_layer_planarrgb_mul_case(
10711071
true, true, true, 16, width_16, height_16, destination_pitch_16, overlay_pitch_16,
1072-
mask_pitch_16, opacity_16, "Partial39321", seed_16, "923705c83b096da5"),
1072+
mask_pitch_16, opacity_16, "Partial39321", seed_16, "26015322e993a08b"),
10731073
};
10741074
}
10751075

0 commit comments

Comments
 (0)