edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | use *; |
| 2 | use *; |
| 3 | |
| 4 | pub |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | pub |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | /// One census attempt: encode `frames` frames of `source` with real |
| 42 | /// aomenc plus `extra` args, decode with THIS decoder, and return the |
| 43 | /// stream's byte length with either the picture count or the refusal (any |
| 44 | /// decode error) it produced. A census is about what the encoder emits, |
| 45 | /// so a refusal is data here, not a failure. |
| 46 | pub |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | /// lane-av1seglvl: encode `frames` frames of `source` with real aomenc |
| 117 | /// plus `extra` args and return the raw `.obu` bytes -- the census's |
| 118 | /// half-sibling of [`census_attempt`] that keeps the STREAM instead of |
| 119 | /// only its decode verdict, so the caller can parse the frame headers' |
| 120 | /// segmentation tables themselves. |
| 121 | pub |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | /// lane-av1seglvl: encode `frames` frames with a real TWO-PASS aomenc |
| 187 | /// (pass 1 writes the stats file into the session temp dir, pass 2 |
| 188 | /// consumes it) and return the `.obu` bytes. This is the only shape that |
| 189 | /// reaches libaom's `is_stat_consumption_stage_twopass` segmentation |
| 190 | /// setup (`configure_static_seg_features`), so the census is not proven |
| 191 | /// over the encoder's whole reachable surface without it. |
| 192 | pub |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | |
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | |
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | /// lane-av1seglvl: walk every frame OBU of `stream` and tally which |
| 277 | /// `SEG_LVL` features the frame headers actually ENABLE, plus the shape |
| 278 | /// counters a census premise is asserted against: frames with |
| 279 | /// segmentation on, of which `update_map == 1` (the map is coded) and |
| 280 | /// `update_map == 0` (every block's id is INHERITED), and frames whose |
| 281 | /// table carries a real `SEG_LVL_ALT_Q` delta. |
| 282 | /// The last vector counts per SEGMENT-FEATURE INSTANCE (a frame with |
| 283 | /// ALT_Q on all 8 segments contributes 8), which is all the verdict |
| 284 | /// needs: only index `SEG_LVL_ALT_Q` may be non-zero. |
| 285 | /// Returns `(enabled_frames, update_map_frames, inherited_frames, |
| 286 | /// alt_q_frames, feature_instances: [usize; SEG_LVL_MAX])`. |
| 287 | |
| 288 | pub |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | |
| 294 | |
| 295 | |
| 296 | |
| 297 | |
| 298 | |
| 299 | |
| 300 | |
| 301 | |
| 302 | |
| 303 | |
| 304 | |
| 305 | |
| 306 | |
| 307 | |
| 308 | |
| 309 | |
| 310 | |
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | |
| 316 | |
| 317 | |
| 318 | |
| 319 | |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | /// lane-interedge r1: one attempt of the inter frame-edge half-strip gate -- |
| 334 | /// encode `width x height` with real aomenc (rect partitions ON, every other |
| 335 | /// lane's open tool pinned off), decode it, and return |
| 336 | /// `(inter_edge_strip hits, frames whose LUMA differs, frames whose CHROMA |
| 337 | /// differs)` against ffmpeg. A refusal or a decode error is a hard failure: |
| 338 | /// this recipe reached every size without one (measured r1). |
| 339 | pub |
| 340 | |
| 341 | |
| 342 | |
| 343 | |
| 344 | |
| 345 | |
| 346 | |
| 347 | |
| 348 | |
| 349 | |
| 350 | |
| 351 | |
| 352 | |
| 353 | |
| 354 | |
| 355 | |
| 356 | |
| 357 | |
| 358 | |
| 359 | |
| 360 | |
| 361 | |
| 362 | |
| 363 | |
| 364 | |
| 365 | |
| 366 | |
| 367 | |
| 368 | |
| 369 | |
| 370 | |
| 371 | |
| 372 | |
| 373 | |
| 374 | |
| 375 | |
| 376 | |
| 377 | |
| 378 | |
| 379 | |
| 380 | |
| 381 | |
| 382 | |
| 383 | |
| 384 | |
| 385 | |
| 386 | |
| 387 | |
| 388 | |
| 389 | |
| 390 | |
| 391 | |
| 392 | |
| 393 | |
| 394 | |
| 395 | |
| 396 | |
| 397 | |
| 398 | |
| 399 | |
| 400 | |
| 401 | |
| 402 | |
| 403 | |
| 404 | |
| 405 | |
| 406 | |
| 407 | |
| 408 | |
| 409 | |
| 410 | |
| 411 | |
| 412 | |
| 413 | |
| 414 | |
| 415 | |
| 416 | |
| 417 | |
| 418 | |
| 419 | |
| 420 | |
| 421 | |
| 422 | |
| 423 | |
| 424 | |
| 425 | |
| 426 | |
| 427 | |
| 428 | |
| 429 | |
| 430 | |
| 431 | |
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | |
| 437 | |
| 438 | |
| 439 | |
| 440 | |
| 441 | |
| 442 | |
| 443 | |
| 444 | |
| 445 | |
| 446 | |
| 447 | |
| 448 | |
| 449 | |
| 450 | |
| 451 | |
| 452 | |
| 453 | |
| 454 | |
| 455 | |
| 456 | |
| 457 | |
| 458 | |
| 459 | |
| 460 | |
| 461 | |
| 462 | |
| 463 | |
| 464 | |
| 465 | |
| 466 | |
| 467 | |
| 468 | |
| 469 | |
| 470 | |
| 471 | |
| 472 | |
| 473 | |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | /// A GOP (key frame plus panned inter frames, so blocks actually take |
| 479 | /// motion) decodes bit-exact through `decode_stream` alone, threading its |
| 480 | /// own DPB rather than a test-supplied reference. |
| 481 | pub |
| 482 | |
| 483 | |
| 484 | |
| 485 | |
| 486 | |
| 487 | |
| 488 | |
| 489 | |
| 490 | |
| 491 | |
| 492 | |
| 493 | |
| 494 | |
| 495 | |
| 496 | |
| 497 | |
| 498 | |
| 499 | |
| 500 | |
| 501 | |
| 502 | |
| 503 | |
| 504 | /// Firing-detection gates (single-ref envelope, temporal-MV, `comp_mode`, |
| 505 | /// `skip_mode`/compound) all read a process-global atomic counter delta |
| 506 | /// (`decode::ref_hits`/`tmv_hits`/`comp_mode_hits`/`skip_mode_hits`) to |
| 507 | /// prove a real block picked the feature under test, not just that a |
| 508 | /// header bit was set. Under `cargo test`'s default parallel run, a |
| 509 | /// SIBLING test's own decode bumps the same global counter mid-gate -- |
| 510 | /// a false "fired" reading pixel-compares an attempt the gate would |
| 511 | /// otherwise `continue` past, on top of genuine defects that path may |
| 512 | /// still have. Serialising every counter-delta gate behind this one |
| 513 | /// mutex makes firing detection honest again (matches the existing |
| 514 | /// cdf-forwarding-gate flake shape, ledger `omp-liveness-pgrep-self-match`). |
| 515 | pub static GATE_COUNTER_LOCK: Mutex = new; |
| 516 | |
| 517 | /// lane-cdfflake: a cheap, dependency-free (FNV-1a, not cryptographic -- |
| 518 | /// this is a load-bearing-identity fingerprint for flake triage, not a |
| 519 | /// security digest, so no `sha2` dep is pulled in) fixture fingerprint |
| 520 | /// for the cdf-forwarding gate's instrumentation below. |
| 521 | /// Reads a pinned fixture, asserting its length and FNV first, so a |
| 522 | /// swapped or truncated pin fails loudly instead of silently changing |
| 523 | /// what the gate measures. |
| 524 | pub |
| 525 | |
| 526 | |
| 527 | |
| 528 | |
| 529 | |
| 530 | |
| 531 | |
| 532 | |
| 533 | |
| 534 | |
| 535 | |
| 536 | |
| 537 | /// The bit depth the stream's OWN sequence header declares, read from |
| 538 | /// the bytes rather than taken from the gate's name or recipe (class |
| 539 | /// `helper-packs-u16-for-an-8-bit-stream`: aomdec's `--rawvideo` |
| 540 | /// writes 8 bits per sample for an 8-bit stream and 16 bits LE for a |
| 541 | /// high-bitdepth one, so a u16 packer turns every 8-bit compare into a |
| 542 | /// raw-SIZE failure that never looks at a sample). |
| 543 | pub |
| 544 | |
| 545 | |
| 546 | |
| 547 | |
| 548 | |
| 549 | |
| 550 | |
| 551 | |
| 552 | |
| 553 | |
| 554 | |
| 555 | |
| 556 | |
| 557 | |
| 558 | |
| 559 | /// The stream's OWN `color_config.subsampling_x/y` (spec 5.5.2), read |
| 560 | /// from its bytes the same way [`stream_bit_depth`] reads the depth. |
| 561 | pub |
| 562 | |
| 563 | |
| 564 | |
| 565 | |
| 566 | |
| 567 | |
| 568 | |
| 569 | |
| 570 | |
| 571 | |
| 572 | |
| 573 | |
| 574 | |
| 575 | |
| 576 | |
| 577 | /// The chroma shape a `(subsampling_x, subsampling_y)` pair means. |
| 578 | pub |
| 579 | |
| 580 | |
| 581 | |
| 582 | |
| 583 | |
| 584 | |
| 585 | |
| 586 | |
| 587 | |
| 588 | /// lane-av1oracleguard: HARD REFUSAL for the 4:2:0 ffmpeg oracle helpers. |
| 589 | /// |
| 590 | /// `ffmpeg_decode_sequence`, `ffmpeg_decode_sequence_10bit` and |
| 591 | /// `ffmpeg_decode_sequence_12bit` ask ffmpeg for `-pix_fmt yuv420p*` and |
| 592 | /// size chroma at `width * height / 4`. Those are the 4:2:0 numbers, so |
| 593 | /// for a stream that is NOT (1,1) ffmpeg does not fail -- it CONVERTS, |
| 594 | /// and the helper then slices a 4:2:0-shaped picture out of it. A 4:2:2 |
| 595 | /// gate built on one of them compares the wrong planes and passes green: |
| 596 | /// the exact failure `lanes/av1subsizesweep.report.md` names. The correct |
| 597 | /// siblings (`ffmpeg_decode_sequence_422` / `_422_depth` / |
| 598 | /// `ffmpeg_decode_sequence_444`) exist and take the same bytes, so the |
| 599 | /// refusal points at them by name rather than leaving the caller to |
| 600 | /// rediscover the shape. |
| 601 | /// |
| 602 | /// Refused by SUBSAMPLING read from the stream's own sequence header, not |
| 603 | /// from the caller's `width`/`height` (class |
| 604 | /// `helper-assumes-the-shape-the-gate-name-implies`). |
| 605 | pub |
| 606 | |
| 607 | |
| 608 | |
| 609 | |
| 610 | |
| 611 | |
| 612 | |
| 613 | |
| 614 | |
| 615 | |
| 616 | |
| 617 | |
| 618 | |
| 619 | /// lane-av1oracleguard: run `f`, return the panic MESSAGE it raised (or |
| 620 | /// `None` if it did not panic). The panic hook is silenced so a refusal |
| 621 | /// that PASSES its gate prints nothing -- the assertion is the return. |
| 622 | pub |
| 623 | |
| 624 | |
| 625 | |
| 626 | |
| 627 | |
| 628 | |
| 629 | |
| 630 | |
| 631 | |
| 632 | |
| 633 | |
| 634 | |
| 635 | |
| 636 | |
| 637 | |
| 638 | |
| 639 | /// Packs decoded planes the way `aomdec --rawvideo` writes them for |
| 640 | /// `bit_depth`: 1 byte per sample at 8-bit, 2 bytes little-endian at |
| 641 | /// 10/12-bit. Plane order is Y, U, V at the frame's own subsampled |
| 642 | /// shape, which is exactly what rawvideo emits. |
| 643 | pub |
| 644 | |
| 645 | |
| 646 | |
| 647 | |
| 648 | |
| 649 | |
| 650 | |
| 651 | |
| 652 | |
| 653 | |
| 654 | |
| 655 | |
| 656 | |
| 657 | |
| 658 | |
| 659 | |
| 660 | |
| 661 | |
| 662 | |
| 663 | |
| 664 | |
| 665 | |
| 666 | |
| 667 | /// Decodes `stream` and the oracle's `aomdec --rawvideo` output and |
| 668 | /// requires every sample of every frame to agree, in decode order. |
| 669 | /// |
| 670 | /// `bit_depth` is the depth the CALLER believes the stream has; it is |
| 671 | /// asserted against the stream's own sequence header, so a gate that |
| 672 | /// hands this an 8-bit stream under a 10-bit label fails here by name |
| 673 | /// instead of dying on a raw-size mismatch that reads like a pixel bug. |
| 674 | pub |
| 675 | |
| 676 | |
| 677 | |
| 678 | |
| 679 | |
| 680 | |
| 681 | |
| 682 | |
| 683 | |
| 684 | |
| 685 | |
| 686 | |
| 687 | |
| 688 | |
| 689 | |
| 690 | |
| 691 | |
| 692 | |
| 693 | |
| 694 | |
| 695 | |
| 696 | |
| 697 | |
| 698 | |
| 699 | |
| 700 | |
| 701 | |
| 702 | |
| 703 | |
| 704 | |
| 705 | |
| 706 | |
| 707 | |
| 708 | |
| 709 | |
| 710 | |
| 711 | |
| 712 | |
| 713 | |
| 714 | |
| 715 | |
| 716 | |
| 717 | |
| 718 | |
| 719 | |
| 720 | |
| 721 | |
| 722 | |
| 723 | |
| 724 | |
| 725 | |
| 726 | |
| 727 | |
| 728 | |
| 729 | |
| 730 | |
| 731 | |
| 732 | |
| 733 | |
| 734 | |
| 735 | |
| 736 | |
| 737 | pub |
| 738 | |
| 739 | |
| 740 | |
| 741 | |
| 742 | |
| 743 | |
| 744 | |
| 745 | |
| 746 | /// Whether ffmpeg is on PATH. Absence normally SKIPs, but |
| 747 | /// `EC_AV1_REQUIRE_FFMPEG=1` -- or `EC_AV1_REQUIRE_AOMENC=1`, since every |
| 748 | /// aomenc gate decodes its stream through ffmpeg and is meaningless |
| 749 | /// without it -- turns it into a hard failure. Without this the require |
| 750 | /// flag was silently short-circuited: `!have_ffmpeg()` is evaluated first |
| 751 | /// in `if !have_ffmpeg() || !have_aomenc()`, so a machine with no ffmpeg |
| 752 | /// printed SKIP and reported green (class gate-skips-on-its-own-failure). |
| 753 | pub |
| 754 | |
| 755 | |
| 756 | |
| 757 | |
| 758 | |
| 759 | |
| 760 | |
| 761 | |
| 762 | |
| 763 | |
| 764 | |
| 765 | |
| 766 | |
| 767 | |
| 768 | |
| 769 | /// Decodes `frames` concatenated 4:2:0 frames out of one AV1 OBU stream. |
| 770 | /// The frame-count diagnostic shared by the three `ffmpeg_decode_sequence*` |
| 771 | /// helpers (lane-av1pins5 r6). |
| 772 | /// |
| 773 | /// Before this, a caller that passed its OWN decode's length as the expected |
| 774 | /// count got `expected N 4:2:0 frames, ffmpeg said: ` -- with an EMPTY tail, |
| 775 | /// because ffmpeg ran at `-v error` and succeeded. The message named ffmpeg, |
| 776 | /// said nothing about where `N` came from, and sent the next reader hunting |
| 777 | /// ffmpeg for a count ffmpeg never chose. |
| 778 | /// |
| 779 | /// The class is MISATTRIBUTED RED, not silent pass: the helper's |
| 780 | /// `out.stdout.len() == frame_bytes * frames` assert fires unconditionally, so |
| 781 | /// a wrong count cannot pass -- it just fails while blaming the wrong |
| 782 | /// component. (Measured: `ffmpeg_decode_sequence(&s, 192, 128, 0)` panics |
| 783 | /// here, not silently.) Naming the real cause is the whole fix; no caller has |
| 784 | /// to change to benefit. |
| 785 | pub |
| 786 | |
| 787 | |
| 788 | |
| 789 | |
| 790 | |
| 791 | |
| 792 | |
| 793 | |
| 794 | |
| 795 | |
| 796 | |
| 797 | |
| 798 | |
| 799 | |
| 800 | |
| 801 | |
| 802 | |
| 803 | |
| 804 | |
| 805 | |
| 806 | |
| 807 | |
| 808 | |
| 809 | |
| 810 | |
| 811 | |
| 812 | |
| 813 | |
| 814 | |
| 815 | |
| 816 | |
| 817 | pub |
| 818 | |
| 819 | |
| 820 | |
| 821 | |
| 822 | |
| 823 | |
| 824 | |
| 825 | |
| 826 | |
| 827 | |
| 828 | |
| 829 | |
| 830 | |
| 831 | |
| 832 | |
| 833 | |
| 834 | |
| 835 | |
| 836 | |
| 837 | |
| 838 | |
| 839 | |
| 840 | |
| 841 | |
| 842 | |
| 843 | |
| 844 | |
| 845 | |
| 846 | |
| 847 | |
| 848 | |
| 849 | |
| 850 | |
| 851 | |
| 852 | |
| 853 | |
| 854 | |
| 855 | |
| 856 | |
| 857 | |
| 858 | |
| 859 | |
| 860 | |
| 861 | |
| 862 | |
| 863 | |
| 864 | |
| 865 | |
| 866 | |
| 867 | |
| 868 | |
| 869 | |
| 870 | |
| 871 | |
| 872 | |
| 873 | |
| 874 | |
| 875 | |
| 876 | |
| 877 | |
| 878 | |
| 879 | |
| 880 | /// As [`ffmpeg_decode_sequence`], for a MONOCHROME stream: one 8-bit luma |
| 881 | /// plane per frame, exactly what `ffmpeg -pix_fmt gray -f rawvideo` writes |
| 882 | /// (lane-av1mono). Fed through [`run_with_stdin`] for the reason its doc |
| 883 | /// records. |
| 884 | pub |
| 885 | |
| 886 | |
| 887 | |
| 888 | |
| 889 | |
| 890 | |
| 891 | |
| 892 | |
| 893 | |
| 894 | |
| 895 | |
| 896 | |
| 897 | |
| 898 | |
| 899 | |
| 900 | |
| 901 | |
| 902 | |
| 903 | |
| 904 | |
| 905 | |
| 906 | |
| 907 | |
| 908 | |
| 909 | |
| 910 | /// As [`ffmpeg_decode_sequence`], but for a `yuv420p10le` stream: samples |
| 911 | /// are 2-byte little-endian, one full 16-bit range regardless of the |
| 912 | /// stream's real 10-bit depth (ffmpeg's rawvideo muxer never packs to the |
| 913 | /// bit depth). The 8-bit helper above stays untouched -- every existing |
| 914 | /// gate depends on it. |
| 915 | /// |
| 916 | /// lane-av1oracledepth: the stream's OWN sequence header must parse |
| 917 | /// 10-bit, the same way `assert_12bit_sequence_header` covers the 12-bit |
| 918 | /// gates. A wrong-depth stream handed here would otherwise CONVERT |
| 919 | /// silently -- ffmpeg re-scales 8-bit samples into the 16-bit container |
| 920 | /// and sizes no plane differently -- so a gate could compare ffmpeg's |
| 921 | /// rescaled 8-bit planes against our 10-bit decode and read exact (class |
| 922 | /// `helper-assumes-the-shape-the-gate-name-implies`, the depth axis). |
| 923 | pub |
| 924 | |
| 925 | |
| 926 | |
| 927 | |
| 928 | |
| 929 | |
| 930 | |
| 931 | |
| 932 | |
| 933 | |
| 934 | |
| 935 | |
| 936 | |
| 937 | |
| 938 | |
| 939 | |
| 940 | |
| 941 | |
| 942 | |
| 943 | |
| 944 | |
| 945 | |
| 946 | |
| 947 | |
| 948 | |
| 949 | |
| 950 | |
| 951 | |
| 952 | |
| 953 | |
| 954 | |
| 955 | |
| 956 | |
| 957 | |
| 958 | |
| 959 | |
| 960 | |
| 961 | |
| 962 | |
| 963 | |
| 964 | |
| 965 | |
| 966 | |
| 967 | |
| 968 | |
| 969 | |
| 970 | |
| 971 | |
| 972 | |
| 973 | |
| 974 | |
| 975 | |
| 976 | |
| 977 | |
| 978 | |
| 979 | |
| 980 | |
| 981 | |
| 982 | |
| 983 | |
| 984 | |
| 985 | |
| 986 | |
| 987 | |
| 988 | |
| 989 | |
| 990 | |
| 991 | |
| 992 | |
| 993 | |
| 994 | |
| 995 | |
| 996 | |
| 997 | |
| 998 | |
| 999 | |
| 1000 | /// Builds a `gradients` lavfi source string with colours derived from |
| 1001 | /// `seed`, not left to the filter's own default. |
| 1002 | /// |
| 1003 | /// Measured (lane-fixdet r1): ffmpeg's `gradients` source IGNORES its |
| 1004 | /// `seed=` parameter for colour selection -- five encodes of an |
| 1005 | /// identical command line (same `seed=`, same everything) produced five |
| 1006 | /// different fixtures, because the unset `c0..c9` stops are randomized |
| 1007 | /// from something other than that seed. Every one of this file's ~20 |
| 1008 | /// gate fixtures built a `gradients` source this way, so none of them |
| 1009 | /// had a reproducible input: a pin captured from one run could not be |
| 1010 | /// regenerated, and "attempt N failed" was as likely to be a different |
| 1011 | /// fixture as a different decode outcome. |
| 1012 | /// |
| 1013 | /// Freezing the colours outright (as the earliest four gates below do, |
| 1014 | /// hand-picking `c0=red:c1=blue:c2=green`) fixes reproducibility but |
| 1015 | /// throws away the per-attempt content variety the sweep gates need to |
| 1016 | /// make features (OBMC, warp, wedge, ...) fire at all -- this repo's own |
| 1017 | /// `sampler-decorrelated-gate` class. So: derive `c0..c3` deterministically |
| 1018 | /// FROM the seed with a plain integer hash, and keep passing `seed=` |
| 1019 | /// itself too, so a future ffmpeg that actually honours it only adds |
| 1020 | /// more variety, never removes the determinism this buys. |
| 1021 | pub |
| 1022 | |
| 1023 | |
| 1024 | |
| 1025 | |
| 1026 | |
| 1027 | |
| 1028 | |
| 1029 | |
| 1030 | |
| 1031 | |
| 1032 | |
| 1033 | |
| 1034 | |
| 1035 | |
| 1036 | |
| 1037 | |
| 1038 | |
| 1039 | |
| 1040 | /// Encodes a real libaom-av1 stream (via ffmpeg's own encoder, not this |
| 1041 | /// crate's) with the same reduced-partition flags lane-av1adst's r6 |
| 1042 | /// probe found still select `ADST_ADST`/`ADST_DCT`/`DCT_ADST` on |
| 1043 | /// gradient content (TX_SET_INTRA_2), and decodes it with |
| 1044 | /// [`decode_stream`] -- lifting the round-2 refusal is only real if it |
| 1045 | /// gets past an encoder this crate never wrote a byte of. |
| 1046 | pub |
| 1047 | |
| 1048 | |
| 1049 | |
| 1050 | /// As [`libaom_encode`], with extra encoder args appended -- used to pin |
| 1051 | /// a deterministic stream (`-threads 1` etc., since libaom's `cpu-used 8` |
| 1052 | /// RD search is not otherwise stable run-to-run on this box, and lavfi |
| 1053 | /// `gradients` needs its own `seed=` for the same reason) and to gate |
| 1054 | /// individual feature flags (`-enable-cdef 0`) a given fixture needs off. |
| 1055 | pub |
| 1056 | |
| 1057 | |
| 1058 | |
| 1059 | |
| 1060 | |
| 1061 | |
| 1062 | |
| 1063 | |
| 1064 | |
| 1065 | |
| 1066 | |
| 1067 | |
| 1068 | |
| 1069 | |
| 1070 | |
| 1071 | |
| 1072 | |
| 1073 | |
| 1074 | |
| 1075 | |
| 1076 | |
| 1077 | |
| 1078 | |
| 1079 | |
| 1080 | |
| 1081 | |
| 1082 | |
| 1083 | |
| 1084 | |
| 1085 | |
| 1086 | |
| 1087 | |
| 1088 | |
| 1089 | |
| 1090 | |
| 1091 | |
| 1092 | |
| 1093 | |
| 1094 | |
| 1095 | |
| 1096 | |
| 1097 | |
| 1098 | |
| 1099 | |
| 1100 | |
| 1101 | |
| 1102 | |
| 1103 | |
| 1104 | |
| 1105 | |
| 1106 | |
| 1107 | |
| 1108 | |
| 1109 | |
| 1110 | /// As [`ffmpeg_decode_sequence`], for a 4:4:4 stream: chroma planes are |
| 1111 | /// FULL resolution (`yuv444p` rawvideo), the shape lane-av1-llinter's |
| 1112 | /// lossless profile-1 fixture codes. |
| 1113 | pub |
| 1114 | |
| 1115 | |
| 1116 | |
| 1117 | |
| 1118 | |
| 1119 | |
| 1120 | |
| 1121 | |
| 1122 | /// lane-av1oracledepth: the depth-generic 4:4:4 oracle comparator -- the |
| 1123 | /// [`ffmpeg_decode_sequence_422_depth`] twin for full-resolution chroma. |
| 1124 | /// `yuv444p`, `yuv444p10le` or `yuv444p12le`, with the container width |
| 1125 | /// taken from `depth` itself (8 -> one byte per sample; 10/12 -> a 16-bit |
| 1126 | /// LE container on BOTH sides, so ours and ffmpeg's are directly |
| 1127 | /// comparable sample for sample and nothing narrows). Until this helper |
| 1128 | /// existed a 10/12-bit 4:4:4 gate had to fall back to the 8-bit |
| 1129 | /// `ffmpeg_decode_sequence_444`, which ffmpeg converts at `yuv444p` |
| 1130 | /// instead of refusing, or to a raw hand-rolled spawn (class |
| 1131 | /// `helper-assumes-the-shape-the-gate-name-implies`, the depth axis). |
| 1132 | /// |
| 1133 | /// Refused by SHAPE read from the stream's own sequence header, like its |
| 1134 | /// 4:2:0 siblings: `(0,0)` only, so a 4:2:2 or 4:2:0 stream handed here |
| 1135 | /// cannot have ffmpeg silently convert it. |
| 1136 | pub |
| 1137 | |
| 1138 | |
| 1139 | |
| 1140 | |
| 1141 | |
| 1142 | |
| 1143 | |
| 1144 | |
| 1145 | |
| 1146 | |
| 1147 | |
| 1148 | |
| 1149 | |
| 1150 | |
| 1151 | |
| 1152 | |
| 1153 | |
| 1154 | |
| 1155 | |
| 1156 | |
| 1157 | |
| 1158 | |
| 1159 | |
| 1160 | |
| 1161 | |
| 1162 | |
| 1163 | |
| 1164 | |
| 1165 | |
| 1166 | |
| 1167 | |
| 1168 | |
| 1169 | |
| 1170 | |
| 1171 | |
| 1172 | |
| 1173 | |
| 1174 | |
| 1175 | |
| 1176 | |
| 1177 | |
| 1178 | |
| 1179 | |
| 1180 | |
| 1181 | |
| 1182 | |
| 1183 | |
| 1184 | |
| 1185 | |
| 1186 | |
| 1187 | |
| 1188 | |
| 1189 | |
| 1190 | |
| 1191 | |
| 1192 | |
| 1193 | |
| 1194 | |
| 1195 | |
| 1196 | |
| 1197 | |
| 1198 | |
| 1199 | |
| 1200 | |
| 1201 | |
| 1202 | |
| 1203 | |
| 1204 | |
| 1205 | |
| 1206 | |
| 1207 | |
| 1208 | |
| 1209 | |
| 1210 | |
| 1211 | |
| 1212 | |
| 1213 | |
| 1214 | |
| 1215 | |
| 1216 | |
| 1217 | |
| 1218 | |
| 1219 | |
| 1220 | |
| 1221 | /// lane-av1422lift: as [`ffmpeg_decode_sequence`] (4:2:0 8-bit) and |
| 1222 | /// [`ffmpeg_decode_sequence_444`], for a 4:2:2 stream: `yuv422p` |
| 1223 | /// rawvideo, whose chroma planes are HALF WIDTH and FULL HEIGHT -- the |
| 1224 | /// `w/2 * h` shape the whole per-axis port exists to produce. A helper |
| 1225 | /// that computed the chroma span 4:2:0-style would make every 4:2:2 |
| 1226 | /// gate compare half the oracle's bytes and pass, so the span is |
| 1227 | /// asserted against the byte count below, not assumed. |
| 1228 | pub |
| 1229 | |
| 1230 | |
| 1231 | |
| 1232 | |
| 1233 | |
| 1234 | |
| 1235 | |
| 1236 | |
| 1237 | /// lane-av1422lift: the depth-generic 4:2:2 oracle comparator -- |
| 1238 | /// `yuv422p`, `yuv422p10le` or `yuv422p12le`, with the container width |
| 1239 | /// taken from `depth` itself (8 -> one byte per sample; 10/12 -> a |
| 1240 | /// 16-bit LE container on BOTH sides, so ours and ffmpeg's are directly |
| 1241 | /// comparable sample for sample and nothing narrows). |
| 1242 | pub |
| 1243 | |
| 1244 | |
| 1245 | |
| 1246 | |
| 1247 | |
| 1248 | |
| 1249 | |
| 1250 | |
| 1251 | |
| 1252 | |
| 1253 | |
| 1254 | |
| 1255 | |
| 1256 | |
| 1257 | |
| 1258 | |
| 1259 | |
| 1260 | |
| 1261 | |
| 1262 | |
| 1263 | |
| 1264 | |
| 1265 | |
| 1266 | |
| 1267 | |
| 1268 | |
| 1269 | |
| 1270 | |
| 1271 | |
| 1272 | |
| 1273 | |
| 1274 | |
| 1275 | |
| 1276 | |
| 1277 | |
| 1278 | |
| 1279 | |
| 1280 | |
| 1281 | |
| 1282 | |
| 1283 | |
| 1284 | |
| 1285 | |
| 1286 | |
| 1287 | |
| 1288 | |
| 1289 | |
| 1290 | |
| 1291 | |
| 1292 | |
| 1293 | |
| 1294 | |
| 1295 | |
| 1296 | |
| 1297 | |
| 1298 | |
| 1299 | |
| 1300 | |
| 1301 | |
| 1302 | |
| 1303 | |
| 1304 | |
| 1305 | |
| 1306 | |
| 1307 | /// lane-av1422lift: the shared body of every 4:2:2 exactness gate this |
| 1308 | /// lane adds, and the answer to "a byte-exact 4:2:2 gate can still be |
| 1309 | /// vacuous". |
| 1310 | /// |
| 1311 | /// Before lane-av1422census422 the per-plane coefficient-unit census was |
| 1312 | /// armed at `ss_x == 0 && ss_y == 0` only, so on a 4:2:2 stream |
| 1313 | /// `census_nonsub_units()` read `[0, 0, 0]` BY CONSTRUCTION -- a gate |
| 1314 | /// could have been green while the decode walked nothing at all. The |
| 1315 | /// census is now armed for `(ss_x == 0 || ss_y == 0)`, so the delta |
| 1316 | /// asserted here is a real measurement of the walk this stream caused: |
| 1317 | /// every plane must show a non-zero number of transform units AND of |
| 1318 | /// units that coded at least one coefficient. |
| 1319 | /// |
| 1320 | /// Four things are asserted per frame, in this order: |
| 1321 | /// |
| 1322 | /// 1. the decoded frame's dimensions, and that its chroma planes are |
| 1323 | /// `round_ss(w, 1) * round_ss(h, 0)` -- half width, FULL height. A |
| 1324 | /// decoder that kept 4:2:0 plane allocation while walking 4:2:2 |
| 1325 | /// entropy would pass a per-sample compare against a 4:2:0-sized |
| 1326 | /// oracle; this is the shape assertion that closes that hole, and it |
| 1327 | /// is asserted against the DECODED frame, never against the gate's |
| 1328 | /// own name. |
| 1329 | /// 2. the depth, read out of the stream's own sequence header. |
| 1330 | /// 3. per-plane, per-frame byte-exactness against ffmpeg's rawvideo of |
| 1331 | /// the same bytes at the depth-correct pixel format. Frame N of ours |
| 1332 | /// against frame N of ffmpeg's: `decode_stream` returns DISPLAY order |
| 1333 | /// and so does ffmpeg's rawvideo muxer, so a hidden alt-ref does not |
| 1334 | /// shift the pairing (the decode-order-vs-display-order trap the |
| 1335 | /// out-of-process corpus comparator has to solve separately). |
| 1336 | /// 4. the census delta, asserted once for the whole stream rather than |
| 1337 | /// per frame, because the counters are cumulative per thread. |
| 1338 | /// |
| 1339 | /// `require_coded` is false ONLY for a cell whose identity IS that it |
| 1340 | /// codes nothing -- `422_allskip_2f.obu`, whose whole point is that |
| 1341 | /// the inter frame reads no residual and the pre-port decoder read |
| 1342 | /// PHANTOM units there. Demanding coded units on it would be |
| 1343 | /// demanding the defect; its caller asserts the all-skip property |
| 1344 | /// directly instead. |
| 1345 | pub |
| 1346 | |
| 1347 | |
| 1348 | |
| 1349 | |
| 1350 | |
| 1351 | |
| 1352 | |
| 1353 | |
| 1354 | |
| 1355 | |
| 1356 | |
| 1357 | |
| 1358 | |
| 1359 | |
| 1360 | |
| 1361 | |
| 1362 | |
| 1363 | |
| 1364 | |
| 1365 | |
| 1366 | |
| 1367 | |
| 1368 | |
| 1369 | |
| 1370 | |
| 1371 | |
| 1372 | |
| 1373 | |
| 1374 | |
| 1375 | |
| 1376 | |
| 1377 | |
| 1378 | |
| 1379 | |
| 1380 | |
| 1381 | |
| 1382 | |
| 1383 | |
| 1384 | |
| 1385 | |
| 1386 | |
| 1387 | |
| 1388 | |
| 1389 | |
| 1390 | |
| 1391 | |
| 1392 | |
| 1393 | |
| 1394 | |
| 1395 | |
| 1396 | |
| 1397 | |
| 1398 | |
| 1399 | |
| 1400 | |
| 1401 | |
| 1402 | |
| 1403 | |
| 1404 | |
| 1405 | |
| 1406 | |
| 1407 | |
| 1408 | |
| 1409 | |
| 1410 | |
| 1411 | |
| 1412 | |
| 1413 | |
| 1414 | |
| 1415 | |
| 1416 | |
| 1417 | |
| 1418 | |
| 1419 | |
| 1420 | |
| 1421 | |
| 1422 | |
| 1423 | |
| 1424 | |
| 1425 | |
| 1426 | |
| 1427 | |
| 1428 | |
| 1429 | |
| 1430 | |
| 1431 | |
| 1432 | |
| 1433 | |
| 1434 | |
| 1435 | |
| 1436 | |
| 1437 | |
| 1438 | |
| 1439 | |
| 1440 | |
| 1441 | |
| 1442 | |
| 1443 | |
| 1444 | |
| 1445 | |
| 1446 | |
| 1447 | |
| 1448 | |
| 1449 | /// `(subsampling_x, subsampling_y, bit_depth)` out of the stream's OWN |
| 1450 | /// sequence header. A gate that claims to exercise a subsampling-specific |
| 1451 | /// path must assert this from the parsed header, not from the recipe that |
| 1452 | /// produced the fixture: the recipe can drift (or a wrong `--pix_fmt` |
| 1453 | /// argument can silently produce a different subsampling) and every other |
| 1454 | /// assertion would then pass vacuously. |
| 1455 | pub |
| 1456 | |
| 1457 | |
| 1458 | |
| 1459 | |
| 1460 | |
| 1461 | |
| 1462 | |
| 1463 | |
| 1464 | |
| 1465 | |
| 1466 | |
| 1467 | |
| 1468 | |
| 1469 | |
| 1470 | |
| 1471 | |
| 1472 | |
| 1473 | |
| 1474 | |
| 1475 | |
| 1476 | |
| 1477 | |
| 1478 | /// lane-av1gates444: the live 4:4:4 LOSSY cell the chroma-format sweep |
| 1479 | /// measured EXACT 4/4 and left unpinned. The recipe is the sweep's own |
| 1480 | /// §6.2 encode, reproduced LIVE against the oracle `aomenc` rather than |
| 1481 | /// from a pin, because the claim these three gates carry is a property |
| 1482 | /// of the *decoder* at a geometry, not of a blob: |
| 1483 | /// ```text |
| 1484 | /// ffmpeg -f lavfi -i "testsrc2=size=<W>x<H>:rate=25" -frames:v 4 \ |
| 1485 | /// -pix_fmt yuv444p -f yuv4mpegpipe - | \ |
| 1486 | /// aomenc --codec=av1 --profile=1 --passes=1 --end-usage=q --cq-level=20 \ |
| 1487 | /// --cpu-used=2 --threads=1 --row-mt=0 --lag-in-frames=0 \ |
| 1488 | /// --kf-max-dist=100 --limit=4 --obu -o - - |
| 1489 | /// ``` |
| 1490 | /// `rate=25` is load-bearing (testsrc2's pattern is time-parameterised) |
| 1491 | /// and `--limit=4` is the sweep's frame count: at `--limit=6` the same |
| 1492 | /// recipe emits 7674 / 11465 / 19121 bytes instead of the sweep's |
| 1493 | /// 5938 / 8945 / 15239, i.e. a different stream than the one measured. |
| 1494 | /// `--profile=1` is what makes the source 4:4:4 at all. |
| 1495 | /// |
| 1496 | /// Every assertion here is a non-vacuity assertion first and a pixel |
| 1497 | /// compare second. The frame count, the per-frame geometry and the |
| 1498 | /// FULL-RESOLUTION chroma plane length are asserted because a truncated |
| 1499 | /// or 4:2:0-shaped decode can pass a lenient compare; the |
| 1500 | /// `rect4_inter_own_chroma444_hits()` reach assert is there because the |
| 1501 | /// class these cells belong to is the 4:4:4-only own-chroma-extent route |
| 1502 | /// in [`decode_inter_block`]'s `around_c` (a 4:2:0 stream of the same |
| 1503 | /// content leaves it at 0), and a counter at 0 would mean the gate |
| 1504 | /// measured a different route than it names. |
| 1505 | /// The guard is [`have_aomenc`], which probes first and asserts LAST with |
| 1506 | /// the env escape: with `EC_AV1_REQUIRE_AOMENC` set, a missing oracle is |
| 1507 | /// a hard failure naming the path it looked for, and a batch run cannot |
| 1508 | /// report green off three skipped gates. With it unset the `None` below is |
| 1509 | /// a developer-only convenience for a checkout without an oracle -- it is |
| 1510 | /// the ONLY way this gate can return without measuring, and it announces |
| 1511 | /// itself on stderr naming the env var that would make it a failure. |
| 1512 | /// (It used to return an empty `Vec` that the caller turned into a silent |
| 1513 | /// early `return`: the same green, reached through a second exit nobody |
| 1514 | /// was reading.) |
| 1515 | pub |
| 1516 | |
| 1517 | |
| 1518 | |
| 1519 | |
| 1520 | |
| 1521 | |
| 1522 | |
| 1523 | |
| 1524 | |
| 1525 | |
| 1526 | |
| 1527 | |
| 1528 | |
| 1529 | |
| 1530 | |
| 1531 | |
| 1532 | |
| 1533 | |
| 1534 | |
| 1535 | |
| 1536 | |
| 1537 | |
| 1538 | |
| 1539 | |
| 1540 | |
| 1541 | |
| 1542 | |
| 1543 | |
| 1544 | |
| 1545 | |
| 1546 | |
| 1547 | |
| 1548 | |
| 1549 | |
| 1550 | |
| 1551 | |
| 1552 | |
| 1553 | |
| 1554 | |
| 1555 | |
| 1556 | |
| 1557 | |
| 1558 | |
| 1559 | |
| 1560 | |
| 1561 | |
| 1562 | |
| 1563 | |
| 1564 | |
| 1565 | |
| 1566 | |
| 1567 | |
| 1568 | |
| 1569 | |
| 1570 | |
| 1571 | |
| 1572 | |
| 1573 | |
| 1574 | |
| 1575 | |
| 1576 | |
| 1577 | |
| 1578 | |
| 1579 | |
| 1580 | |
| 1581 | |
| 1582 | |
| 1583 | /// lane-av1-loss64: the generator for the two gates below -- a deterministic |
| 1584 | /// 1-frame lossless superblock-128 aomenc stream of `testsrc2`. `extra` |
| 1585 | /// flags land last (aomenc keeps the LAST occurrence of a repeated flag). |
| 1586 | /// The recipe is the one lanes/av1rect14.report.md section 2 measured |
| 1587 | /// (`--lossless=1 --sb-size=128 --enable-1to4-partitions=1`); the |
| 1588 | /// `--min-partition-size` override is what steers the bottom superblock |
| 1589 | /// row's RD into overhanging 64x64 `NONE` blocks (the shape the first fix |
| 1590 | /// clips) or, at 8, keeps sub-8x8 partitions out of the second gate's |
| 1591 | /// stream so the whole frame is decodable. |
| 1592 | pub |
| 1593 | |
| 1594 | |
| 1595 | |
| 1596 | |
| 1597 | |
| 1598 | |
| 1599 | |
| 1600 | |
| 1601 | |
| 1602 | |
| 1603 | |
| 1604 | |
| 1605 | |
| 1606 | |
| 1607 | |
| 1608 | |
| 1609 | |
| 1610 | |
| 1611 | |
| 1612 | |
| 1613 | |
| 1614 | |
| 1615 | |
| 1616 | |
| 1617 | |
| 1618 | |
| 1619 | |
| 1620 | |
| 1621 | |
| 1622 | |
| 1623 | |
| 1624 | |
| 1625 | |
| 1626 | |
| 1627 | |
| 1628 | |
| 1629 | |
| 1630 | |
| 1631 | |
| 1632 | |
| 1633 | |
| 1634 | |
| 1635 | |
| 1636 | |
| 1637 | |
| 1638 | |
| 1639 | |
| 1640 | |
| 1641 | |
| 1642 | |
| 1643 | |
| 1644 | /// Path to a real `aomenc` build carrying the reference options this |
| 1645 | /// fixture needs (`--max-partition-size`, `--enable-tx-size-search`, |
| 1646 | /// `--loopfilter-control`) -- this box's `ffmpeg` links a libaom too old |
| 1647 | /// to expose `enable-tx-size-search`/`loopfilter-control` through its |
| 1648 | /// own `-aom-params` passthrough (probed live: "Cannot find aom |
| 1649 | /// option"), so [`a_real_aomenc_filter_intra_stream_decodes_pixel_exact`] |
| 1650 | /// shells out to the standalone binary instead of ffmpeg's libaom-av1 |
| 1651 | /// wrapper every other test here uses. `EC_AV1_AOMENC` overrides the |
| 1652 | /// default dev-build path; the test skips (not fails) when neither this |
| 1653 | /// nor `ffmpeg` is present. |
| 1654 | pub |
| 1655 | |
| 1656 | |
| 1657 | |
| 1658 | |
| 1659 | |
| 1660 | |
| 1661 | |
| 1662 | |
| 1663 | |
| 1664 | |
| 1665 | |
| 1666 | |
| 1667 | |
| 1668 | |
| 1669 | |
| 1670 | |
| 1671 | |
| 1672 | |
| 1673 | |
| 1674 | |
| 1675 | /// Whether the aomenc oracle is present. Absence normally SKIPs (a |
| 1676 | /// checkout without the oracle should still run the rest of the suite), |
| 1677 | /// but `EC_AV1_REQUIRE_AOMENC=1` turns it into a hard failure so a batch |
| 1678 | /// run cannot report green off 20 skipped gates. |
| 1679 | /// Where a pinned stream lives. `fixtures/` is a symlink to a durable |
| 1680 | /// directory outside the repo, so a pin captured in one session is still |
| 1681 | /// there in the next; a session scratchpad is not (tmpfs reaps it, and |
| 1682 | /// four pins were silently dead because of that). |
| 1683 | pub |
| 1684 | |
| 1685 | |
| 1686 | |
| 1687 | |
| 1688 | |
| 1689 | |
| 1690 | |
| 1691 | |
| 1692 | |
| 1693 | /// A COMMITTED pin: `crates/ec-av1/fixtures/<name>`, which travels in the |
| 1694 | /// tarball and is therefore present on every runner. `pin_dir()` resolves |
| 1695 | /// to the gitignored root `fixtures/`, so a pin written there is lost when |
| 1696 | /// the machine's scratchpad is reaped -- three gates sat at `rc=0` having |
| 1697 | /// tested nothing for exactly that reason (lane-av1pins). Falls back to |
| 1698 | /// `pin_dir()` so a locally re-captured stream still overrides. |
| 1699 | /// Read a pin that a gate cannot proceed without. A missing pin is a |
| 1700 | /// HARD failure naming the path and the generator, never a raw io panic |
| 1701 | /// and never a silent skip: `EC_AV1_GATE_DUMP_PIN` points the gate at a |
| 1702 | /// freshly captured stream, and a runner without the committed copy must |
| 1703 | /// say so instead of reporting green having tested nothing. |
| 1704 | pub |
| 1705 | |
| 1706 | |
| 1707 | |
| 1708 | |
| 1709 | |
| 1710 | |
| 1711 | |
| 1712 | |
| 1713 | |
| 1714 | |
| 1715 | pub |
| 1716 | |
| 1717 | |
| 1718 | |
| 1719 | |
| 1720 | |
| 1721 | |
| 1722 | |
| 1723 | |
| 1724 | |
| 1725 | |
| 1726 | pub |
| 1727 | |
| 1728 | |
| 1729 | |
| 1730 | |
| 1731 | |
| 1732 | |
| 1733 | |
| 1734 | |
| 1735 | |
| 1736 | /// lane-av1oracleskip: the probe for the ORACLE COMPARER, in the same |
| 1737 | /// shape as [`have_ffmpeg`] -- probe first, then `assert!` LAST, with the |
| 1738 | /// env escape -- and it prints its own SKIP so a caller cannot skip the |
| 1739 | /// compare silently. |
| 1740 | /// |
| 1741 | /// Why this exists: thirteen gates wrapped their oracle arm in a bare |
| 1742 | /// `if aomdec_path().is_file()`, and that shape had NO env escape at all. |
| 1743 | /// An oracle build with `aomenc` but no `aomdec` beside it (or an |
| 1744 | /// `EC_AV1_AOMDEC` override pointing at a moved path) made the gate |
| 1745 | /// encode, decode, assert its geometry and its counters, and then quietly |
| 1746 | /// never compare -- green having measured nothing, with no line in the |
| 1747 | /// output to notice. Nine of the thirteen printed a SKIP in an `else` and |
| 1748 | /// four printed nothing at all; both are the same defect, and both are |
| 1749 | /// closed by one probe. |
| 1750 | /// |
| 1751 | /// With `EC_AV1_REQUIRE_AOMENC` (or the aomdec-specific |
| 1752 | /// `EC_AV1_REQUIRE_AOMDEC`) set, the absence is a HARD failure naming the |
| 1753 | /// path that was looked for -- that is the batch-run guarantee, and it is |
| 1754 | /// what the bare `is_file()` could not give. With it unset the SKIP below |
| 1755 | /// is printed and the gate still passes: that remains a developer-only |
| 1756 | /// convenience for a checkout without an oracle, never evidence. |
| 1757 | pub |
| 1758 | |
| 1759 | |
| 1760 | |
| 1761 | |
| 1762 | |
| 1763 | |
| 1764 | |
| 1765 | |
| 1766 | |
| 1767 | |
| 1768 | |
| 1769 | |
| 1770 | |
| 1771 | |
| 1772 | |
| 1773 | |
| 1774 | |
| 1775 | |
| 1776 | |
| 1777 | |
| 1778 | // lane-av1cmpaudit2: this thread's oracle override, set by |
| 1779 | // `set_oracle_path` and consulted by `aomdec_path` ahead of the env var. |
| 1780 | // |
| 1781 | // It is thread-local for the same reason `FINAL_DUMP_PREFIX` is: the |
| 1782 | // control test `every_oracle_comparator_reds_on_a_one_byte_wrong_oracle` |
| 1783 | // has to hand the helpers a DELIBERATELY WRONG oracle, and a |
| 1784 | // process-global `std::env::set_var` could not do that safely -- the |
| 1785 | // crate forbids `unsafe_code`, and even where it did not, one test's |
| 1786 | // tampered oracle would leak into every sibling test's comparison |
| 1787 | // running on another thread. A thread-local override confines the wrong |
| 1788 | // oracle to the one thread that asked for it. |
| 1789 | thread_local! |
| 1790 | |
| 1791 | |
| 1792 | |
| 1793 | |
| 1794 | /// Points this thread's oracle helpers at `path`. `None` restores the |
| 1795 | /// real `aomdec`. |
| 1796 | pub |
| 1797 | |
| 1798 | |
| 1799 | |
| 1800 | // lane-film10fix: this thread's ffmpeg override, set by |
| 1801 | // `set_ffmpeg_path` and consulted by `ffmpeg_path` ahead of the bare |
| 1802 | // name. Same shape and same reason as `ORACLE_PATH` above: the control |
| 1803 | // test `every_ffmpeg_comparator_reds_on_a_one_sample_wrong_ffmpeg` has |
| 1804 | // to hand the `ffmpeg_decode_sequence*` helpers a DELIBERATELY WRONG |
| 1805 | // reference, and a process-global PATH edit would leak that wrong |
| 1806 | // reference into every sibling test decoding on another thread. The |
| 1807 | // crate forbids `unsafe_code`, so `std::env::set_var` is not available |
| 1808 | // either; a thread-local confines the tamper to the one thread. |
| 1809 | thread_local! |
| 1810 | |
| 1811 | |
| 1812 | |
| 1813 | |
| 1814 | /// Points this thread's `ffmpeg_decode_sequence*` helpers at `path`. |
| 1815 | /// `None` restores the real `ffmpeg` on PATH. |
| 1816 | pub |
| 1817 | |
| 1818 | |
| 1819 | |
| 1820 | /// The `ffmpeg` every reference helper in this module spawns. |
| 1821 | pub |
| 1822 | |
| 1823 | |
| 1824 | |
| 1825 | |
| 1826 | |
| 1827 | |
| 1828 | /// The instrumented `aomdec` beside the `aomenc` oracle |
| 1829 | /// (`scripts/build-aom-oracle.sh` + `scripts/instrument-aom-oracle.sh`). |
| 1830 | pub |
| 1831 | |
| 1832 | |
| 1833 | |
| 1834 | |
| 1835 | |
| 1836 | |
| 1837 | |
| 1838 | |
| 1839 | |
| 1840 | /// Decodes `stream` with both this decoder and the instrumented oracle |
| 1841 | /// `aomdec`, and compares EVERY decoded frame in DECODE order -- |
| 1842 | /// including the hidden (`show_frame == 0`) alt-ref frames no other gate |
| 1843 | /// in this repo can see, because `decode_stream` only pushes shown |
| 1844 | /// frames and `ffmpeg -f obu ... rawvideo` only emits shown frames |
| 1845 | /// (class gate-blind-to-hidden-frames: a hidden frame's defect surfaces |
| 1846 | /// only as drift on some later shown frame, if at all). |
| 1847 | /// |
| 1848 | /// Both sides write the final, post-deblock/CDEF/LR/superres frame as it |
| 1849 | /// is stored into the reference buffer (`EC_AV1_FINAL_DUMP`, ours in |
| 1850 | /// `decode_stream`, the oracle's in rung 12 of |
| 1851 | /// `scripts/instrument-aom-oracle.sh`), 8-bit as u8 / high bitdepth as |
| 1852 | /// u16 LE. Returns `(frames_decoded, hidden_frames)`. |
| 1853 | pub |
| 1854 | |
| 1855 | |
| 1856 | |
| 1857 | |
| 1858 | |
| 1859 | |
| 1860 | |
| 1861 | |
| 1862 | |
| 1863 | |
| 1864 | |
| 1865 | |
| 1866 | |
| 1867 | |
| 1868 | |
| 1869 | |
| 1870 | |
| 1871 | |
| 1872 | |
| 1873 | |
| 1874 | |
| 1875 | |
| 1876 | |
| 1877 | |
| 1878 | |
| 1879 | |
| 1880 | |
| 1881 | |
| 1882 | |
| 1883 | |
| 1884 | |
| 1885 | |
| 1886 | |
| 1887 | |
| 1888 | |
| 1889 | |
| 1890 | |
| 1891 | |
| 1892 | |
| 1893 | |
| 1894 | |
| 1895 | |
| 1896 | |
| 1897 | |
| 1898 | |
| 1899 | |
| 1900 | |
| 1901 | |
| 1902 | |
| 1903 | |
| 1904 | |
| 1905 | |
| 1906 | |
| 1907 | |
| 1908 | |
| 1909 | |
| 1910 | |
| 1911 | |
| 1912 | |
| 1913 | |
| 1914 | |
| 1915 | |
| 1916 | |
| 1917 | |
| 1918 | |
| 1919 | |
| 1920 | |
| 1921 | |
| 1922 | |
| 1923 | |
| 1924 | |
| 1925 | |
| 1926 | |
| 1927 | |
| 1928 | |
| 1929 | |
| 1930 | /// lane-av1422anom: a COUNTING oracle comparison. |
| 1931 | /// |
| 1932 | /// [`assert_rawvideo_matches`] is the right tool for "these must be equal" |
| 1933 | /// and the wrong tool for a lane that has to classify many cells: it |
| 1934 | /// panics on the first differing byte, so it answers one cell per process |
| 1935 | /// and cannot report a magnitude. This returns the count instead. |
| 1936 | /// |
| 1937 | /// It exists because the previous lane's per-cell counter was tautological: |
| 1938 | /// it packed our own decoded samples into `ours` and then compared `ours` |
| 1939 | /// against the same samples, never touching the oracle's bytes, so it |
| 1940 | /// reported "0 wrong" on every cell including one that differs from |
| 1941 | /// `aomdec` in 1612 samples. [`the_counting_oracle_diff_reports_a_real_difference`] |
| 1942 | /// below is the test that keeps that mistake from recurring. |
| 1943 | /// |
| 1944 | /// Returns `(wrong_y, wrong_u, wrong_v, frames_total, frames_exact)`, or |
| 1945 | /// `None` when the two sides are not byte-comparable at all (a size |
| 1946 | /// mismatch, which is a different failure and must not read as "exact"). |
| 1947 | /// `flip` flips ONE bit of the ORACLE's own bytes before comparing, so |
| 1948 | /// [`the_counting_oracle_diff_detects_one_flipped_oracle_byte`] can prove |
| 1949 | /// the comparison still reads the oracle on a stream that is now exact. |
| 1950 | pub |
| 1951 | |
| 1952 | |
| 1953 | |
| 1954 | |
| 1955 | |
| 1956 | |
| 1957 | |
| 1958 | |
| 1959 | |
| 1960 | |
| 1961 | |
| 1962 | |
| 1963 | |
| 1964 | |
| 1965 | |
| 1966 | |
| 1967 | |
| 1968 | |
| 1969 | |
| 1970 | |
| 1971 | |
| 1972 | |
| 1973 | |
| 1974 | |
| 1975 | |
| 1976 | |
| 1977 | |
| 1978 | |
| 1979 | |
| 1980 | |
| 1981 | |
| 1982 | |
| 1983 | |
| 1984 | |
| 1985 | |
| 1986 | |
| 1987 | |
| 1988 | |
| 1989 | |
| 1990 | |
| 1991 | |
| 1992 | |
| 1993 | |
| 1994 | |
| 1995 | |
| 1996 | |
| 1997 | |
| 1998 | |
| 1999 | |
| 2000 | |
| 2001 | |
| 2002 | |
| 2003 | |
| 2004 | |
| 2005 | |
| 2006 | |
| 2007 | |
| 2008 | |
| 2009 | |
| 2010 | |
| 2011 | |
| 2012 | |
| 2013 | |
| 2014 | |
| 2015 | |
| 2016 | |
| 2017 | |
| 2018 | |
| 2019 | |
| 2020 | |
| 2021 | |
| 2022 | |
| 2023 | |
| 2024 | |
| 2025 | |
| 2026 | |
| 2027 | |
| 2028 | |
| 2029 | |
| 2030 | |
| 2031 | |
| 2032 | |
| 2033 | |
| 2034 | |
| 2035 | |
| 2036 | |
| 2037 | |
| 2038 | |
| 2039 | |
| 2040 | |
| 2041 | |
| 2042 | |
| 2043 | |
| 2044 | |
| 2045 | |
| 2046 | |
| 2047 | |
| 2048 | /// lane-hidden r2: the `--arnr-maxframes=0` SECOND ARM of an existing |
| 2049 | /// gate -- the gate's own recipe is never changed, this re-encodes the |
| 2050 | /// same fixture with libaom's temporal alt-ref filter switched off and |
| 2051 | /// runs [`decode_all_frames_vs_oracle`] on the result. Measured: with |
| 2052 | /// the filter at its default EVERY alt-ref recipe in this file emits |
| 2053 | /// ZERO hidden frames (the candidates are filtered away), so the |
| 2054 | /// hidden-frame compare on the gate's own stream is vacuous; this arm |
| 2055 | /// is what actually puts `show_frame == 0` frames on the wire. |
| 2056 | /// |
| 2057 | /// Runs at most once per gate name per process (the loop gates sweep |
| 2058 | /// dozens of attempts and each arm costs a full encode + two decodes). |
| 2059 | /// A stream this decoder refuses BY NAME skips the arm -- the arm is |
| 2060 | /// about hidden frames, not about that capability gap -- while a pixel |
| 2061 | /// mismatch is a hard failure raised inside the compare. |
| 2062 | pub |
| 2063 | |
| 2064 | |
| 2065 | |
| 2066 | |
| 2067 | |
| 2068 | |
| 2069 | |
| 2070 | |
| 2071 | |
| 2072 | |
| 2073 | |
| 2074 | |
| 2075 | |
| 2076 | |
| 2077 | |
| 2078 | |
| 2079 | |
| 2080 | |
| 2081 | |
| 2082 | |
| 2083 | |
| 2084 | |
| 2085 | |
| 2086 | |
| 2087 | |
| 2088 | |
| 2089 | |
| 2090 | |
| 2091 | |
| 2092 | |
| 2093 | |
| 2094 | |
| 2095 | |
| 2096 | |
| 2097 | |
| 2098 | |
| 2099 | /// lane-av1toolgates: the gate-level WITNESS, summed over the arms that |
| 2100 | /// decoded AND compared. It cannot be asserted per arm: the cq20 / |
| 2101 | /// tx-size-search=1 arm reaches a rect transform through the var-tx |
| 2102 | /// search on a SQUARE block (a nonzero rect coefficient count with zero |
| 2103 | /// rect partitions read -- the purest form of what `--enable-rect-tx` |
| 2104 | /// buys), while the rect PARTITION only shows up on the |
| 2105 | /// tx-size-search=0 arm. Either fact alone would let a stream through on |
| 2106 | /// which the tool was allowed and unused, which is the defect this |
| 2107 | /// coverage entry was written for; together they are the parsed-shape |
| 2108 | /// evidence the entry asked for. |
| 2109 | |
| 2110 | pub |
| 2111 | |
| 2112 | |
| 2113 | |
| 2114 | |
| 2115 | |
| 2116 | |
| 2117 | |
| 2118 | |
| 2119 | |
| 2120 | |
| 2121 | |
| 2122 | |
| 2123 | |
| 2124 | /// lane-t900 r31: builds one `--tune-content=screen --enable-intrabc=1` |
| 2125 | /// key frame, 256x192 8-bit, from a deterministic lavfi source. `tiled` |
| 2126 | /// renders a 2x2 tiling of a 128x96 pattern -- exact spatial repetition, |
| 2127 | /// the content intra block copy exists for; `square_only` turns the rect |
| 2128 | /// and 1:4 partitions off so an intrabc block lands on a SQUARE block |
| 2129 | /// instead of stopping on the rect-strip intrabc refusal first. |
| 2130 | pub |
| 2131 | |
| 2132 | |
| 2133 | |
| 2134 | |
| 2135 | |
| 2136 | |
| 2137 | |
| 2138 | |
| 2139 | |
| 2140 | /// [`screen_intrabc_stream`] with per-arm flags appended AFTER the base |
| 2141 | /// recipe -- aomenc keeps the LAST occurrence of a repeated flag, so an |
| 2142 | /// arm can override `--sb-size` / `--min-partition-size` here. |
| 2143 | pub |
| 2144 | |
| 2145 | |
| 2146 | |
| 2147 | |
| 2148 | |
| 2149 | |
| 2150 | |
| 2151 | |
| 2152 | |
| 2153 | |
| 2154 | /// [`screen_intrabc_stream_with`] at an explicit bit depth (8 or 10): the |
| 2155 | /// lavfi source is rendered straight to that depth's yuv4mpegpipe pixel |
| 2156 | /// format and aomenc is told to encode at the matching |
| 2157 | /// `--bit-depth`/`--input-bit-depth`, so a 10-bit arm produces a genuine |
| 2158 | /// high-bit-depth stream rather than an 8-bit one in disguise. |
| 2159 | pub |
| 2160 | |
| 2161 | |
| 2162 | |
| 2163 | |
| 2164 | |
| 2165 | |
| 2166 | |
| 2167 | |
| 2168 | |
| 2169 | |
| 2170 | |
| 2171 | |
| 2172 | |
| 2173 | |
| 2174 | |
| 2175 | |
| 2176 | |
| 2177 | |
| 2178 | |
| 2179 | |
| 2180 | |
| 2181 | |
| 2182 | |
| 2183 | |
| 2184 | |
| 2185 | |
| 2186 | |
| 2187 | |
| 2188 | |
| 2189 | |
| 2190 | |
| 2191 | |
| 2192 | |
| 2193 | |
| 2194 | |
| 2195 | |
| 2196 | |
| 2197 | |
| 2198 | |
| 2199 | |
| 2200 | |
| 2201 | |
| 2202 | |
| 2203 | |
| 2204 | |
| 2205 | |
| 2206 | |
| 2207 | |
| 2208 | |
| 2209 | |
| 2210 | |
| 2211 | |
| 2212 | |
| 2213 | |
| 2214 | |
| 2215 | |
| 2216 | |
| 2217 | |
| 2218 | |
| 2219 | |
| 2220 | |
| 2221 | |
| 2222 | |
| 2223 | |
| 2224 | |
| 2225 | |
| 2226 | |
| 2227 | |
| 2228 | |
| 2229 | |
| 2230 | |
| 2231 | |
| 2232 | |
| 2233 | |
| 2234 | |
| 2235 | |
| 2236 | |
| 2237 | |
| 2238 | |
| 2239 | |
| 2240 | |
| 2241 | |
| 2242 | |
| 2243 | |
| 2244 | |
| 2245 | |
| 2246 | |
| 2247 | |
| 2248 | |
| 2249 | |
| 2250 | |
| 2251 | |
| 2252 | |
| 2253 | |
| 2254 | |
| 2255 | |
| 2256 | |
| 2257 | |
| 2258 | |
| 2259 | /// The sequence header's `use_128x128_superblock`, and how many frames of |
| 2260 | /// `stream` keep `allow_intrabc` -- the two bits the refusal "intrabc |
| 2261 | /// under a 128x128 superblock" is the conjunction of, read out of the |
| 2262 | /// headers rather than assumed from the flags handed to the encoder. |
| 2263 | pub |
| 2264 | |
| 2265 | |
| 2266 | |
| 2267 | |
| 2268 | |
| 2269 | |
| 2270 | |
| 2271 | |
| 2272 | |
| 2273 | |
| 2274 | |
| 2275 | |
| 2276 | |
| 2277 | |
| 2278 | |
| 2279 | |
| 2280 | |
| 2281 | |
| 2282 | |
| 2283 | |
| 2284 | |
| 2285 | |
| 2286 | |
| 2287 | /// How many frames of `stream` carry `tx_mode == Select`, and how many of |
| 2288 | /// those also keep `allow_intrabc` -- the frame-level premise of the |
| 2289 | /// refusal "an intrabc block under TxMode::Select", read out of the |
| 2290 | /// headers rather than assumed from the flags handed to the encoder |
| 2291 | /// (libaom clears `allow_intrabc` again when no block picked it, |
| 2292 | /// encodeframe.c:2336). |
| 2293 | pub |
| 2294 | |
| 2295 | |
| 2296 | |
| 2297 | |
| 2298 | |
| 2299 | |
| 2300 | |
| 2301 | |
| 2302 | |
| 2303 | |
| 2304 | |
| 2305 | |
| 2306 | |
| 2307 | |
| 2308 | |
| 2309 | |
| 2310 | |
| 2311 | |
| 2312 | |
| 2313 | |
| 2314 | |
| 2315 | |
| 2316 | // /// lane-hbd r5: a real `aomenc --bit-depth=10` stream, decoded through |
| 2317 | // /// this crate's own 10-bit planes (`Picture` widened to `u16` in an |
| 2318 | // /// earlier round) and checked pixel-exact against ffmpeg's own decode of |
| 2319 | // /// the identical bytes via [`ffmpeg_decode_sequence_10bit`]. Confirms |
| 2320 | // /// (hard-asserts, not just trusts) the sequence header this stream |
| 2321 | // /// actually parses to says `bit_depth == 10` before trusting any pixel |
| 2322 | // /// match -- a stream that silently fell back to 8-bit would still |
| 2323 | // /// "match" trivially. |
| 2324 | // ------------------------------------------------------------------- |
| 2325 | // lane-av112bit: the 12-bit gate battery. The blanket refusal is lifted |
| 2326 | // for what these gates witness byte-exact against ffmpeg on real |
| 2327 | // `aomenc --bit-depth=12 --profile=2` streams: the full intra stack, |
| 2328 | // dequant/transforms at the 12-bit dequant tables, deblock, CDEF, loop |
| 2329 | // restoration (Wiener AND SGR), and translational subpel motion |
| 2330 | // compensation through the bit-depth-parameterised `round_0`/`round_1` |
| 2331 | // (libaom `convolve.h:81..86`). Everything else stays refused by name: |
| 2332 | // warp and screen content tools (palette/intrabc) at the frame level, |
| 2333 | // each with its own real-stream refusal gate below. |
| 2334 | // lane-av112bitc: compound joined the witnessed set (refusal gate became |
| 2335 | // the six-frame compound witness). |
| 2336 | // lane-av112bitg: film grain joined the witnessed set (refusal gate became |
| 2337 | // `a_real_aomenc_12bit_film_grain_stream_decodes_pixel_exact`). |
| 2338 | // ------------------------------------------------------------------- |
| 2339 | /// The 12-bit witness source, byte-identical to the lane's committed |
| 2340 | /// fixture recipe: 160x128 C420p12, a gradient + fine-texture base with a |
| 2341 | /// 24x20 box that travels 1.25 px/frame horizontally and 0.75 px/frame |
| 2342 | /// vertically with linear edge coverage -- sub-pixel true motion, so an |
| 2343 | /// inter frame over it cannot be coded whole-pel-only. |
| 2344 | pub |
| 2345 | |
| 2346 | |
| 2347 | |
| 2348 | |
| 2349 | |
| 2350 | |
| 2351 | |
| 2352 | |
| 2353 | |
| 2354 | |
| 2355 | |
| 2356 | |
| 2357 | |
| 2358 | |
| 2359 | |
| 2360 | |
| 2361 | |
| 2362 | |
| 2363 | |
| 2364 | |
| 2365 | |
| 2366 | |
| 2367 | |
| 2368 | |
| 2369 | |
| 2370 | |
| 2371 | |
| 2372 | |
| 2373 | |
| 2374 | |
| 2375 | |
| 2376 | |
| 2377 | |
| 2378 | |
| 2379 | |
| 2380 | |
| 2381 | |
| 2382 | |
| 2383 | |
| 2384 | |
| 2385 | |
| 2386 | |
| 2387 | |
| 2388 | |
| 2389 | |
| 2390 | /// lane-av1gwarp12 fixture: rotating + uniformly zooming mandelbrot as a |
| 2391 | /// C420p12 y4m. Rotation composed with a UNIFORM scale is a similarity |
| 2392 | /// transform -- exactly the family a 4-parameter ROTZOOM global model |
| 2393 | /// expresses (the affine gate needs the anisotropic stretch to force |
| 2394 | /// 6 parameters; this lane needs the model vanilla aomenc actually |
| 2395 | /// searches, ROTZOOM). |
| 2396 | pub |
| 2397 | |
| 2398 | |
| 2399 | |
| 2400 | |
| 2401 | |
| 2402 | |
| 2403 | |
| 2404 | |
| 2405 | |
| 2406 | |
| 2407 | |
| 2408 | |
| 2409 | |
| 2410 | |
| 2411 | |
| 2412 | |
| 2413 | |
| 2414 | |
| 2415 | |
| 2416 | |
| 2417 | |
| 2418 | |
| 2419 | |
| 2420 | |
| 2421 | |
| 2422 | |
| 2423 | |
| 2424 | |
| 2425 | |
| 2426 | |
| 2427 | |
| 2428 | |
| 2429 | |
| 2430 | |
| 2431 | |
| 2432 | |
| 2433 | |
| 2434 | |
| 2435 | |
| 2436 | |
| 2437 | /// The 12-bit coding recipe shared by the witness gates (cpu-used=0 so |
| 2438 | /// every search runs; explicit CDEF/restoration ON). Warp/global-motion |
| 2439 | /// are deliberately NOT spelled here: this aomenc honours the LAST |
| 2440 | /// occurrence of these flags (measured), so a base pin plus an override |
| 2441 | /// would silently take the base value -- each gate spells what it needs |
| 2442 | /// exactly once. |
| 2443 | pub |
| 2444 | |
| 2445 | |
| 2446 | |
| 2447 | |
| 2448 | |
| 2449 | |
| 2450 | |
| 2451 | |
| 2452 | |
| 2453 | |
| 2454 | |
| 2455 | |
| 2456 | |
| 2457 | |
| 2458 | |
| 2459 | |
| 2460 | |
| 2461 | |
| 2462 | |
| 2463 | |
| 2464 | |
| 2465 | |
| 2466 | |
| 2467 | |
| 2468 | |
| 2469 | |
| 2470 | |
| 2471 | |
| 2472 | |
| 2473 | |
| 2474 | |
| 2475 | |
| 2476 | |
| 2477 | |
| 2478 | |
| 2479 | |
| 2480 | /// Asserts the stream's sequence header really says 12-bit before any |
| 2481 | /// pixel comparison is trusted. |
| 2482 | pub |
| 2483 | |
| 2484 | |
| 2485 | |
| 2486 | |
| 2487 | |
| 2488 | |
| 2489 | |
| 2490 | |
| 2491 | |
| 2492 | |
| 2493 | |
| 2494 | |
| 2495 | |
| 2496 | |
| 2497 | |
| 2498 | pub |
| 2499 | |
| 2500 | |
| 2501 | |
| 2502 | |
| 2503 | |
| 2504 | |
| 2505 | |
| 2506 | |
| 2507 | |
| 2508 | |
| 2509 | |
| 2510 | |
| 2511 | |
| 2512 | |
| 2513 | |
| 2514 | |
| 2515 | |
| 2516 | |
| 2517 | |
| 2518 | |
| 2519 | |
| 2520 | |
| 2521 | |
| 2522 | |
| 2523 | |
| 2524 | |
| 2525 | |
| 2526 | |
| 2527 | |
| 2528 | |
| 2529 | |
| 2530 | |
| 2531 | |
| 2532 | |
| 2533 | |
| 2534 | |
| 2535 | |
| 2536 | |
| 2537 | |
| 2538 | |
| 2539 | |
| 2540 | |
| 2541 | |
| 2542 | |
| 2543 | |
| 2544 | |
| 2545 | |
| 2546 | |
| 2547 | |
| 2548 | |
| 2549 | |
| 2550 | |
| 2551 | |
| 2552 | |
| 2553 | |
| 2554 | |
| 2555 | |
| 2556 | |
| 2557 | |
| 2558 | |
| 2559 | /// lane-av1screen12: how many frames of `stream` carry |
| 2560 | /// `allow_screen_content_tools`, and how many of THOSE carry |
| 2561 | /// `allow_intrabc`. Both are read out of the frame headers this crate |
| 2562 | /// parsed, never taken from the flags handed to the encoder (class |
| 2563 | /// `tool-disabled-in-every-gate`): on this oracle build |
| 2564 | /// `--tune-content=screen` does NOT by itself decide the frame-header |
| 2565 | /// `allow_intrabc` bit -- an untiled `smptebars=size=128x96` source reads |
| 2566 | /// `false` with and without the flag, while the 256x192 `tile=2x2` source |
| 2567 | /// the intrabc census uses reads `true` with and without it (measured; |
| 2568 | /// libaom's content detector, `encoder.c:2404`, is what decides it). |
| 2569 | pub |
| 2570 | |
| 2571 | |
| 2572 | |
| 2573 | |
| 2574 | |
| 2575 | |
| 2576 | |
| 2577 | |
| 2578 | |
| 2579 | |
| 2580 | |
| 2581 | |
| 2582 | |
| 2583 | |
| 2584 | |
| 2585 | |
| 2586 | |
| 2587 | |
| 2588 | |
| 2589 | |
| 2590 | |
| 2591 | |
| 2592 | |
| 2593 | |
| 2594 | |
| 2595 | /// The three committed 12-bit screen-content witnesses, by literal name |
| 2596 | /// (a pin name built from a loop variable leaves the pin census |
| 2597 | /// unproven), with the length and `fnv1a64` each gate asserts. sha256, |
| 2598 | /// recorded in the gates' doc comments and in |
| 2599 | /// `lanes/av1screen12.report.md`: |
| 2600 | /// |
| 2601 | /// * `screen12_palette.obu` 3616 bytes, |
| 2602 | /// `adfe26c67c08a7e986db2743b914ecc3e214c56dd2abbdfd17ebf99f06de64c8` |
| 2603 | /// * `screen12_intrabc.obu` 482 bytes, |
| 2604 | /// `a3b6b94cabdd09a12057c4688990d55495826b87a14332c386d319629070382e` |
| 2605 | /// * `screen12_lossless_palette.obu` 11698 bytes, |
| 2606 | /// `ec7942c96763593e6d8e4b3fb23c03930bba3bb743102d0cf552fe73ae11c203` |
| 2607 | pub const PIN_LEN_PALETTE: usize = 3616; |
| 2608 | |
| 2609 | pub const PIN_FNV_PALETTE: u64 = 0xf9bb_d408_61d6_f0da; |
| 2610 | |
| 2611 | pub const PIN_LEN_INTRABC: usize = 482; |
| 2612 | |
| 2613 | pub const PIN_FNV_INTRABC: u64 = 0xae83_3eb7_9380_263b; |
| 2614 | |
| 2615 | pub const PIN_LEN_LOSSLESS: usize = 11698; |
| 2616 | |
| 2617 | pub const PIN_FNV_LOSSLESS: u64 = 0x6e28_41c7_7b0a_f9db; |
| 2618 | |
| 2619 | /// lane-av1screen12: the shared body of the three 12-bit screen-content |
| 2620 | /// gates. Every assertion a "this arm really is 12-bit screen content, |
| 2621 | /// and this decoder reproduces it" claim needs, in one place: |
| 2622 | /// |
| 2623 | /// 1. the committed PIN is the witness -- its length and fnv1a64 are |
| 2624 | /// pinned, and `require_pin` HARD-fails on a missing copy rather than |
| 2625 | /// testing nothing; |
| 2626 | /// 2. the live recipe reproduces that pin byte for byte (aomenc present), |
| 2627 | /// so the recipe in the doc comment is not decoration; |
| 2628 | /// 3. the stream's OWN sequence header says 12-bit and its frame headers |
| 2629 | /// say `allow_screen_content_tools` (and `allow_intrabc` for the arm |
| 2630 | /// that wants it); |
| 2631 | /// 4. the decode ENGAGED the feature -- `palette_hits()` / |
| 2632 | /// `palette_uv_hits()` / `intrabc_hits()` deltas are hard-asserted, |
| 2633 | /// because a stream that merely carries the header bit would leave the |
| 2634 | /// arm it claims to witness untested (class `gate-blind-to-feature`); |
| 2635 | /// 5. every sample of every frame matches the instrumented `aomdec |
| 2636 | /// --rawvideo` (`assert_rawvideo_matches`), and independently ffmpeg; |
| 2637 | /// 6. THE CONTROL: the same counting comparator, run twice -- clean it |
| 2638 | /// must report zero wrong samples in all three planes, and with ONE |
| 2639 | /// bit flipped in the ORACLE's own frame-0 luma high byte it must |
| 2640 | /// report exactly one wrong luma byte and one fewer exact frame. That |
| 2641 | /// is the proof the comparator READS the oracle side: a comparator |
| 2642 | /// that compared our samples with themselves would report 0 both |
| 2643 | /// times (class `oracle-diff-counter-tautology`). |
| 2644 | /// |
| 2645 | /// Flip index 1 is the high byte of the first luma sample of frame 0. |
| 2646 | /// A 12-bit sample's high byte holds bits 8..15 only, so flipping its low |
| 2647 | /// bit can never carry into another byte: the move is exactly +1 wrong |
| 2648 | /// byte in the Y plane, which is what makes "+1 in the right plane and |
| 2649 | /// frame" a real statement rather than a hope. |
| 2650 | |
| 2651 | pub |
| 2652 | |
| 2653 | |
| 2654 | |
| 2655 | |
| 2656 | |
| 2657 | |
| 2658 | |
| 2659 | |
| 2660 | |
| 2661 | |
| 2662 | |
| 2663 | |
| 2664 | |
| 2665 | |
| 2666 | |
| 2667 | |
| 2668 | |
| 2669 | |
| 2670 | |
| 2671 | |
| 2672 | |
| 2673 | |
| 2674 | |
| 2675 | |
| 2676 | |
| 2677 | |
| 2678 | |
| 2679 | |
| 2680 | |
| 2681 | |
| 2682 | |
| 2683 | |
| 2684 | |
| 2685 | |
| 2686 | |
| 2687 | |
| 2688 | |
| 2689 | |
| 2690 | |
| 2691 | |
| 2692 | |
| 2693 | |
| 2694 | |
| 2695 | |
| 2696 | |
| 2697 | |
| 2698 | |
| 2699 | |
| 2700 | |
| 2701 | |
| 2702 | |
| 2703 | |
| 2704 | |
| 2705 | |
| 2706 | |
| 2707 | |
| 2708 | |
| 2709 | |
| 2710 | |
| 2711 | |
| 2712 | |
| 2713 | |
| 2714 | |
| 2715 | |
| 2716 | |
| 2717 | |
| 2718 | |
| 2719 | |
| 2720 | |
| 2721 | |
| 2722 | |
| 2723 | |
| 2724 | |
| 2725 | |
| 2726 | |
| 2727 | |
| 2728 | |
| 2729 | |
| 2730 | |
| 2731 | |
| 2732 | |
| 2733 | |
| 2734 | |
| 2735 | |
| 2736 | |
| 2737 | |
| 2738 | |
| 2739 | |
| 2740 | |
| 2741 | |
| 2742 | |
| 2743 | |
| 2744 | |
| 2745 | |
| 2746 | |
| 2747 | |
| 2748 | |
| 2749 | |
| 2750 | |
| 2751 | |
| 2752 | |
| 2753 | |
| 2754 | |
| 2755 | |
| 2756 | |
| 2757 | |
| 2758 | |
| 2759 | |
| 2760 | |
| 2761 | |
| 2762 | |
| 2763 | |
| 2764 | |
| 2765 | |
| 2766 | |
| 2767 | |
| 2768 | |
| 2769 | |
| 2770 | |
| 2771 | |
| 2772 | |
| 2773 | |
| 2774 | |
| 2775 | |
| 2776 | /// Renders a 12-bit y4m for the 12-bit screen-content gates. `tiled` |
| 2777 | /// applies `-vf tile=2x2`, which is what takes the source from 128x96 to |
| 2778 | /// the 256x192 shape libaom's content detector clears the (stricter) |
| 2779 | /// IntraBC threshold on. |
| 2780 | pub |
| 2781 | |
| 2782 | |
| 2783 | |
| 2784 | |
| 2785 | |
| 2786 | |
| 2787 | |
| 2788 | |
| 2789 | |
| 2790 | |
| 2791 | |
| 2792 | |
| 2793 | |
| 2794 | |
| 2795 | |
| 2796 | |
| 2797 | |
| 2798 | |
| 2799 | |
| 2800 | |
| 2801 | |
| 2802 | |
| 2803 | |
| 2804 | |
| 2805 | |
| 2806 | |
| 2807 | |
| 2808 | /// Shared body for the lane-av1superhbd HIGH-BIT-DEPTH 4:4:4 superres |
| 2809 | /// arms: 10-bit and 12-bit, `--superres-mode=1` at a fixed denominator |
| 2810 | /// and `--superres-mode=2` (a per-frame denominator libaom picks itself). |
| 2811 | /// |
| 2812 | /// Everything the 8-bit 4:4:4 superres cell is non-vacuous by, repeated |
| 2813 | /// here, plus the one thing that only matters above 8 bits: the gate |
| 2814 | /// asserts the PARSED `bit_depth` equals the depth it names, because a |
| 2815 | /// 10-bit recipe whose flags were mistyped still decodes -- it just |
| 2816 | /// decodes a DIFFERENT cell than the gate claims, which is the same |
| 2817 | /// "phantom cell" trap lane-av1444edge r3 recorded for |
| 2818 | /// `use_superres=false`. |
| 2819 | /// |
| 2820 | /// The per-frame table is `(denominator, coded_width)` in DECODE order. |
| 2821 | /// The coded width is re-derived as `(UpscaledWidth*8 + denom/2)/denom` |
| 2822 | /// from that frame's OWN parsed denominator rather than only compared to |
| 2823 | /// a literal, so a re-pinned fixture cannot satisfy the literals while |
| 2824 | /// the scaled-size arithmetic moves under them. `superres_hits` and |
| 2825 | /// `predict_scaled_hits` are asserted as DELTAS (both are process-wide |
| 2826 | /// counters with no reset). |
| 2827 | |
| 2828 | pub |
| 2829 | |
| 2830 | |
| 2831 | |
| 2832 | |
| 2833 | |
| 2834 | |
| 2835 | |
| 2836 | |
| 2837 | |
| 2838 | |
| 2839 | |
| 2840 | |
| 2841 | |
| 2842 | |
| 2843 | |
| 2844 | |
| 2845 | |
| 2846 | |
| 2847 | |
| 2848 | |
| 2849 | |
| 2850 | |
| 2851 | |
| 2852 | |
| 2853 | |
| 2854 | |
| 2855 | |
| 2856 | |
| 2857 | |
| 2858 | |
| 2859 | |
| 2860 | |
| 2861 | |
| 2862 | |
| 2863 | |
| 2864 | |
| 2865 | |
| 2866 | |
| 2867 | |
| 2868 | |
| 2869 | |
| 2870 | |
| 2871 | |
| 2872 | |
| 2873 | |
| 2874 | |
| 2875 | |
| 2876 | |
| 2877 | |
| 2878 | |
| 2879 | |
| 2880 | |
| 2881 | |
| 2882 | |
| 2883 | |
| 2884 | |
| 2885 | |
| 2886 | |
| 2887 | |
| 2888 | |
| 2889 | |
| 2890 | |
| 2891 | |
| 2892 | |
| 2893 | |
| 2894 | |
| 2895 | |
| 2896 | |
| 2897 | |
| 2898 | |
| 2899 | |
| 2900 | |
| 2901 | |
| 2902 | |
| 2903 | |
| 2904 | |
| 2905 | |
| 2906 | |
| 2907 | |
| 2908 | |
| 2909 | |
| 2910 | |
| 2911 | |
| 2912 | |
| 2913 | |
| 2914 | |
| 2915 | |
| 2916 | |
| 2917 | |
| 2918 | |
| 2919 | |
| 2920 | |
| 2921 | |
| 2922 | |
| 2923 | |
| 2924 | |
| 2925 | |
| 2926 | |
| 2927 | |
| 2928 | |
| 2929 | |
| 2930 | |
| 2931 | |
| 2932 | |
| 2933 | |
| 2934 | |
| 2935 | |
| 2936 | |
| 2937 | |
| 2938 | |
| 2939 | |
| 2940 | |
| 2941 | |
| 2942 | |
| 2943 | |
| 2944 | |
| 2945 | |
| 2946 | |
| 2947 | |
| 2948 | |
| 2949 | |
| 2950 | |
| 2951 | |
| 2952 | |
| 2953 | |
| 2954 | |
| 2955 | |
| 2956 | |
| 2957 | |
| 2958 | |
| 2959 | |
| 2960 | |
| 2961 | |
| 2962 | |
| 2963 | |
| 2964 | |
| 2965 | |
| 2966 | |
| 2967 | |
| 2968 | |
| 2969 | |
| 2970 | |
| 2971 | |
| 2972 | |
| 2973 | |
| 2974 | |
| 2975 | |
| 2976 | |
| 2977 | |
| 2978 | |
| 2979 | |
| 2980 | |
| 2981 | |
| 2982 | |
| 2983 | |
| 2984 | |
| 2985 | |
| 2986 | |
| 2987 | |
| 2988 | |
| 2989 | |
| 2990 | |
| 2991 | |
| 2992 | |
| 2993 | |
| 2994 | /// Seeds swept by the 10-bit LR gate (the 8-bit gate needs ~40 attempts |
| 2995 | /// to land a non-RESTORE_NONE frame; every attempt here still has to |
| 2996 | /// decode pixel-exact). |
| 2997 | /// lane-obmcrec r1: the `LR_SEEDS` members whose 1:4-partition stream both |
| 2998 | /// fires `obmc_pair_filter_hits` and decodes every frame pixel-exact. |
| 2999 | /// Measured over seeds 42..=73 (32 encodes): 43/46/47/65/66 fire and are |
| 3000 | /// exact; 70 and 73 fire and mismatch, but mismatch IDENTICALLY with |
| 3001 | /// `--enable-obmc=0` (seed 73 frame 1 luma, seed 70 frame 16), so their |
| 3002 | /// defect is in the `--min-partition-size=4` recipe, not in OBMC -- kept |
| 3003 | /// out of this gate rather than papered over, and reported as open. |
| 3004 | pub const OBMC_PAIR_SEEDS: = ; |
| 3005 | |
| 3006 | pub const LR_SEEDS: = |
| 3007 | |
| 3008 | ; |
| 3009 | |
| 3010 | /// Wiener + SGR + switchable loop-restoration firings, summed. |
| 3011 | pub |
| 3012 | |
| 3013 | |
| 3014 | |
| 3015 | |
| 3016 | |
| 3017 | /// `bit_depth` of the first sequence header in `stream`. |
| 3018 | pub |
| 3019 | |
| 3020 | |
| 3021 | |
| 3022 | |
| 3023 | |
| 3024 | |
| 3025 | |
| 3026 | |
| 3027 | |
| 3028 | |
| 3029 | |
| 3030 | |
| 3031 | |
| 3032 | /// Render `frames` of the shared `gradients_source` as `yuv420p10le` and |
| 3033 | /// encode it with a real 10-bit `aomenc`, returning the OBU stream. |
| 3034 | /// `extra` carries the tool flags under test. |
| 3035 | pub |
| 3036 | |
| 3037 | |
| 3038 | |
| 3039 | |
| 3040 | |
| 3041 | |
| 3042 | |
| 3043 | |
| 3044 | |
| 3045 | /// As [`encode_10bit_gradients`], but with the fixture seed exposed -- |
| 3046 | /// lane-hbdgates r1 sweeps seeds so a tool that aomenc's RD declines on |
| 3047 | /// one fixture still gets a firing stream. |
| 3048 | pub |
| 3049 | |
| 3050 | |
| 3051 | |
| 3052 | |
| 3053 | |
| 3054 | |
| 3055 | |
| 3056 | |
| 3057 | |
| 3058 | |
| 3059 | |
| 3060 | |
| 3061 | |
| 3062 | |
| 3063 | |
| 3064 | |
| 3065 | |
| 3066 | |
| 3067 | |
| 3068 | |
| 3069 | |
| 3070 | |
| 3071 | |
| 3072 | |
| 3073 | |
| 3074 | |
| 3075 | |
| 3076 | |
| 3077 | |
| 3078 | |
| 3079 | |
| 3080 | |
| 3081 | |
| 3082 | |
| 3083 | |
| 3084 | |
| 3085 | |
| 3086 | |
| 3087 | |
| 3088 | |
| 3089 | |
| 3090 | |
| 3091 | |
| 3092 | |
| 3093 | |
| 3094 | |
| 3095 | |
| 3096 | |
| 3097 | |
| 3098 | |
| 3099 | |
| 3100 | |
| 3101 | |
| 3102 | |
| 3103 | |
| 3104 | |
| 3105 | |
| 3106 | |
| 3107 | |
| 3108 | |
| 3109 | |
| 3110 | |
| 3111 | |
| 3112 | |
| 3113 | |
| 3114 | |
| 3115 | |
| 3116 | |
| 3117 | |
| 3118 | |
| 3119 | |
| 3120 | |
| 3121 | |
| 3122 | |
| 3123 | |
| 3124 | |
| 3125 | |
| 3126 | |
| 3127 | /// The affine-capable encoder (`scripts/build-aom-affine-oracle.sh`), |
| 3128 | /// separate from the shared oracle because stock libaom's global-motion |
| 3129 | /// model search is pinned to ROTZOOM and can never emit AFFINE. |
| 3130 | pub |
| 3131 | |
| 3132 | |
| 3133 | |
| 3134 | |
| 3135 | |
| 3136 | |
| 3137 | |
| 3138 | pub |
| 3139 | |
| 3140 | |
| 3141 | |
| 3142 | |
| 3143 | |
| 3144 | |
| 3145 | |
| 3146 | |
| 3147 | |
| 3148 | |
| 3149 | pub |
| 3150 | |
| 3151 | |
| 3152 | |
| 3153 | |
| 3154 | |
| 3155 | |
| 3156 | |
| 3157 | |
| 3158 | |
| 3159 | |
| 3160 | |
| 3161 | |
| 3162 | |
| 3163 | |
| 3164 | |
| 3165 | |
| 3166 | |
| 3167 | |
| 3168 | |
| 3169 | |
| 3170 | |
| 3171 | |
| 3172 | |
| 3173 | |
| 3174 | |
| 3175 | |
| 3176 | |
| 3177 | |
| 3178 | |
| 3179 | |
| 3180 | |
| 3181 | |
| 3182 | |
| 3183 | |
| 3184 | |
| 3185 | |
| 3186 | /// Which of the four 128-root AB shapes the gate above MEASURED aomenc |
| 3187 | /// picking (lane-sb128c r9). An arm that is `false` is not reachable from |
| 3188 | /// this sweep's recipes and stays unasserted rather than weakening the |
| 3189 | /// asserts of the ones that are. |
| 3190 | pub const AB_ARMS_REACHED: = ; |
| 3191 | |
| 3192 | /// lane-av1muchunk422b: read a pinned 4:2:2 128-root mu-chunk fixture, |
| 3193 | /// asserting its byte length and FNV-1a64 -- a missing fixture is a |
| 3194 | /// failure, not a skip. |
| 3195 | pub |
| 3196 | |
| 3197 | |
| 3198 | |
| 3199 | |
| 3200 | |
| 3201 | |
| 3202 | |
| 3203 | |
| 3204 | |
| 3205 | |
| 3206 | |
| 3207 | |
| 3208 | |
| 3209 | |
| 3210 | |
| 3211 | /// lane-av1muchunk422b: `(use_128x128_superblock, ss_x, ss_y, mono_chrome)` |
| 3212 | /// of an OBU stream's sequence header. Shape first: a stream that came back |
| 3213 | /// 4:2:0 would leave the `side > 64` mu-chunk walk unexercised while every |
| 3214 | /// counter assert below still passed. |
| 3215 | pub |
| 3216 | |
| 3217 | |
| 3218 | |
| 3219 | |
| 3220 | |
| 3221 | |
| 3222 | |
| 3223 | |
| 3224 | |
| 3225 | |
| 3226 | |
| 3227 | |
| 3228 | |
| 3229 | |
| 3230 | |
| 3231 | |
| 3232 | |
| 3233 | |
| 3234 | /// The chroma-rect gate's fixture + aomenc recipe for one attempt, shared |
| 3235 | /// with the seed-46 pin test below so the pin cannot drift from the gate. |
| 3236 | pub |
| 3237 | |
| 3238 | |
| 3239 | |
| 3240 | |
| 3241 | |
| 3242 | |
| 3243 | |
| 3244 | |
| 3245 | |
| 3246 | |
| 3247 | |
| 3248 | |
| 3249 | |
| 3250 | |
| 3251 | |
| 3252 | |
| 3253 | |
| 3254 | |
| 3255 | |
| 3256 | |
| 3257 | |
| 3258 | |
| 3259 | |
| 3260 | |
| 3261 | |
| 3262 | |
| 3263 | |
| 3264 | |
| 3265 | |
| 3266 | |
| 3267 | |
| 3268 | |
| 3269 | |
| 3270 | |
| 3271 | |
| 3272 | |
| 3273 | |
| 3274 | |
| 3275 | |
| 3276 | |
| 3277 | |
| 3278 | |
| 3279 | |
| 3280 | |
| 3281 | |
| 3282 | |
| 3283 | |
| 3284 | |
| 3285 | |
| 3286 | |
| 3287 | |
| 3288 | |
| 3289 | |
| 3290 | |
| 3291 | |
| 3292 | |
| 3293 | |
| 3294 | |
| 3295 | |
| 3296 | |
| 3297 | |
| 3298 | |
| 3299 | |
| 3300 | |
| 3301 | |
| 3302 | |
| 3303 | |
| 3304 | |
| 3305 | |
| 3306 | |
| 3307 | |
| 3308 | |
| 3309 | |
| 3310 | |
| 3311 | |
| 3312 | |
| 3313 | |
| 3314 | |
| 3315 | |
| 3316 | |
| 3317 | |
| 3318 | |
| 3319 | |
| 3320 | |
| 3321 | |
| 3322 | |
| 3323 | |
| 3324 | |
| 3325 | |
| 3326 | |
| 3327 | |
| 3328 | |
| 3329 | |
| 3330 | |
| 3331 | |
| 3332 | |
| 3333 | |
| 3334 | |
| 3335 | |
| 3336 | |
| 3337 | |
| 3338 | |
| 3339 | |
| 3340 | |
| 3341 | |
| 3342 | |
| 3343 | /// Runs the census child on `fixture` and returns the `GRAINCENSUS` line's |
| 3344 | /// `(unwritten, scanned)` -- the POST-grain pair, over the picture |
| 3345 | /// `apply_grain` returns. |
| 3346 | pub |
| 3347 | |
| 3348 | |
| 3349 | |
| 3350 | |
| 3351 | |
| 3352 | |
| 3353 | |
| 3354 | |
| 3355 | |
| 3356 | |
| 3357 | |
| 3358 | |
| 3359 | |
| 3360 | |
| 3361 | |
| 3362 | |
| 3363 | |
| 3364 | |
| 3365 | |
| 3366 | |
| 3367 | |
| 3368 | |
| 3369 | |
| 3370 | |
| 3371 | |
| 3372 | |
| 3373 | |
| 3374 | |
| 3375 | |
| 3376 | |
| 3377 | /// The synthetic non-vacuity control for the grained census: the child with |
| 3378 | /// `UWDEP_CENSUS_FIXTURE` UNSET hands [`census_unwritten_grained`] planes |
| 3379 | /// carrying 5 sentinel samples and reports what it counted. Function-level, |
| 3380 | /// so no fixture's decode behaviour can change it. |
| 3381 | pub |
| 3382 | |
| 3383 | |
| 3384 | |
| 3385 | |
| 3386 | |
| 3387 | |
| 3388 | |
| 3389 | |
| 3390 | |
| 3391 | |
| 3392 | |
| 3393 | |
| 3394 | |
| 3395 | |
| 3396 | |
| 3397 | |
| 3398 | |
| 3399 | |
| 3400 | |
| 3401 | |
| 3402 | |
| 3403 | |
| 3404 | |
| 3405 | |
| 3406 | |
| 3407 | |
| 3408 | |
| 3409 | |
| 3410 | |
| 3411 | |
| 3412 | |
| 3413 | /// Parses the child's `UWDEP_CENSUS <unwritten> frames=<n> scanned=<n>` line |
| 3414 | /// into `(unwritten, scanned)`. The scanned count is what makes the fixture |
| 3415 | /// arms meaningful: `unwritten == 0` is also what a build with the census call |
| 3416 | /// deleted reports, and only a non-zero scanned count distinguishes "scanned |
| 3417 | /// and found nothing" from "never scanned". |
| 3418 | pub |
| 3419 | |
| 3420 | |
| 3421 | |
| 3422 | |
| 3423 | |
| 3424 | |
| 3425 | |
| 3426 | |
| 3427 | |
| 3428 | /// Runs the census child with `UWDEP_CENSUS_FIXTURE` UNSET, which makes it |
| 3429 | /// take the synthetic-positive path: hand [`census_unwritten_final`] planes |
| 3430 | /// with a known number of `PLANE_SENTINEL` values and report what it counted. |
| 3431 | /// This is the non-vacuity control, and it is a direct function-level check |
| 3432 | /// rather than a decode, so no fixture's decode behaviour can change it. |
| 3433 | pub |
| 3434 | |
| 3435 | |
| 3436 | |
| 3437 | |
| 3438 | |
| 3439 | |
| 3440 | |
| 3441 | |
| 3442 | |
| 3443 | |
| 3444 | |
| 3445 | |
| 3446 | |
| 3447 | |
| 3448 | |
| 3449 | |
| 3450 | |
| 3451 | |
| 3452 | |
| 3453 | |
| 3454 | |
| 3455 | |
| 3456 | |
| 3457 | |
| 3458 | |
| 3459 | |
| 3460 | |
| 3461 | |
| 3462 | |
| 3463 | /// Runs [`allocdet_child_decode`] in a fresh process and parses its |
| 3464 | /// `ALLOCDET <fixture> frames=<n> hash=<hex>` lines into |
| 3465 | /// `(fixture, frames, hash)` in FIXTURES order. |
| 3466 | pub |
| 3467 | |
| 3468 | |
| 3469 | |
| 3470 | |
| 3471 | |
| 3472 | |
| 3473 | |
| 3474 | |
| 3475 | |
| 3476 | |
| 3477 | |
| 3478 | |
| 3479 | |
| 3480 | |
| 3481 | |
| 3482 | |
| 3483 | |
| 3484 | |
| 3485 | |
| 3486 | |
| 3487 | |
| 3488 | |
| 3489 | |
| 3490 | |
| 3491 | |
| 3492 | |
| 3493 | |
| 3494 | |
| 3495 | |
| 3496 | |
| 3497 | |
| 3498 | |
| 3499 | |
| 3500 | |
| 3501 | |
| 3502 | |
| 3503 | |
| 3504 | |
| 3505 | |
| 3506 | |
| 3507 | |
| 3508 | |
| 3509 | |
| 3510 | |
| 3511 | |
| 3512 | |
| 3513 | |
| 3514 | |
| 3515 | |
| 3516 | |
| 3517 | |
| 3518 | |
| 3519 | /// Two pictures identical except for ONE sample of ONE plane, hashed by the |
| 3520 | /// same FNV-1a the child uses. Equal values here would make the gate's |
| 3521 | /// equalities vacuous, so it is asserted to differ. |
| 3522 | pub |
| 3523 | |
| 3524 | |
| 3525 | |
| 3526 | |
| 3527 | |
| 3528 | |
| 3529 | |
| 3530 | |
| 3531 | |
| 3532 | |
| 3533 | |
| 3534 | |
| 3535 | |
| 3536 | |
| 3537 | |
| 3538 | |
| 3539 | |
| 3540 | |
| 3541 | |
| 3542 | /// lane-av1formatsweep: encodes the odd-dimension arm's fixture -- |
| 3543 | /// `testsrc2` (or the smoothed `mandelbrot` source at 12 bits, which |
| 3544 | /// keeps `allow_screen_content_tools` off) as `y4m`, then hands the pipe |
| 3545 | /// to `aomenc`. The child deadline comes from `run_with_stdin` |
| 3546 | /// (`EC_AV1_CHILD_TIMEOUT_SECS`), so a wedged encoder fails loudly. |
| 3547 | pub |
| 3548 | |
| 3549 | |
| 3550 | |
| 3551 | |
| 3552 | |
| 3553 | |
| 3554 | |
| 3555 | |
| 3556 | |
| 3557 | |
| 3558 | |
| 3559 | |
| 3560 | |
| 3561 | |
| 3562 | |
| 3563 | |
| 3564 | |
| 3565 | |
| 3566 | |
| 3567 | |
| 3568 | |
| 3569 | |
| 3570 | |
| 3571 | |
| 3572 | |
| 3573 | |
| 3574 | |
| 3575 | |
| 3576 | |
| 3577 | |
| 3578 | |
| 3579 | |
| 3580 | |
| 3581 | |
| 3582 | |
| 3583 | |
| 3584 | |
| 3585 | |
| 3586 | |
| 3587 | |
| 3588 | |
| 3589 | |
| 3590 | |
| 3591 | |
| 3592 | |
| 3593 | |
| 3594 | |
| 3595 | |
| 3596 | |
| 3597 | |
| 3598 | |
| 3599 | |
| 3600 | |
| 3601 | |
| 3602 | |
| 3603 | |
| 3604 | |
| 3605 | |
| 3606 | |
| 3607 | |
| 3608 | |
| 3609 | |
| 3610 | |
| 3611 | |
| 3612 | |
| 3613 | |
| 3614 | |
| 3615 | |
| 3616 | |
| 3617 | |
| 3618 | |
| 3619 | |
| 3620 | |
| 3621 | /// Reads `(mi_cols, mi_rows)` out of a stream's first frame header, and |
| 3622 | /// asserts the sequence header says the bit depth the caller asked for. |
| 3623 | pub |
| 3624 | |
| 3625 | |
| 3626 | |
| 3627 | |
| 3628 | |
| 3629 | |
| 3630 | |
| 3631 | |
| 3632 | |
| 3633 | |
| 3634 | |
| 3635 | |
| 3636 | |
| 3637 | |
| 3638 | |
| 3639 | |
| 3640 | |
| 3641 | |
| 3642 | |
| 3643 | |
| 3644 | |
| 3645 | |
| 3646 | |
| 3647 | |
| 3648 | |
| 3649 | |
| 3650 | |
| 3651 | |
| 3652 | |
| 3653 | |
| 3654 | |
| 3655 | |
| 3656 | |
| 3657 | |
| 3658 | |
| 3659 | |
| 3660 | |
| 3661 | |
| 3662 | |
| 3663 | |
| 3664 | |
| 3665 | /// lane-av1formatsweep: a `testsrc2`/`mandelbrot` source rendered to |
| 3666 | /// `pix_fmt` as y4m and piped to `aomenc` at `bit_depth`, with `extra` |
| 3667 | /// aomenc flags. `smooth` selects the gblur'd `mandelbrot` source (1) or |
| 3668 | /// `testsrc2` (0). The child deadline comes from `run_with_stdin` |
| 3669 | /// (`EC_AV1_CHILD_TIMEOUT_SECS`), so a wedged encoder fails loudly. |
| 3670 | pub |
| 3671 | |
| 3672 | |
| 3673 | |
| 3674 | |
| 3675 | |
| 3676 | |
| 3677 | |
| 3678 | |
| 3679 | |
| 3680 | |
| 3681 | |
| 3682 | |
| 3683 | |
| 3684 | |
| 3685 | |
| 3686 | |
| 3687 | |
| 3688 | |
| 3689 | |
| 3690 | |
| 3691 | |
| 3692 | |
| 3693 | |
| 3694 | |
| 3695 | |
| 3696 | |
| 3697 | |
| 3698 | |
| 3699 | |
| 3700 | |
| 3701 | |
| 3702 | |
| 3703 | |
| 3704 | |
| 3705 | |
| 3706 | |
| 3707 | |
| 3708 | |
| 3709 | |
| 3710 | |
| 3711 | |
| 3712 | |
| 3713 | |
| 3714 | |
| 3715 | |
| 3716 | |
| 3717 | |
| 3718 | |
| 3719 | |
| 3720 | |
| 3721 | |
| 3722 | |
| 3723 | |
| 3724 | |
| 3725 | |
| 3726 | |
| 3727 | |
| 3728 | |
| 3729 | |
| 3730 | |
| 3731 | |
| 3732 | |
| 3733 | |
| 3734 | |
| 3735 | |
| 3736 | |
| 3737 | |
| 3738 | |
| 3739 | |
| 3740 | |
| 3741 | |
| 3742 | |
| 3743 | |
| 3744 | |
| 3745 | |
| 3746 | |
| 3747 | |
| 3748 | |
| 3749 | /// Asserts the stream's sequence header really is 4:4:4 (`ss 0,0`) at |
| 3750 | /// `bit_depth` before any pixel comparison is trusted (class |
| 3751 | /// `arrival-not-intent`: a recipe that silently produced 4:2:0 would |
| 3752 | /// make the whole gate a no-op for its own subject). |
| 3753 | pub |
| 3754 | |
| 3755 | |
| 3756 | |
| 3757 | |
| 3758 | |
| 3759 | |
| 3760 | |
| 3761 | |
| 3762 | |
| 3763 | |
| 3764 | |
| 3765 | |
| 3766 | |
| 3767 | |
| 3768 | |
| 3769 | |
| 3770 | |
| 3771 | |
| 3772 | |
| 3773 | |
| 3774 | |
| 3775 | |
| 3776 | |
| 3777 | |
| 3778 | |
| 3779 | |
| 3780 | |
| 3781 | |
| 3782 | |
| 3783 | |
| 3784 | |
| 3785 | /// lane-av1tilemeasure: the per-frame facts a tiling / superres / odd-size |
| 3786 | /// cell's OWN claim needs, read off the parsed stream. |
| 3787 | /// |
| 3788 | /// Every gate below asserts its cell through this, never through the |
| 3789 | /// aomenc flag that was supposed to produce it. `lanes/av1formatsweep. |
| 3790 | /// report.md` trap 2 is exactly that failure: `--tile-rows=1` below 256px |
| 3791 | /// high at `--sb-size=128` leaves the stream byte-identical, so a gate |
| 3792 | /// that trusted the flag would report an untiled decode as a tile-row |
| 3793 | /// decode (and the sweep's own 10/12-bit "tile rows" numbers were that). |
| 3794 | |
| 3795 | pub |
| 3796 | |
| 3797 | |
| 3798 | |
| 3799 | |
| 3800 | |
| 3801 | |
| 3802 | |
| 3803 | |
| 3804 | |
| 3805 | |
| 3806 | pub |
| 3807 | |
| 3808 | |
| 3809 | |
| 3810 | |
| 3811 | |
| 3812 | |
| 3813 | |
| 3814 | |
| 3815 | |
| 3816 | |
| 3817 | |
| 3818 | |
| 3819 | |
| 3820 | |
| 3821 | |
| 3822 | |
| 3823 | |
| 3824 | |
| 3825 | |
| 3826 | |
| 3827 | |
| 3828 | |
| 3829 | |
| 3830 | |
| 3831 | |
| 3832 | |
| 3833 | |
| 3834 | |
| 3835 | |
| 3836 | |
| 3837 | |
| 3838 | /// Decode-order frame 0 only, against the oracle's own |
| 3839 | /// `EC_AV1_FINAL_DUMP` for that frame: how many SAMPLES differ, and the |
| 3840 | /// first one as `(plane, x, y, ours, oracle)`. |
| 3841 | /// |
| 3842 | /// lane-av1loss444kf: the 4:4:4 lossless 256x256 cell's inter frames carry a |
| 3843 | /// SEPARATE, already-diagnosed walk defect (the per-mu-chunk lossless |
| 3844 | /// chroma span, `lanes/av1loss444mm.report.md` r1), so a whole-stream |
| 3845 | /// byte-exactness assert cannot name this one. `aomdec --limit=1` stops |
| 3846 | /// after the key frame, which is exactly the frame the reach fix moves. |
| 3847 | |
| 3848 | pub |
| 3849 | |
| 3850 | |
| 3851 | |
| 3852 | |
| 3853 | |
| 3854 | |
| 3855 | |
| 3856 | |
| 3857 | |
| 3858 | |
| 3859 | |
| 3860 | |
| 3861 | |
| 3862 | |
| 3863 | |
| 3864 | |
| 3865 | |
| 3866 | |
| 3867 | |
| 3868 | |
| 3869 | |
| 3870 | |
| 3871 | |
| 3872 | |
| 3873 | |
| 3874 | |
| 3875 | |
| 3876 | |
| 3877 | |
| 3878 | |
| 3879 | |
| 3880 | |
| 3881 | |
| 3882 | |
| 3883 | |
| 3884 | |
| 3885 | |
| 3886 | |
| 3887 | |
| 3888 | |
| 3889 | |
| 3890 | |
| 3891 | |
| 3892 | |
| 3893 | |
| 3894 | |
| 3895 | |
| 3896 | |
| 3897 | |
| 3898 | |
| 3899 | |
| 3900 | |
| 3901 | |
| 3902 | |
| 3903 | /// lane-av1cfl: per-plane sample-mismatch counts between this decoder's |
| 3904 | /// final stored frames and the instrumented oracle's, summed over every |
| 3905 | /// decode-order frame. Returns `[Y, U, V]`. |
| 3906 | /// |
| 3907 | /// [`decode_all_frames_vs_oracle`] panics on the first differing byte, |
| 3908 | /// which names an offset but not WHICH PLANE the offset falls in -- and |
| 3909 | /// for a chroma-scoped defect the plane split is the whole diagnosis |
| 3910 | /// (luma byte-exact while U and V both diverge is the chroma-sizing |
| 3911 | /// signature; all three diverging is not). |
| 3912 | /// |
| 3913 | /// `plane_samples` is each plane's own sample count in DECODE order |
| 3914 | /// (`[Y, U, V]`) and is read off this decoder's own frame rather than |
| 3915 | /// derived from the dimensions: at 4:2:0 the chroma planes are half-size |
| 3916 | /// and at 4:4:4 full-size, and a helper that assumed one layout would |
| 3917 | /// report every chroma byte as a luma byte. 8-bit only: the dump is one |
| 3918 | /// byte per sample at 8-bit and two at 10/12. |
| 3919 | pub |
| 3920 | |
| 3921 | |
| 3922 | |
| 3923 | |
| 3924 | |
| 3925 | |
| 3926 | |
| 3927 | |
| 3928 | |
| 3929 | |
| 3930 | |
| 3931 | |
| 3932 | |
| 3933 | |
| 3934 | |
| 3935 | |
| 3936 | |
| 3937 | |
| 3938 | |
| 3939 | |
| 3940 | |
| 3941 | |
| 3942 | |
| 3943 | |
| 3944 | |
| 3945 | |
| 3946 | |
| 3947 | |
| 3948 | |
| 3949 | |
| 3950 | |
| 3951 | |
| 3952 | |
| 3953 | |
| 3954 | |
| 3955 | |
| 3956 | |
| 3957 | |
| 3958 | |
| 3959 | |
| 3960 | |
| 3961 | |
| 3962 | |
| 3963 | |
| 3964 | |
| 3965 | |
| 3966 | |
| 3967 | |
| 3968 | |
| 3969 | |
| 3970 | |
| 3971 | |
| 3972 | |
| 3973 | |
| 3974 | |
| 3975 | |
| 3976 | |
| 3977 | |
| 3978 | |
| 3979 | |
| 3980 | |
| 3981 | |
| 3982 | |
| 3983 | |
| 3984 | |
| 3985 | |
| 3986 | |
| 3987 | /// Shared body for the lane-av1superpin 4:4:4 superres arms. It is the |
| 3988 | /// body of [`a_444_lossy_superres_stream_decodes_pixel_exact`] with the |
| 3989 | /// single `(denominator, coded_width)` constant generalised to a PER-FRAME |
| 3990 | /// table, which is what the mode-2 cell needs: libaom picks a different |
| 3991 | /// denominator for each frame there, so a single constant would either |
| 3992 | /// describe frame 0 only or be a literal the arithmetic below could not |
| 3993 | /// hold. |
| 3994 | /// |
| 3995 | /// Everything that makes the den=12 cell non-vacuous is here, unchanged: |
| 3996 | /// the pinned bytes (length + FNV-1a), 4:4:4 / 8-bit / superres-enabled |
| 3997 | /// from the sequence header, `use_superres` on every parsed frame header, |
| 3998 | /// the per-frame parsed denominator and coded size, and the coded width |
| 3999 | /// RE-DERIVED as `(UpscaledWidth*8 + denom/2)/denom` from that frame's OWN |
| 4000 | /// parsed denominator rather than compared to a literal alone -- so a |
| 4001 | /// re-pinned fixture cannot satisfy the literals while the scaled-size |
| 4002 | /// arithmetic moves under them. Then `superres_hits` and |
| 4003 | /// `predict_scaled_hits` as DELTAS (both counters are process-wide with no |
| 4004 | /// reset, so absolute values would pass on residue from another stream), |
| 4005 | /// the returned frames at the UPSCALED width with full-resolution 4:4:4 |
| 4006 | /// chroma planes, and every decode-order frame byte-exact against the |
| 4007 | /// instrumented aomdec. |
| 4008 | |
| 4009 | pub |
| 4010 | |
| 4011 | |
| 4012 | |
| 4013 | |
| 4014 | |
| 4015 | |
| 4016 | |
| 4017 | |
| 4018 | |
| 4019 | |
| 4020 | |
| 4021 | |
| 4022 | |
| 4023 | |
| 4024 | |
| 4025 | |
| 4026 | |
| 4027 | |
| 4028 | |
| 4029 | |
| 4030 | |
| 4031 | |
| 4032 | |
| 4033 | |
| 4034 | |
| 4035 | |
| 4036 | |
| 4037 | |
| 4038 | |
| 4039 | |
| 4040 | |
| 4041 | |
| 4042 | |
| 4043 | |
| 4044 | |
| 4045 | |
| 4046 | |
| 4047 | |
| 4048 | |
| 4049 | |
| 4050 | |
| 4051 | |
| 4052 | |
| 4053 | |
| 4054 | |
| 4055 | |
| 4056 | |
| 4057 | |
| 4058 | |
| 4059 | |
| 4060 | |
| 4061 | |
| 4062 | |
| 4063 | |
| 4064 | |
| 4065 | |
| 4066 | |
| 4067 | |
| 4068 | |
| 4069 | |
| 4070 | |
| 4071 | |
| 4072 | |
| 4073 | |
| 4074 | |
| 4075 | |
| 4076 | |
| 4077 | |
| 4078 | |
| 4079 | |
| 4080 | |
| 4081 | |
| 4082 | |
| 4083 | |
| 4084 | |
| 4085 | |
| 4086 | |
| 4087 | |
| 4088 | |
| 4089 | |
| 4090 | |
| 4091 | |
| 4092 | |
| 4093 | |
| 4094 | |
| 4095 | |
| 4096 | |
| 4097 | |
| 4098 | |
| 4099 | |
| 4100 | |
| 4101 | |
| 4102 | |
| 4103 | |
| 4104 | |
| 4105 | |
| 4106 | |
| 4107 | |
| 4108 | |
| 4109 | |
| 4110 | |
| 4111 | |
| 4112 | |
| 4113 | |
| 4114 | |
| 4115 | |
| 4116 | |
| 4117 | |
| 4118 | |
| 4119 | |
| 4120 | |
| 4121 | |
| 4122 | |
| 4123 | |
| 4124 | |
| 4125 | |
| 4126 | |
| 4127 | |
| 4128 | |
| 4129 | |
| 4130 | |
| 4131 | |
| 4132 | |
| 4133 | |
| 4134 | |
| 4135 | |
| 4136 | |
| 4137 | |
| 4138 | |
| 4139 | |
| 4140 | |
| 4141 | |
| 4142 | |
| 4143 | |
| 4144 | |
| 4145 | |
| 4146 | |
| 4147 | |
| 4148 | |
| 4149 | |
| 4150 | |
| 4151 | |
| 4152 | |
| 4153 | |
| 4154 | |
| 4155 | |
| 4156 | |
| 4157 | |
| 4158 | |
| 4159 | |
| 4160 | |
| 4161 | |
| 4162 | |
| 4163 | |
| 4164 | |
| 4165 | |
| 4166 | |
| 4167 | |
| 4168 | |
| 4169 | |
| 4170 | |
| 4171 | |
| 4172 |