vp9kf: chroma 64x64 border 4-tap is 8-tap (adjust_mask)
Browse files at this commite2fa4f01a3b96f73a4cbb02db75df82b0790d686Parent: 82ca7122 changed files +28 -2
- crates/ec-vp9/src/loopfilter.rs +12 -2
- lanes/vp9kf.report.md +16 -0
crates/ec-vp9/src/loopfilter.rsmodified+12 -2
| @@ -436,11 +436,16 @@ impl LfGrids { | ||
| 436 | 436 | if c % step != 0 { |
| 437 | 437 | continue; |
| 438 | 438 | } |
| 439 | - let taps = match uv_tx { | |
| 439 | + // vp9_adjust_mask: 4-tap on a 64x64 left border is | |
| 440 | + // promoted to 8-tap (`left_uv[TX_4] & 0x1111` → TX_8). | |
| 441 | + let mut taps = match uv_tx { | |
| 440 | 442 | TX_16X16 | TX_32X32 if c * 4 >= 8 && c * 4 + 8 <= uv_w => 16, |
| 441 | 443 | TX_16X16 | TX_32X32 | TX_8X8 => 8, |
| 442 | 444 | _ => 4, |
| 443 | 445 | }; |
| 446 | + if taps == 4 && c % 8 == 0 { | |
| 447 | + taps = 8; | |
| 448 | + } | |
| 444 | 449 | let (bl, li, th) = limits(level, sharpness); |
| 445 | 450 | let off = r * 4 * uv_stride + c * 4; |
| 446 | 451 | if uv_w >= c * 4 + 4 { |
| @@ -464,11 +469,16 @@ impl LfGrids { | ||
| 464 | 469 | if r % step != 0 { |
| 465 | 470 | continue; |
| 466 | 471 | } |
| 467 | - let taps = match uv_tx { | |
| 472 | + // above_border_uv 0x000f: 4-tap on a 64x64 top border | |
| 473 | + // is promoted to 8-tap. | |
| 474 | + let mut taps = match uv_tx { | |
| 468 | 475 | TX_16X16 | TX_32X32 if r * 4 >= 8 && r * 4 + 8 <= uv_h => 16, |
| 469 | 476 | TX_16X16 | TX_32X32 | TX_8X8 => 8, |
| 470 | 477 | _ => 4, |
| 471 | 478 | }; |
| 479 | + if taps == 4 && r % 8 == 0 { | |
| 480 | + taps = 8; | |
| 481 | + } | |
| 472 | 482 | let (bl, li, th) = limits(level, sharpness); |
| 473 | 483 | let off = r * 4 * uv_stride + c * 4; |
| 474 | 484 | if uv_h >= r * 4 + 4 { |
lanes/vp9kf.report.mdmodified+16 -0
| @@ -339,3 +339,19 @@ Next: chroma ss11 at U(31,11) — likely remaining 4-vs-8 dual threshold or TX_3 | ||
| 339 | 339 | |
| 340 | 340 | Flash 429 until 2026-09-18 19:27. Continue on main grok. |
| 341 | 341 | |
| 342 | +## HANDOFF #7 (2026-09-15) — chroma 64x64 border 4→8 | |
| 343 | + | |
| 344 | +`vp9_adjust_mask` promotes 4-tap UV on a 64x64 border to 8-tap | |
| 345 | +(`left_uv[TX_4] & 0x1111` → TX_8; `above_uv[TX_4] & 0x000f` → TX_8). | |
| 346 | +Also: TX_32 UV bits are OR'd into TX_16 before ss11 reads them — do not | |
| 347 | +skip TX_32; do not treat skip as the 16-pixel miss. | |
| 348 | + | |
| 349 | +U 16→7, V 20→11. Y still 0. Isolated `vpx_lpf_horizontal_4` matches our | |
| 350 | +filter4; remaining cluster is U(31..32,11..12) where 8-tap inner p0/q0 | |
| 351 | +disagree after V+H (x31 is the last pixel of the previous 8-pack H). | |
| 352 | + | |
| 353 | +Next: port `vp9_setup_mask` UV rule for <16x16 (only the first 8x8 of | |
| 354 | +each 16x16 calls `build_masks`; the other three are `build_y_mask`). | |
| 355 | +Do not touch luma. | |
| 356 | + | |
| 357 | + |