edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | use *; |
| 2 | |
| 3 | /// One plane of the picture being coded, and the reconstruction being built |
| 4 | /// beside it. |
| 5 | /// What one committed 4x4 cell left behind for the coefficient contexts of |
| 6 | /// the blocks that read it as a neighbour -- tile.rs `neighbour_state`, which |
| 7 | /// is the same state decode.rs records. |
| 8 | |
| 9 | pub |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | /// One plane's coefficient contexts, committed in CODING ORDER: the search |
| 18 | /// prices partition TREES, so the neighbour state a candidate reads has to be |
| 19 | /// whatever the blocks coded before it left -- the parent's committed |
| 20 | /// neighbours for a tree's first child, the just-committed sibling for the |
| 21 | /// later ones. Keeping the map as a full per-4x4-cell grid rather than the |
| 22 | /// writer's two running bands is what makes that fall out: a trial commits |
| 23 | /// over its own rectangle ([`Plane::commit`]) and a losing trial is undone |
| 24 | /// with the pixels ([`Plane::restore`]), so what a candidate reads above and |
| 25 | /// to its left is exactly what the tile writer's `Neighbours` bands will hold |
| 26 | /// when it gets there. |
| 27 | /// |
| 28 | /// Before this map the pricer took both contexts as zero, which is exact for |
| 29 | /// a luma transform covering its whole block and the largest remaining row of |
| 30 | /// the pricer census everywhere else (all-zero chroma under-priced 41-81%). |
| 31 | |
| 32 | pub |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | /// Whether [`Plane::block_sse`] scores a block the true frame edge cuts |
| 45 | /// through over its INSIDE part alone. On; `EC_AV1_EDGESSE=0` restores the |
| 46 | /// padding-inclusive score the search used before lane-sse, which is how the |
| 47 | /// before/after arms of the straddling gate rows are read off ONE binary. |
| 48 | pub |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | /// Whether [`Plane::block_sse`] counts the blocks the true frame edge cuts |
| 58 | /// through and the share of their raw squared error that sat in the padding |
| 59 | /// (`EC_AV1_EDGE_CENSUS=1`). Off by default: only edge blocks would pay for |
| 60 | /// it, but the numbers are an instrument, not a decision (class |
| 61 | /// `gate-blind-to-feature` -- both gate films are superblock-aligned, so |
| 62 | /// without this census no gate row can say the clip fires at all). |
| 63 | pub |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | /// Per block side (indexed by `side.trailing_zeros()`, so 2 is 4x4 and 7 is |
| 71 | /// 128x128): how many scores clipped, the inside squared error they kept and |
| 72 | /// the padding squared error they dropped. |
| 73 | pub static EDGE_SCORES: = |
| 74 | ; |
| 75 | |
| 76 | /// One clipped score, for [`take_edge_census`]. |
| 77 | pub |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | /// The straddling-block census since the last call, and zero it: one |
| 85 | /// `(side, scores, inside_sse, padding_sse)` row per block size that fired. |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | pub |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 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 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 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 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 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 | |
| 334 | |
| 335 | |
| 336 | |
| 337 | |
| 338 | |
| 339 | |
| 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 | |
| 479 | |
| 480 | |
| 481 | |
| 482 | |
| 483 | |
| 484 | |
| 485 | |
| 486 | |
| 487 | |
| 488 | |
| 489 | |
| 490 | |
| 491 | |
| 492 | |
| 493 | |
| 494 | |
| 495 | |
| 496 | |
| 497 | |
| 498 | |
| 499 | |
| 500 | |
| 501 | |
| 502 | |
| 503 | |
| 504 | |
| 505 | |
| 506 | |
| 507 | |
| 508 | |
| 509 | |
| 510 | |
| 511 | |
| 512 | |
| 513 | |
| 514 | |
| 515 | |
| 516 | |
| 517 | |
| 518 | |
| 519 | |
| 520 | |
| 521 | |
| 522 | |
| 523 | |
| 524 | |
| 525 | |
| 526 | |
| 527 | |
| 528 | |
| 529 | |
| 530 | |
| 531 | |
| 532 | |
| 533 | |
| 534 | |
| 535 | |
| 536 | |
| 537 | |
| 538 | |
| 539 | |
| 540 | |
| 541 | |
| 542 | |
| 543 | |
| 544 | |
| 545 | |
| 546 | |
| 547 | |
| 548 | |
| 549 | |
| 550 | |
| 551 | |
| 552 | |
| 553 | |
| 554 | |
| 555 | |
| 556 | |
| 557 | |
| 558 | |
| 559 | |
| 560 | |
| 561 | |
| 562 | |
| 563 | |
| 564 | |
| 565 | |
| 566 | |
| 567 | |
| 568 | |
| 569 | |
| 570 | |
| 571 | |
| 572 | |
| 573 | |
| 574 | |
| 575 | |
| 576 | |
| 577 | |
| 578 | |
| 579 | |
| 580 | |
| 581 | |
| 582 | |
| 583 | |
| 584 | |
| 585 | |
| 586 | |
| 587 | |
| 588 | |
| 589 | |
| 590 | |
| 591 | |
| 592 | |
| 593 | |
| 594 | |
| 595 | |
| 596 | |
| 597 | |
| 598 | |
| 599 | |
| 600 | |
| 601 | |
| 602 | |
| 603 | |
| 604 | |
| 605 | |
| 606 | |
| 607 | |
| 608 | |
| 609 | |
| 610 | |
| 611 | |
| 612 | |
| 613 | |
| 614 | |
| 615 | |
| 616 | |
| 617 | |
| 618 | |
| 619 | |
| 620 | |
| 621 | |
| 622 | |
| 623 | |
| 624 | |
| 625 | |
| 626 | |
| 627 | |
| 628 | |
| 629 | |
| 630 | |
| 631 | |
| 632 | |
| 633 | |
| 634 | |
| 635 | |
| 636 | |
| 637 | |
| 638 | |
| 639 | |
| 640 | |
| 641 | |
| 642 | |
| 643 | |
| 644 | |
| 645 | |
| 646 | |
| 647 | |
| 648 | |
| 649 | |
| 650 | |
| 651 | |
| 652 | |
| 653 | |
| 654 | |
| 655 | |
| 656 | |
| 657 | |
| 658 | |
| 659 | |
| 660 | |
| 661 | |
| 662 | |
| 663 | |
| 664 | |
| 665 | |
| 666 | |
| 667 | |
| 668 | |
| 669 | |
| 670 | |
| 671 | |
| 672 | |
| 673 | |
| 674 | |
| 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 | |
| 738 | |
| 739 | |
| 740 | |
| 741 | |
| 742 | |
| 743 | |
| 744 | |
| 745 | |
| 746 | |
| 747 | |
| 748 | |
| 749 | |
| 750 | |
| 751 | |
| 752 | |
| 753 | |
| 754 | |
| 755 | |
| 756 | |
| 757 | |
| 758 | |
| 759 | |
| 760 | |
| 761 | |
| 762 | |
| 763 | |
| 764 | |
| 765 | |
| 766 | |
| 767 | |
| 768 | |
| 769 | |
| 770 | |
| 771 | |
| 772 | |
| 773 | |
| 774 | |
| 775 | |
| 776 | |
| 777 | |
| 778 | |
| 779 | |
| 780 | |
| 781 | |
| 782 | |
| 783 | |
| 784 | |
| 785 | |
| 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 | |
| 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 | |
| 881 | |
| 882 | |
| 883 | |
| 884 | |
| 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 | |
| 911 | |
| 912 | |
| 913 | |
| 914 | |
| 915 | |
| 916 | |
| 917 | |
| 918 | |
| 919 | |
| 920 | |
| 921 | |
| 922 | |
| 923 | |
| 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 | |
| 1001 | |
| 1002 | |
| 1003 | |
| 1004 | |
| 1005 | |
| 1006 | |
| 1007 | |
| 1008 | |
| 1009 | |
| 1010 | |
| 1011 | |
| 1012 | |
| 1013 | |
| 1014 | |
| 1015 | |
| 1016 | |
| 1017 | |
| 1018 | |
| 1019 | |
| 1020 | |
| 1021 | |
| 1022 | |
| 1023 | |
| 1024 | |
| 1025 | |
| 1026 | |
| 1027 | |
| 1028 | |
| 1029 | |
| 1030 | |
| 1031 | |
| 1032 | |
| 1033 | |
| 1034 | |
| 1035 | |
| 1036 | |
| 1037 | |
| 1038 | |
| 1039 | |
| 1040 | |
| 1041 | |
| 1042 | |
| 1043 | |
| 1044 | |
| 1045 | |
| 1046 | |
| 1047 | |
| 1048 | |
| 1049 | |
| 1050 | |
| 1051 | |
| 1052 | |
| 1053 | |
| 1054 | |
| 1055 | |
| 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 | |
| 1111 | |
| 1112 | |
| 1113 | |
| 1114 | |
| 1115 | |
| 1116 | |
| 1117 | |
| 1118 | |
| 1119 | |
| 1120 | |
| 1121 | |
| 1122 | |
| 1123 | |
| 1124 | |
| 1125 | |
| 1126 | |
| 1127 | |
| 1128 | |
| 1129 | |
| 1130 | |
| 1131 | |
| 1132 | |
| 1133 | |
| 1134 | |
| 1135 | |
| 1136 | |
| 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 | |
| 1222 | |
| 1223 | |
| 1224 | |
| 1225 | |
| 1226 | |
| 1227 | |
| 1228 | /// Where one block sits in its plane, and how far past its own edges its |
| 1229 | /// prediction may read. |
| 1230 | |
| 1231 | pub |
| 1232 | |
| 1233 | |
| 1234 | |
| 1235 | |
| 1236 | |
| 1237 | |
| 1238 | |
| 1239 | |
| 1240 | |
| 1241 | /// Which of the samples past a block's own edges the decoder has decoded by |
| 1242 | /// the time it predicts the block, and so which a directional mode may read. |
| 1243 | /// |
| 1244 | /// The decoder derives these from its `BlockDecoded` flags, which are cleared |
| 1245 | /// per superblock (`clear_block_decoded_flags`, spec 7.4). Rather than carry |
| 1246 | /// that map, this reads the answer the same way libaom and rav1e do: for a |
| 1247 | /// block whose transform covers it whole, whether the samples above its right |
| 1248 | /// (or below its left) are decoded depends only on where the block sits inside |
| 1249 | /// its 64x64 superblock, which is a pinned table per block size. |
| 1250 | |
| 1251 | pub |
| 1252 | |
| 1253 | |
| 1254 | |
| 1255 | |
| 1256 | /// `has_tr_16x16` / `has_tr_32x32` (`recon_intra.rs` in rav1e, `has_tr_*` in |
| 1257 | /// libaom): for a block that is neither in the superblock's top row nor its |
| 1258 | /// rightmost column, whether the block above and to its right is coded before |
| 1259 | /// it. Indexed by the block's position in the superblock, in blocks of its own |
| 1260 | /// size, as `row * (128 / side) + col` (`Reach::table_stride`) -- libaom's |
| 1261 | /// 128, not this crate's 64 superblock -- bit by bit from the low end. |
| 1262 | pub const HAS_TOP_RIGHT: = |
| 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 | /// `has_bl_16x16` / `has_bl_32x32`: the same, for the block below and to the |
| 1290 | /// left. |
| 1291 | pub const HAS_BOTTOM_LEFT: = |
| 1292 | |
| 1293 | |
| 1294 | |
| 1295 | |
| 1296 | |
| 1297 | |
| 1298 | |
| 1299 | |
| 1300 | |
| 1301 | |
| 1302 | |
| 1303 | |
| 1304 | |
| 1305 | |
| 1306 | |
| 1307 | |
| 1308 | ; |
| 1309 | |
| 1310 | /// `has_tr_vert_*` (libaom `reconintra.c`, `has_tr_vert_tables`), indexed by |
| 1311 | /// [`Reach::table`] exactly like [`HAS_TOP_RIGHT`]: inside a |
| 1312 | /// `PARTITION_VERT_A`/`_B` the square sub-blocks are visited TL, BL, TR, BR |
| 1313 | /// rather than in raster order, so the bottom-left square's top-right |
| 1314 | /// neighbour is the partition's own right-hand rectangle -- not yet decoded. |
| 1315 | /// libaom switches tables on the partition type (`get_has_tr_table`); the |
| 1316 | /// ordinary table says 1 where this one says 0 (32x32 at row 1 col 0: |
| 1317 | /// `95` bit 4 = 1 vs `15` bit 4 = 0), which is exactly the case |
| 1318 | /// lane-part32 r5 caught reading undecoded samples. |
| 1319 | pub const HAS_TOP_RIGHT_VERT: = |
| 1320 | |
| 1321 | |
| 1322 | |
| 1323 | |
| 1324 | |
| 1325 | |
| 1326 | |
| 1327 | |
| 1328 | |
| 1329 | ; |
| 1330 | |
| 1331 | /// [`HAS_TOP_RIGHT_VERT`]'s sibling, `has_bl_vert_tables`. |
| 1332 | pub const HAS_BOTTOM_LEFT_VERT: = |
| 1333 | |
| 1334 | |
| 1335 | |
| 1336 | |
| 1337 | |
| 1338 | |
| 1339 | |
| 1340 | |
| 1341 | |
| 1342 | ; |
| 1343 | |
| 1344 | thread_local! |
| 1345 | |
| 1346 | |
| 1347 | |
| 1348 | |
| 1349 | |
| 1350 | |
| 1351 | |
| 1352 | |
| 1353 | |
| 1354 | /// Restores [`VERT_AB_PARTITION`] to what it was when the guard was made. |
| 1355 | pub ; |
| 1356 | |
| 1357 | |
| 1358 | |
| 1359 | |
| 1360 | |
| 1361 | |
| 1362 | |
| 1363 | /// The `has_tr_*` / `has_bl_*` tables for every rectangular shape this |
| 1364 | /// decoder codes (libaom `reconintra.c`, generated from the oracle's source |
| 1365 | /// so no byte is retyped). Each is indexed by |
| 1366 | /// `(blk_row_in_sb << (5 - log2(bw / 4))) + blk_col_in_sb`, i.e. row stride |
| 1367 | /// `128 / bw` bits ([`Reach::table_stride`]) on libaom's 128-pixel |
| 1368 | /// superblock grid; on this crate's 64-pixel superblock the highest index a |
| 1369 | /// shape can reach stays inside its own table, so no wrap is involved. |
| 1370 | /// |
| 1371 | /// lane-tx4x8 r3: the previous two-row `HAS_TOP_RIGHT_RECT`/ |
| 1372 | /// `HAS_BOTTOM_LEFT_RECT` pair held 32x16/16x32 only and a `_` arm routed |
| 1373 | /// every other shape -- 16x8 strips among them -- to the 32x16 row, wrong at |
| 1374 | /// 10 of the 21 reachable superblock positions for above-right and 7 for |
| 1375 | /// below-left. |
| 1376 | /// `has_tr_4x8` (`reconintra.c`), transcribed verbatim: 64 bytes, row stride 32 bits (`128 / 4`). |
| 1377 | pub const HAS_TR_4X8: = |
| 1378 | |
| 1379 | |
| 1380 | |
| 1381 | |
| 1382 | ; |
| 1383 | /// `has_bl_4x8` (`reconintra.c`), transcribed verbatim: 64 bytes, row stride 32 bits (`128 / 4`). |
| 1384 | pub const HAS_BL_4X8: = |
| 1385 | |
| 1386 | |
| 1387 | |
| 1388 | ; |
| 1389 | /// `has_tr_8x4` (`reconintra.c`), transcribed verbatim: 64 bytes, row stride 16 bits (`128 / 8`). |
| 1390 | pub const HAS_TR_8X4: = |
| 1391 | |
| 1392 | |
| 1393 | |
| 1394 | ; |
| 1395 | /// `has_bl_8x4` (`reconintra.c`), transcribed verbatim: 64 bytes, row stride 16 bits (`128 / 8`). |
| 1396 | pub const HAS_BL_8X4: = |
| 1397 | |
| 1398 | |
| 1399 | |
| 1400 | ; |
| 1401 | /// `has_tr_8x16` (`reconintra.c`), transcribed verbatim: 16 bytes, row stride 16 bits (`128 / 8`). |
| 1402 | pub const HAS_TR_8X16: = |
| 1403 | |
| 1404 | ; |
| 1405 | /// `has_bl_8x16` (`reconintra.c`), transcribed verbatim: 16 bytes, row stride 16 bits (`128 / 8`). |
| 1406 | pub const HAS_BL_8X16: = ; |
| 1407 | /// `has_tr_16x8` (`reconintra.c`), transcribed verbatim: 16 bytes, row stride 8 bits (`128 / 16`). |
| 1408 | pub const HAS_TR_16X8: = ; |
| 1409 | /// `has_bl_16x8` (`reconintra.c`), transcribed verbatim: 16 bytes, row stride 8 bits (`128 / 16`). |
| 1410 | pub const HAS_BL_16X8: = |
| 1411 | |
| 1412 | ; |
| 1413 | /// `has_tr_16x32` (`reconintra.c`), transcribed verbatim: 4 bytes, row stride 8 bits (`128 / 16`). |
| 1414 | pub const HAS_TR_16X32: = ; |
| 1415 | /// `has_bl_16x32` (`reconintra.c`), transcribed verbatim: 4 bytes, row stride 8 bits (`128 / 16`). |
| 1416 | pub const HAS_BL_16X32: = ; |
| 1417 | /// `has_tr_32x16` (`reconintra.c`), transcribed verbatim: 4 bytes, row stride 4 bits (`128 / 32`). |
| 1418 | pub const HAS_TR_32X16: = ; |
| 1419 | /// `has_bl_32x16` (`reconintra.c`), transcribed verbatim: 4 bytes, row stride 4 bits (`128 / 32`). |
| 1420 | pub const HAS_BL_32X16: = ; |
| 1421 | /// `has_tr_32x64` (`reconintra.c`), transcribed verbatim: 1 bytes, row stride 4 bits (`128 / 32`). |
| 1422 | pub const HAS_TR_32X64: = ; |
| 1423 | /// `has_bl_32x64` (`reconintra.c`), transcribed verbatim: 1 bytes, row stride 4 bits (`128 / 32`). |
| 1424 | pub const HAS_BL_32X64: = ; |
| 1425 | /// `has_tr_64x32` (`reconintra.c`), transcribed verbatim: 1 bytes, row stride 2 bits (`128 / 64`). |
| 1426 | pub const HAS_TR_64X32: = ; |
| 1427 | /// `has_bl_64x32` (`reconintra.c`), transcribed verbatim: 1 bytes, row stride 2 bits (`128 / 64`). |
| 1428 | pub const HAS_BL_64X32: = ; |
| 1429 | /// `has_tr_4x16` (`reconintra.c`), transcribed verbatim: 32 bytes, row stride 32 bits (`128 / 4`). |
| 1430 | pub const HAS_TR_4X16: = |
| 1431 | |
| 1432 | |
| 1433 | ; |
| 1434 | /// `has_bl_4x16` (`reconintra.c`), transcribed verbatim: 32 bytes, row stride 32 bits (`128 / 4`). |
| 1435 | pub const HAS_BL_4X16: = |
| 1436 | |
| 1437 | ; |
| 1438 | /// `has_tr_16x4` (`reconintra.c`), transcribed verbatim: 32 bytes, row stride 8 bits (`128 / 16`). |
| 1439 | pub const HAS_TR_16X4: = |
| 1440 | |
| 1441 | |
| 1442 | ; |
| 1443 | /// `has_bl_16x4` (`reconintra.c`), transcribed verbatim: 32 bytes, row stride 8 bits (`128 / 16`). |
| 1444 | pub const HAS_BL_16X4: = |
| 1445 | |
| 1446 | |
| 1447 | ; |
| 1448 | /// `has_tr_8x32` (`reconintra.c`), transcribed verbatim: 8 bytes, row stride 16 bits (`128 / 8`). |
| 1449 | pub const HAS_TR_8X32: = ; |
| 1450 | /// `has_bl_8x32` (`reconintra.c`), transcribed verbatim: 8 bytes, row stride 16 bits (`128 / 8`). |
| 1451 | pub const HAS_BL_8X32: = ; |
| 1452 | /// `has_tr_32x8` (`reconintra.c`), transcribed verbatim: 8 bytes, row stride 4 bits (`128 / 32`). |
| 1453 | pub const HAS_TR_32X8: = ; |
| 1454 | /// `has_bl_32x8` (`reconintra.c`), transcribed verbatim: 8 bytes, row stride 4 bits (`128 / 32`). |
| 1455 | pub const HAS_BL_32X8: = ; |
| 1456 | /// `has_tr_16x64` (`reconintra.c`), transcribed verbatim: 2 bytes, row stride 8 bits (`128 / 16`). |
| 1457 | pub const HAS_TR_16X64: = ; |
| 1458 | /// `has_bl_16x64` (`reconintra.c`), transcribed verbatim: 2 bytes, row stride 8 bits (`128 / 16`). |
| 1459 | pub const HAS_BL_16X64: = ; |
| 1460 | /// `has_tr_64x16` (`reconintra.c`), transcribed verbatim: 2 bytes, row stride 2 bits (`128 / 64`). |
| 1461 | pub const HAS_TR_64X16: = ; |
| 1462 | /// `has_bl_64x16` (`reconintra.c`), transcribed verbatim: 2 bytes, row stride 2 bits (`128 / 64`). |
| 1463 | pub const HAS_BL_64X16: = ; |
| 1464 | |
| 1465 | /// The `has_tr_*`/`has_bl_*` row for one rectangular block shape. |
| 1466 | pub |
| 1467 | |
| 1468 | |
| 1469 | |
| 1470 | |
| 1471 | |
| 1472 | |
| 1473 | |
| 1474 | |
| 1475 | |
| 1476 | |
| 1477 | |
| 1478 | |
| 1479 | |
| 1480 | |
| 1481 | |
| 1482 | |
| 1483 | |
| 1484 | |
| 1485 | |
| 1486 | |
| 1487 | |
| 1488 | |
| 1489 | |
| 1490 | |
| 1491 | |
| 1492 | |
| 1493 | |
| 1494 | |
| 1495 | |
| 1496 | |
| 1497 | |
| 1498 | |
| 1499 | |
| 1500 | |
| 1501 | |
| 1502 | |
| 1503 | |
| 1504 | |
| 1505 | |
| 1506 | |
| 1507 | |
| 1508 | |
| 1509 | |
| 1510 | |
| 1511 | |
| 1512 | |
| 1513 | |
| 1514 | |
| 1515 | |
| 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 | |
| 1584 | |
| 1585 | |
| 1586 | |
| 1587 | |
| 1588 | |
| 1589 | |
| 1590 | |
| 1591 | |
| 1592 | |
| 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 | |
| 1645 | |
| 1646 | |
| 1647 | |
| 1648 | |
| 1649 | |
| 1650 | |
| 1651 | |
| 1652 | |
| 1653 | |
| 1654 | |
| 1655 | |
| 1656 | |
| 1657 | |
| 1658 | |
| 1659 | |
| 1660 | |
| 1661 | |
| 1662 | |
| 1663 | |
| 1664 | |
| 1665 | |
| 1666 | |
| 1667 | |
| 1668 | |
| 1669 | |
| 1670 | |
| 1671 | |
| 1672 | |
| 1673 | |
| 1674 | |
| 1675 | |
| 1676 | |
| 1677 | |
| 1678 | |
| 1679 | |
| 1680 | |
| 1681 | |
| 1682 | |
| 1683 | |
| 1684 | |
| 1685 | |
| 1686 | |
| 1687 | |
| 1688 | |
| 1689 | |
| 1690 | |
| 1691 | |
| 1692 | |
| 1693 | |
| 1694 | |
| 1695 | |
| 1696 | |
| 1697 | |
| 1698 | |
| 1699 | |
| 1700 | |
| 1701 | |
| 1702 | |
| 1703 | |
| 1704 | |
| 1705 | |
| 1706 | |
| 1707 | |
| 1708 | |
| 1709 | |
| 1710 | |
| 1711 | |
| 1712 | |
| 1713 | |
| 1714 | |
| 1715 | |
| 1716 | |
| 1717 | |
| 1718 | |
| 1719 | |
| 1720 | |
| 1721 | |
| 1722 | |
| 1723 | |
| 1724 | |
| 1725 | |
| 1726 | |
| 1727 | |
| 1728 | |
| 1729 | |
| 1730 | |
| 1731 | |
| 1732 | |
| 1733 | |
| 1734 | |
| 1735 | |
| 1736 | |
| 1737 | |
| 1738 | |
| 1739 | |
| 1740 | |
| 1741 | |
| 1742 | |
| 1743 | |
| 1744 | |
| 1745 | |
| 1746 | |
| 1747 | |
| 1748 | |
| 1749 | |
| 1750 | |
| 1751 | |
| 1752 | |
| 1753 | |
| 1754 | |
| 1755 | |
| 1756 | |
| 1757 | |
| 1758 | |
| 1759 | |
| 1760 | |
| 1761 | |
| 1762 | |
| 1763 | |
| 1764 | |
| 1765 | |
| 1766 | |
| 1767 | |
| 1768 | |
| 1769 | |
| 1770 | |
| 1771 | |
| 1772 | |
| 1773 | |
| 1774 | |
| 1775 | |
| 1776 | |
| 1777 | |
| 1778 | |
| 1779 | |
| 1780 | |
| 1781 | |
| 1782 | |
| 1783 | |
| 1784 | |
| 1785 | |
| 1786 | |
| 1787 | |
| 1788 | |
| 1789 | |
| 1790 | |
| 1791 | |
| 1792 | |
| 1793 | |
| 1794 | |
| 1795 | |
| 1796 | |
| 1797 | |
| 1798 | |
| 1799 | |
| 1800 | |
| 1801 | |
| 1802 | |
| 1803 | |
| 1804 | |
| 1805 | |
| 1806 | |
| 1807 | |
| 1808 | |
| 1809 | |
| 1810 | |
| 1811 | |
| 1812 | |
| 1813 | |
| 1814 | |
| 1815 | |
| 1816 | |
| 1817 | |
| 1818 | |
| 1819 | |
| 1820 | |
| 1821 | |
| 1822 | |
| 1823 | |
| 1824 | |
| 1825 | |
| 1826 | |
| 1827 | |
| 1828 | |
| 1829 | |
| 1830 | |
| 1831 | |
| 1832 | |
| 1833 | |
| 1834 | |
| 1835 | |
| 1836 | |
| 1837 | |
| 1838 | |
| 1839 | |
| 1840 | |
| 1841 | |
| 1842 | |
| 1843 | |
| 1844 | |
| 1845 | |
| 1846 | |
| 1847 | |
| 1848 | |
| 1849 | |
| 1850 | |
| 1851 | |
| 1852 | |
| 1853 | |
| 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 | /// What one symbol costs against a CDF, in bits. |
| 1931 | /// Whether local warped motion is on: the `WARPED_CAUSAL` candidate in the |
| 1932 | /// search, the frame header's `allow_warped_motion` and the sequence's |
| 1933 | /// `enable_warped_motion`, all three together. ON by default since |
| 1934 | /// lane-av1rejudge re-measured it at [`LAMBDA_SCALE`] 0.05 (the table at |
| 1935 | /// [`warp_prediction`]); `EC_AV1_WARP=0` turns the tool -- and the two header |
| 1936 | /// bits -- back off for an A/B on one build. |
| 1937 | pub |
| 1938 | |
| 1939 | |
| 1940 | |
| 1941 | |
| 1942 | |
| 1943 | |
| 1944 | |
| 1945 | |
| 1946 | /// The smallest LEAF an OBMC candidate is offered for, so the census can |
| 1947 | /// attribute the tool's effect by footprint (`EC_AV1_OBMC_MIN`, default 8 -- |
| 1948 | /// every leaf; 16 or 32 turn the smaller leaves off). Only read when |
| 1949 | /// `EC_AV1_OBMC` is on, and never by the 32x32 whole-block candidate. |
| 1950 | /// |
| 1951 | /// MEASURED at native, `EC_AV1_OBMC=1` throughout, BD vs libaom / vs rav1e |
| 1952 | /// (12 frames, four quantizers, the standing keep table): |
| 1953 | /// |
| 1954 | /// | min side | film 1080p | film 2160p | screen | |
| 1955 | /// |---|---|---|---| |
| 1956 | /// | OBMC off | +18.0 / +0.7 | +47.3 / +19.2 | +59.4 / -10.0 | |
| 1957 | /// | 32 (32x32 only) | +18.4 / +1.1 | +47.3 / +19.2 | +59.1 / -10.0 | |
| 1958 | /// | 16 | +18.4 / +1.1 | +47.3 / +19.2 | +59.3 / -10.0 | |
| 1959 | /// | 8 (every leaf) | +18.7 / +1.4 | +47.3 / +19.2 | +59.3 / -10.0 | |
| 1960 | /// |
| 1961 | /// So the leaves are not the thing that was holding OBMC back: at 8x8 the |
| 1962 | /// candidate WINS 9704 of the 11462 leaves that code the symbol on the 1080p |
| 1963 | /// film -- 85% of them, far past libaom's own rate -- and costs another 0.3 |
| 1964 | /// BD points on top of the 0.4 the 32x32 candidate already costs. A tool |
| 1965 | /// that wins the local RD on five blocks in six and loses ladder bytes is |
| 1966 | /// the `local-RD-on-references` class again, not a missing footprint. |
| 1967 | /// |
| 1968 | /// RE-MEASURED on lane-av1lambda at [`LAMBDA_SCALE`] 0.05 (min side 8): |
| 1969 | /// +16.7 / -0.5, +47.1 / +19.2, +51.8 / -14.2 against the same build with |
| 1970 | /// the knob off (+17.0 / -0.3, +47.0 / +19.2, +51.6 / -14.2). The 0.7-point |
| 1971 | /// loss on the 1080p film became a 0.3-point win and the other two rows went |
| 1972 | /// 0.1-0.2 the other way, so OBMC is now neutral rather than a loss -- half |
| 1973 | /// of the "local win, ladder loss" it was charged with was the rate weight. |
| 1974 | /// It still does not meet the keep rule (two down, one flat, both columns). |
| 1975 | /// The tool stays OFF by default; the upgrade path is the price, not the size |
| 1976 | /// (the 640x384 arm reads +78.9/+36.4, +94.9/+56.3, +54.2/+0.8 at min side 8 |
| 1977 | /// against +78.8/+36.1, +95.1/+56.4, +54.5/+1.1 off -- two rows down, the |
| 1978 | /// 1080p film up, i.e. the same disagreement between the two gates). |
| 1979 | /// |
| 1980 | /// RE-JUDGED again on lane-av1rejudge against the defaults this lane kept |
| 1981 | /// (local warp on, [`LEAF_SECOND_NEW_MARGIN`] 1.2 -- native +16.2/-1.1, |
| 1982 | /// +46.6/+18.8, +51.3/-14.4): OBMC at min side 8 on top of that base reads |
| 1983 | /// +16.2/-1.0, +46.6/+18.8, +51.3/-14.4, i.e. three rows flat and the 1080p |
| 1984 | /// rav1e column 0.1 WORSE, so the tool buys nothing once the second-reference |
| 1985 | /// margin is loosened. On warp alone it looked like a keep (+16.3/-0.9 at |
| 1986 | /// min 8, +16.6/-0.7 at min 16 against warp's +16.7/-0.5) -- that gain and |
| 1987 | /// the margin's gain are the same bytes. It stays OFF. |
| 1988 | /// |
| 1989 | /// RE-MEASURED on lane-obmc3 (2026-09-08) on the REAL film rows -- every |
| 1990 | /// judgement above was taken when the gate's "film" rows were the `testsrc2` |
| 1991 | /// COLOUR BARS fixtures (class `gate film rows are colour bars`), so this is |
| 1992 | /// the first OBMC measurement on film. BD vs libaom / vs rav1e, 12 pictures, |
| 1993 | /// the standing native keep table (`bd_rate_screen_native`): |
| 1994 | /// |
| 1995 | /// | arm | film A | film B | screen | OBMC fire A/B | |
| 1996 | /// |---|---|---|---|---| |
| 1997 | /// | off (control) | +21.7 / -4.4 | +26.9 / -0.6 | +20.1 / -30.4 | 0% / 0% | |
| 1998 | /// | min side 8 | +21.7 / -4.3 | +27.2 / -0.3 | +20.0 / -30.4 | 15.5% / 9.7% | |
| 1999 | /// | min side 16 | +21.5 / -4.5 | +27.6 / +0.1 | +20.1 / -30.4 | 10.0% / 6.9% | |
| 2000 | /// |
| 2001 | /// and on the LONG-GOP gate (`bd_rate_film_long_gop`, 48 pictures, film B |
| 2002 | /// only), where the anchors' non-skip area is the known gap: |
| 2003 | /// |
| 2004 | /// | arm | film B long GOP | wall ours | |
| 2005 | /// |---|---|---| |
| 2006 | /// | off (control) | +89.8 / +9.1 | 477.5s | |
| 2007 | /// | min side 8 | +89.6 / +9.0 | 514.1s | |
| 2008 | /// |
| 2009 | /// The two gates disagree in SIGN on film B -- 0.3/0.3 worse over 12 |
| 2010 | /// pictures, 0.2/0.1 better over 48 -- and film A moves 0.2/0.1 the good way |
| 2011 | /// only at min side 16, which is exactly where film B loses 0.7 on both |
| 2012 | /// columns. Nothing here meets the keep rule (both films down on both |
| 2013 | /// columns, or one down >=0.5 with the other flat), and the long-GOP gain |
| 2014 | /// costs +7.7% wall. OBMC stays OFF at every preset. |
| 2015 | pub |
| 2016 | |
| 2017 | |
| 2018 | |
| 2019 | |
| 2020 | |
| 2021 | |
| 2022 | |
| 2023 | |
| 2024 | |
| 2025 | /// What the `motion_mode`/`obmc` symbol costs (spec 5.11.24), off the tables |
| 2026 | /// this frame's writer really starts from (`tile::obmc_symbol_bits`) -- the |
| 2027 | /// same frame-CDF price the coefficients of a non-screen frame are estimated |
| 2028 | /// with, not the static default table. |
| 2029 | /// The same price for whichever alphabet the writer will really use for this |
| 2030 | /// block: `warp_alphabet` is `motion_mode_allowed`'s 3-symbol choice |
| 2031 | /// (`allow_warped_motion` and at least one warp sample), otherwise the |
| 2032 | /// 2-symbol `obmc` one. Both sides of every motion-mode comparison in the |
| 2033 | /// search pay it, so the alphabet cancels out of a comparison and only its |
| 2034 | /// per-value spread decides. |
| 2035 | pub |
| 2036 | |
| 2037 | |
| 2038 | |
| 2039 | |
| 2040 | |
| 2041 | |
| 2042 | |
| 2043 | |
| 2044 | |
| 2045 | /// MEASURED 2026-09-06 and NOT KEPT ON BY DEFAULT (`EC_AV1_WARP=1` turns the |
| 2046 | /// candidate, the header's `allow_warped_motion` and the sequence's |
| 2047 | /// `enable_warped_motion` on together). BD vs libaom / vs rav1e, the standing |
| 2048 | /// native keep table, against the same build with the knob off: |
| 2049 | /// |
| 2050 | /// | clip | warp on | off | |
| 2051 | /// |---|---|---| |
| 2052 | /// | film 1080p | +18.7 / +1.6 | +18.0 / +0.7 | |
| 2053 | /// | film 2160p | +47.3 / +19.2 | +47.3 / +19.2 | |
| 2054 | /// | screen | +59.2 / -9.9 | +59.4 / -10.0 | |
| 2055 | /// |
| 2056 | /// One row flat, one 0.2 down against libaom and 0.1 up against rav1e, and |
| 2057 | /// the 1080p film 0.7/0.9 UP -- the keep rule wants two down and one flat, so |
| 2058 | /// it stays off. The 640x384 arm reads +78.7/+36.5, +95.1/+56.4, +54.7/+1.2 |
| 2059 | /// against +78.8/+36.1, +95.1/+56.4, +54.5/+1.1. The census says the tool |
| 2060 | /// fires: 7.0% / 2.7% / 2.4% of the blocks that code a motion_mode symbol |
| 2061 | /// take WARPED_CAUSAL at native (197+91+2441 blocks on the 1080p film), so |
| 2062 | /// this is a measured loss, not an inert knob. Same shape as the OBMC |
| 2063 | /// candidate above it (`obmc_min_side`): a local RD win that does not convert |
| 2064 | /// into ladder bytes. |
| 2065 | /// |
| 2066 | /// RE-MEASURED on lane-av1lambda, after [`LAMBDA_SCALE`] moved 0.1 -> 0.05, |
| 2067 | /// because a tool whose gain is local and whose cost is the rate it adds is |
| 2068 | /// exactly what a halved rate weight re-judges. The verdict FLIPS SIGN: |
| 2069 | /// |
| 2070 | /// | clip | warp on | off (both at lambda 0.05) | |
| 2071 | /// |---|---|---| |
| 2072 | /// | film 1080p | +16.7 / -0.5 | +17.0 / -0.3 | |
| 2073 | /// | film 2160p | +47.0 / +19.1 | +47.0 / +19.2 | |
| 2074 | /// | screen | +51.3 / -14.3 | +51.6 / -14.2 | |
| 2075 | /// |
| 2076 | /// two rows down against libaom (0.3 each) with the third flat, and the rav1e |
| 2077 | /// column inside 0.1 everywhere -- which reads as a keep rather than the |
| 2078 | /// 0.7/0.9 loss it was. |
| 2079 | /// |
| 2080 | /// KEPT ON BY DEFAULT on lane-av1rejudge, which reproduced that table |
| 2081 | /// exactly (base +17.0/-0.3, +47.0/+19.2, +51.6/-14.2; warp +16.7/-0.5, |
| 2082 | /// +47.0/+19.1, +51.3/-14.3 -- two rows down on both columns, one flat) and |
| 2083 | /// ran the conformance shape the lambda lane deferred: every warp stream |
| 2084 | /// decodes three-way exact (our decoder and ffmpeg, `EC_COMP_MISMATCH=1` |
| 2085 | /// clean), the native gate runs clean under `EC_AV1_TILES=2:2` (warp inside |
| 2086 | /// a 16-tile frame, sample walk and all), and tile bytes still do not depend |
| 2087 | /// on the thread count. The tool fires on 5.4% / 3.3% / 3.3% of the blocks |
| 2088 | /// that code a motion_mode symbol. `EC_AV1_WARP=0` ([`warp_on`]) turns it, |
| 2089 | /// `allow_warped_motion` and `enable_warped_motion` back off together. |
| 2090 | /// |
| 2091 | /// The WARPED_CAUSAL prediction of one square single-reference block: the |
| 2092 | /// decoder's own warp-sample walk (`decode::find_samples` + |
| 2093 | /// `warp::select_samples`), least-squares model (`warp::find_projection`) and |
| 2094 | /// affine predictor (`warp::warp_affine`), driven off the encoder's own mi |
| 2095 | /// grid -- never a second implementation of any of the three. `None` when the |
| 2096 | /// block would code no motion_mode symbol at all, when it has no warp sample |
| 2097 | /// (the writer then codes the 2-symbol alphabet, which has no WARPED value), |
| 2098 | /// or when the projection is not filter-representable (the decoder would then |
| 2099 | /// predict translationally, so the mode is pure cost). |
| 2100 | |
| 2101 | pub |
| 2102 | |
| 2103 | |
| 2104 | |
| 2105 | |
| 2106 | |
| 2107 | |
| 2108 | |
| 2109 | |
| 2110 | |
| 2111 | |
| 2112 | |
| 2113 | |
| 2114 | |
| 2115 | |
| 2116 | |
| 2117 | |
| 2118 | |
| 2119 | |
| 2120 | |
| 2121 | |
| 2122 | |
| 2123 | |
| 2124 | |
| 2125 | |
| 2126 | |
| 2127 | |
| 2128 | |
| 2129 | |
| 2130 | |
| 2131 | |
| 2132 | |
| 2133 | |
| 2134 | |
| 2135 | |
| 2136 | |
| 2137 | |
| 2138 | |
| 2139 | |
| 2140 | |
| 2141 | |
| 2142 | |
| 2143 | |
| 2144 | |
| 2145 | |
| 2146 | |
| 2147 | |
| 2148 | |
| 2149 | |
| 2150 | |
| 2151 | |
| 2152 | |
| 2153 | |
| 2154 | |
| 2155 | |
| 2156 | |
| 2157 | |
| 2158 | |
| 2159 | |
| 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 | /// What tile.rs' `write_compound_ref_frames` pays for the pair |
| 2185 | /// `(ref0, ref1)`, symbol for symbol, each at the context its own |
| 2186 | /// `single_ref_p*_ctx`/`uni_comp_ref_p1_ctx`/`comp_reference_type_ctx` |
| 2187 | /// derives from the block's above/left neighbours -- plus the `comp_mode` |
| 2188 | /// symbol itself at `reference_mode_ctx`. |
| 2189 | /// |
| 2190 | /// Before lane-ctx this was four constants at CDF row 0 that assumed the pair |
| 2191 | /// was LAST+GOLDEN or LAST+ALTREF: `comp_bwdref[0][0] = 1` prices a BWDREF or |
| 2192 | /// ALTREF2 partner as ALTREF and drops its `p6` symbol entirely, and the |
| 2193 | /// `uni_comp_ref` leaves price a LAST+LAST2 pair as LAST+GOLDEN. |
| 2194 | pub |
| 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 | |
| 2260 | |
| 2261 | |
| 2262 | |
| 2263 | |
| 2264 | |
| 2265 | |
| 2266 | /// What the `skip` symbol costs at the context tile.rs really codes it with |
| 2267 | /// (`above_skip[mi_c] + left_skip[mi_r]`, the two cells the MV stack now |
| 2268 | /// carries) instead of row 0 -- the pricer's skip-versus-residual margin is |
| 2269 | /// exactly the difference between this symbol's two values, so the row it is |
| 2270 | /// read from moves that decision (class pricer-context-zero, lane-ctx). |
| 2271 | pub |
| 2272 | |
| 2273 | |
| 2274 | |
| 2275 | |
| 2276 | /// What the `is_inter` symbol costs at tile.rs' own `intra_inter_ctx` -- the |
| 2277 | /// neighbours' intra/inter state, with an out-of-tile side contributing |
| 2278 | /// nothing, off the same two cells (lane-ctx). |
| 2279 | pub |
| 2280 | |
| 2281 | |
| 2282 | |
| 2283 | |
| 2284 | |
| 2285 | |
| 2286 | |
| 2287 | |
| 2288 | |
| 2289 | /// The `comp_mode = 0` symbol tile.rs' `write_comp_mode` codes ahead of a |
| 2290 | /// SINGLE-reference block's reference syntax, at `reference_mode_ctx`'s own |
| 2291 | /// context -- zero on a frame that carries no `reference_select` bit, where |
| 2292 | /// the writer codes no symbol at all. |
| 2293 | pub |
| 2294 | |
| 2295 | |
| 2296 | |
| 2297 | |
| 2298 | |
| 2299 | |
| 2300 | |
| 2301 | |
| 2302 | |
| 2303 | /// What tile.rs' `write_single_ref` pays for `ref_frame`, symbol for symbol, |
| 2304 | /// each at the context that symbol's own `single_ref_p*_ctx` derives from the |
| 2305 | /// block's above/left neighbours -- plus the `comp_mode = 0` symbol |
| 2306 | /// `write_comp_mode` codes ahead of it on a `reference_select` frame. |
| 2307 | /// LAST is p1=0,p3=0,p4=0, |
| 2308 | /// LAST2 p1=0,p3=0,p4=1, LAST3 p1=0,p3=1,p5=0, GOLDEN p1=0,p3=1,p5=1, |
| 2309 | /// BWDREF p1=1,p2=0,p6=0, ALTREF2 p1=1,p2=0,p6=1 and ALTREF p1=1,p2=1. |
| 2310 | /// Before lane-pricer every BACKWARD reference was priced as LAST -- three |
| 2311 | /// symbols off the wrong CDFs -- which is what made the search believe an |
| 2312 | /// ALTREF block cost the same syntax as a LAST one. The `comp_mode` term is |
| 2313 | /// lane-ctx2's: a compound candidate paid `comp_mode = 1` while a single one |
| 2314 | /// paid nothing at all, so compound was overcharged by the whole symbol. |
| 2315 | pub |
| 2316 | |
| 2317 | |
| 2318 | |
| 2319 | |
| 2320 | |
| 2321 | |
| 2322 | |
| 2323 | |
| 2324 | |
| 2325 | |
| 2326 | |
| 2327 | |
| 2328 | |
| 2329 | |
| 2330 | |
| 2331 | |
| 2332 | |
| 2333 | |
| 2334 | |
| 2335 | |
| 2336 | |
| 2337 | |
| 2338 | |
| 2339 | |
| 2340 | |
| 2341 | |
| 2342 | |
| 2343 | |
| 2344 | |
| 2345 | |
| 2346 | |
| 2347 | |
| 2348 | |
| 2349 | |
| 2350 | |
| 2351 | |
| 2352 | |
| 2353 | |
| 2354 | |
| 2355 | |
| 2356 | |
| 2357 | |
| 2358 | |
| 2359 | |
| 2360 | |
| 2361 | |
| 2362 | |
| 2363 | |
| 2364 | |
| 2365 | |
| 2366 | |
| 2367 | pub |
| 2368 | |
| 2369 | |
| 2370 | |
| 2371 | |
| 2372 | |
| 2373 | |
| 2374 | |
| 2375 | |
| 2376 | |
| 2377 | |
| 2378 | |
| 2379 | |
| 2380 | |
| 2381 | |
| 2382 | |
| 2383 | |
| 2384 | /// What the tile writer spends to say a block is coded in each of the thirteen |
| 2385 | /// modes, given the modes of the blocks above it and to its left: the luma mode |
| 2386 | /// symbol against the CDF those two neighbours pick, the angle delta a |
| 2387 | /// directional mode carries, and the chroma mode symbol, whose CDF the luma |
| 2388 | /// mode itself indexes. |
| 2389 | /// |
| 2390 | /// Without this the search is blind to what a mode costs to name, which is not |
| 2391 | /// a rounding error: a directional mode on a picture that does not run that way |
| 2392 | /// is a rate loss the squared error never sees. |
| 2393 | /// Codes one square of the picture as a single block: searches the luma mode, |
| 2394 | /// codes both chroma planes DC, and hands back the block and what it cost -- |
| 2395 | /// squared error plus lambda times the bits its symbols spend. |
| 2396 | /// How many halvings of a `side`-square block's transform the `tx_depth` |
| 2397 | /// symbol can name (libaom's per-size depth cap, `cdf::TX_SIZE_CAT0`'s two |
| 2398 | /// symbols against `CAT1`..`CAT3`'s three), floored at the 4x4 transform. |
| 2399 | pub |
| 2400 | |
| 2401 | |
| 2402 | |
| 2403 | |
| 2404 | |
| 2405 | |
| 2406 | |
| 2407 | /// What the `tx_depth` symbol itself costs, off the size category's own CDF. |
| 2408 | /// Priced at context row 0 -- the writer picks the real row from its |
| 2409 | /// neighbours' transform sizes, which the search has no view of; the term is |
| 2410 | /// the same for every depth of one block either way, so it only shifts the |
| 2411 | /// depth-0-versus-split margin, never the ordering between two splits. |
| 2412 | pub |
| 2413 | |
| 2414 | |
| 2415 | |
| 2416 | |
| 2417 | |
| 2418 | |
| 2419 | |
| 2420 | |
| 2421 | /// lane-split: a multiplier on the RATE term of the transform-SPLIT trial |
| 2422 | /// only -- the intra `tx_depth` depth>0 candidates in [`code_square`] and the |
| 2423 | /// inter var-tx depth-1 trial in [`commit_inter_luma`]. `1.0` is the control |
| 2424 | /// (the mode search's own weight); below 1 the split trial is charged less |
| 2425 | /// for its bits and fires more often. |
| 2426 | /// |
| 2427 | /// The knob the class `rd-rate-term-calibration` asks for: lane-txd made the |
| 2428 | /// `tx_depth` SYMBOL price correct and every film row got worse, because the |
| 2429 | /// correct row is a one-sided push away from splitting (depth 0 up to 1.5 |
| 2430 | /// bits cheaper at ctx 2, which is 66% of an inter frame's intra blocks) -- |
| 2431 | /// so what is mis-calibrated is the weight the split's rate is judged under, |
| 2432 | /// not the price. `EC_AV1_SPLIT_LAMBDA`. |
| 2433 | pub |
| 2434 | |
| 2435 | |
| 2436 | |
| 2437 | |
| 2438 | |
| 2439 | |
| 2440 | |
| 2441 | |
| 2442 | |
| 2443 | /// The shipped value of [`split_lambda_mult`]. See lanes/split.report.md for |
| 2444 | /// the sweep that chose it. |
| 2445 | pub const SPLIT_LAMBDA: f64 = 1.0; |