edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB5c8eff8Tahinli2 months ago2949 commits
| 1 | //! Tile payload writer (spec 5.11), for the one block coding the encoder can |
| 2 | //! produce today: a key frame whose every superblock is a single 64x64 |
| 3 | //! DC-predicted block with no residual. |
| 4 | //! |
| 5 | //! That frame decodes to a flat mid-grey picture — every sample is the value a |
| 6 | //! DC prediction with no neighbours produces — which is what makes it a usable |
| 7 | //! gate: any desync between this writer and a real decoder shows up as a |
| 8 | //! decode failure or a sample that is not mid-grey, with no metric in the way. |
| 9 | //! It is the skeleton the block modes, transform sizes and coefficients hang |
| 10 | //! off as they arrive. |
| 11 | |
| 12 | use RefCell; |
| 13 | |
| 14 | use BTreeMap; |
| 15 | use LazyLock; |
| 16 | use ; |
| 17 | |
| 18 | use ; |
| 19 | |
| 20 | use cratecdf; |
| 21 | use crate; |
| 22 | use crate; |
| 23 | use crateSymbolEncoder; |
| 24 | use crateTxType; |
| 25 | use crate; |
| 26 | |
| 27 | // --------------------------------------------------------------------------- |
| 28 | // lane-av1lr: per-64x64 `cdef_idx` (spec 5.11.56, `read_cdef`). The decoder |
| 29 | // reads ONE `cdef_idx` literal per 64x64 superblock, at that superblock's |
| 30 | // first non-skip block, and only when the frame header's `cdef_bits > 0` |
| 31 | // (`crate::decode::maybe_read_cdef_idx`). The writers below mirror that from |
| 32 | // a plan the filter search hands over, kept in a thread-local rather than |
| 33 | // threaded through every `write_*` signature -- the same shape the decoder's |
| 34 | // own `FrameCtx::cdef_transmitted` uses, and the encoder codes one tile at a |
| 35 | // time on one thread. The plan is CONSUMED by the tile writer that runs next |
| 36 | // ([`CdefIdxGuard`] clears it on every exit path, error included), so a frame |
| 37 | // that arms nothing writes no literals. |
| 38 | |
| 39 | // --------------------------------------------------------------------------- |
| 40 | // lane-av1lr: per-restoration-unit loop restoration syntax (spec 5.11.57, |
| 41 | // `read_lr`), armed by the encoder's restoration search the same way |
| 42 | // [`arm_cdef_idx`] arms the CDEF indices. LUMA ONLY and Wiener only: the |
| 43 | // frame header this encoder writes sets `FrameRestorationType[0] = WIENER` |
| 44 | // and leaves both chroma planes at `RESTORE_NONE`, so a unit codes one |
| 45 | // `restore_wiener` symbol and, when it takes the filter, its two directions |
| 46 | // against the running per-tile reference (`crate::restoration:: |
| 47 | // write_wiener_filter`, the exact inverse of the reader's own |
| 48 | // `read_wiener_filter`). |
| 49 | |
| 50 | /// One frame's per-unit restoration plan (see [`arm_lr`]). |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | thread_local! |
| 67 | |
| 68 | |
| 69 | |
| 70 | /// Arms the next tile write with one Wiener decision per luma restoration |
| 71 | /// unit. An empty `units` disarms (the frame codes no restoration at all). |
| 72 | pub |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | // --------------------------------------------------------------------------- |
| 90 | // lane-sb128: the sequence's `use_128x128_superblock`. Armed per tile write |
| 91 | // like [`arm_lr`] (the encoder codes one tile at a time per thread) rather |
| 92 | // than threaded through every writer signature. When set, the two tile |
| 93 | // writers walk 128x128 superblocks -- loop restoration and one |
| 94 | // `partition_w128` symbol at the 128 root, then the four 64x64 quadrants in |
| 95 | // libaom `decode_partition`'s own TL, TR, BL, BR order -- which is exactly |
| 96 | // what `crate::decode::read_sb128_root` reads. |
| 97 | |
| 98 | thread_local! |
| 99 | |
| 100 | |
| 101 | |
| 102 | /// Arms the next tile write with the sequence's 128x128 superblock size. |
| 103 | pub |
| 104 | |
| 105 | |
| 106 | |
| 107 | /// How many 128x128 superblock roots the writers have coded since the last |
| 108 | /// [`take_sb128_root_hits`] -- a gate reports how often the root fires rather |
| 109 | /// than assuming it does (class `gate-blind-to-feature`). Process-global |
| 110 | /// rather than thread-local because the tiles of one frame are written on |
| 111 | /// worker threads. |
| 112 | static SB128_ROOT_HITS: AtomicUsize = new; |
| 113 | |
| 114 | /// The 128x128-root count since the last call, and zero it. |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | /// Whether the next tile write codes 128x128 superblocks ([`arm_sb128`]). |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | /// The order a tile's 64x64 superblock cells are written in, mirroring |
| 125 | /// `crate::decode::sb_visit_order` exactly: plain raster at a 64 superblock, |
| 126 | /// and TL/TR/BL/BR inside each 128x128 superblock (in raster order over the |
| 127 | /// 128 grid) at a 128 one. The two flags mark the first cell of a superblock |
| 128 | /// ROW (where the left neighbour context resets) and the first cell of a |
| 129 | /// superblock (where the 128 root's own restoration units and partition |
| 130 | /// symbol are written). |
| 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 | /// The 128x128 superblock root ([`sb_write_order`]'s `sb_start` cells): the |
| 166 | /// units its own 128-sample span covers, then the partition symbol. Only |
| 167 | /// `PARTITION_SPLIT` is written -- the four 64x64 quadrants below are today's |
| 168 | /// superblocks -- and at a root the true frame edge cuts, the DECIDING |
| 169 | /// gathered bit the decoder reads instead (`read_sb128_root`). |
| 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 | /// lane-b128: one 128x128 inter block at a `PARTITION_NONE` 128 superblock |
| 213 | /// root -- the syntax `decode_inter_block` reads for `sb128_none` (decode.rs |
| 214 | /// ~35110): `skip`, `is_inter`, the reference/mode chain at the block's own |
| 215 | /// 32x32-mi window, the motion mode, and the transform syntax, with the mi |
| 216 | /// grid and every neighbour band published over all thirty-two mi cells. |
| 217 | /// |
| 218 | /// lane-b128r: a block that carries a RESIDUAL codes it as the four 64x64 mu |
| 219 | /// chunks libaom's `decode_token_recon_block` walks -- per chunk one |
| 220 | /// TX_64X64 luma unit (its coded 32x32 corner, `TxbSet::Luma64`, DCT-only at |
| 221 | /// this size) then one TX_32X32 unit per chroma plane on the offset-10 |
| 222 | /// `txb_skip` rows, each publishing its own coefficient context before the |
| 223 | /// next unit reads it. Its transform syntax is the var-tx tree's four |
| 224 | /// depth-0 `txfm_partition` symbols, one per chunk. The levels arrive packed |
| 225 | /// per plane into a 64-wide grid, chunk (cr, cc) at (cr * 32, cc * 32) |
| 226 | /// ([`crate::encode::search_root_128`]). A skipped block writes no |
| 227 | /// `cdef_idx` and no `delta_q`, exactly as the 64 root's skip arm does. |
| 228 | /// |
| 229 | /// # Errors |
| 230 | /// A block that is intra, that is compound with a residual, or whose var-tx |
| 231 | /// depth is not 0, at this size. |
| 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 | /// lane-b128hv: one 128x64 (HORZ) or 64x128 (VERT) inter block, the two |
| 468 | /// halves a `PARTITION_HORZ`/`PARTITION_VERT` 128 superblock root carries -- |
| 469 | /// the syntax `decode_inter_block` reads for `sb128_rect` (decode.rs ~35343): |
| 470 | /// the same chain [`write_inter_block_128`] writes, at the block's own |
| 471 | /// rectangular window. Every CDF/context decision is taken at the enclosing |
| 472 | /// square `side` of 128 (what the decoder's `inter_piece!` passes), and the |
| 473 | /// block's true footprint governs only its mv-stack window, its mi/grid stamp |
| 474 | /// and its neighbour bands (decode.rs' own `write_w`/`write_h` split). |
| 475 | /// |
| 476 | /// lane-ab128: also the two 64x64 squares an AB shape codes (the `w == h` |
| 477 | /// arm below) and its 128x64 / 64x128 half. |
| 478 | /// |
| 479 | /// lane-rectres: a piece may CARRY A RESIDUAL -- the search only ever hands |
| 480 | /// one over under `EC_AV1_RECTRES` ([`crate::encode::rectres`]), and then it |
| 481 | /// is coded here exactly as `decode_inter_block` reads it: one TX_64X64 luma |
| 482 | /// unit plus a TX_32X32 chroma pair per 64x64 mu chunk (two chunks for a |
| 483 | /// half, one for a square), each depth-0 in the var-tx tree (a half codes |
| 484 | /// two `txfm_partition` flags under `TxMode::Select`, a square one). |
| 485 | /// |
| 486 | /// # Errors |
| 487 | /// A block that is intra. |
| 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 | /// lane-b128hv: how many 128x64 / 64x128 halves the inter writer has coded |
| 754 | /// since the last [`take_sb128_horz_hits`] / [`take_sb128_vert_hits`] (class |
| 755 | /// `gate-blind-to-feature`). |
| 756 | static SB128_HORZ_HITS: AtomicUsize = new; |
| 757 | /// The VERT twin of [`SB128_HORZ_HITS`]. |
| 758 | static SB128_VERT_HITS: AtomicUsize = new; |
| 759 | |
| 760 | /// The 128x64-half count since the last call, and zero it. |
| 761 | |
| 762 | |
| 763 | |
| 764 | |
| 765 | /// The 64x128-half count since the last call, and zero it. |
| 766 | |
| 767 | |
| 768 | |
| 769 | |
| 770 | /// lane-ab128: how many AB-shape roots the inter writer has coded since the |
| 771 | /// last [`take_sb128_ab_hits`], in `PARTITION_HORZ_A` .. `_VERT_B` order |
| 772 | /// (class `gate-blind-to-feature`). |
| 773 | static SB128_AB_HITS: = |
| 774 | ; |
| 775 | |
| 776 | /// The four per-shape AB-root counts since the last call, and zero them. |
| 777 | |
| 778 | |
| 779 | |
| 780 | |
| 781 | /// lane-b128r: how many of those blocks carried a REAL residual (four |
| 782 | /// TX_64X64 luma units plus their per-chunk chroma pair) rather than being |
| 783 | /// skipped, since the last [`take_sb128_residual_hits`]. |
| 784 | static SB128_RESIDUAL_HITS: AtomicUsize = |
| 785 | new; |
| 786 | |
| 787 | /// The 128x128-with-residual count since the last call, and zero it. |
| 788 | |
| 789 | |
| 790 | |
| 791 | /// lane-rectres: how many RECT/AB pieces (the halves and 64x64 squares |
| 792 | /// [`write_inter_block_128_rect`] codes) carried a REAL residual rather than |
| 793 | /// being skipped, since the last [`take_sb128_rectres_hits`] -- the writer |
| 794 | /// side of [`crate::encode::take_b128_rectres_hits`]'s search count. |
| 795 | static SB128_RECTRES_HITS: AtomicUsize = |
| 796 | new; |
| 797 | |
| 798 | /// The rect/AB-piece-with-residual count since the last call, and zero it. |
| 799 | |
| 800 | |
| 801 | |
| 802 | |
| 803 | /// lane-b128r: how many of those blocks named a SECOND reference (the |
| 804 | /// compound arm at the 128 root), since the last |
| 805 | /// [`take_sb128_compound_hits`]. |
| 806 | static SB128_COMPOUND_HITS: AtomicUsize = |
| 807 | new; |
| 808 | |
| 809 | /// The compound-128 count since the last call, and zero it. |
| 810 | |
| 811 | |
| 812 | |
| 813 | |
| 814 | /// How many 128x128 `PARTITION_NONE` blocks the inter writer has coded since |
| 815 | /// the last [`take_sb128_none_hits`] (class `gate-blind-to-feature`). |
| 816 | static SB128_NONE_HITS: AtomicUsize = new; |
| 817 | |
| 818 | /// The 128x128-block count since the last call, and zero it. |
| 819 | |
| 820 | |
| 821 | |
| 822 | |
| 823 | /// `read_lr`'s write side, called once at the top of every superblock, |
| 824 | /// before its partition symbol: writes the units this superblock's own |
| 825 | /// mi span covers (`av1_loop_restoration_corners_in_sb`; no superres, so the |
| 826 | /// column scaling is the plain mi one). |
| 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 | /// A 64x64 superblock's width in 4x4 mode-info units (`SB_MI` in |
| 854 | /// `crate::decode`), the span [`write_lr`] resolves its units over. |
| 855 | const SB_MI_W: u32 = 16; |
| 856 | |
| 857 | /// One tile's own superblock and mode-info span (spec 5.11.1's tile loop |
| 858 | /// bounds): `MiColStarts[i]..MiColStarts[i+1]` and the same down the rows, |
| 859 | /// with the superblock indices those mi bounds fall on. The writers walk |
| 860 | /// exactly this rect, and everything a block reads outside it -- the |
| 861 | /// neighbour bands, the MV grid -- is left at the "unavailable" state a |
| 862 | /// tile's own first row and column see, which is how the decoder clips them |
| 863 | /// (`MiGrid::set_tile_bounds`, `PlaneBuf::set_tile_origin`). |
| 864 | |
| 865 | pub |
| 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 | /// A frame's uniform tile grid (spec 5.9.15's `uniform_tile_spacing_flag` |
| 894 | /// arm, mirrored from `ec_av1_syntax::frame::read_tile_info` so that what |
| 895 | /// this encoder writes and what a decoder derives from the same two log2 |
| 896 | /// fields are the same rects). 64x64 superblocks only, which is the only |
| 897 | /// size this encoder's sequence header signals. |
| 898 | |
| 899 | pub |
| 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 | /// lane-edge128: which 64x64 CDEF unit's `cdef_idx` literal covers each unit |
| 998 | /// of this frame, in the same raster order [`arm_cdef_idx`]'s grid is in. |
| 999 | /// |
| 1000 | /// `read_cdef` (spec 5.11.56) codes ONE literal for the block that first |
| 1001 | /// reaches a unit and copies it over every unit that block SPANS, so a whole |
| 1002 | /// 128x128 root block puts one literal in the stream for all four of its |
| 1003 | /// units -- the encoder's CDEF search, which prices a preset per unit, may |
| 1004 | /// not hand those four units different presets: only the first would be |
| 1005 | /// coded, and every decoder (ours and ffmpeg's alike) would apply it to all |
| 1006 | /// four while the encoder's own filter replay applied four different ones. |
| 1007 | /// That is the shape this map exists to collapse |
| 1008 | /// ([`crate::filter_search::pick_filters`]). |
| 1009 | /// |
| 1010 | /// lane-rectres: the same holds for a Rect128 half or an Ab128 half that |
| 1011 | /// carries a residual (`EC_AV1_RECTRES`) -- it codes one literal at its own |
| 1012 | /// origin and the decoder stamps BOTH units it spans with it, so its pair is |
| 1013 | /// collapsed onto the origin unit too. Its 64x64 squares cover exactly one |
| 1014 | /// unit each, and a SKIP-ONLY rect/AB piece codes no literal at all (the |
| 1015 | /// decoder's per-piece `cdef_transmitted` reset never fires), so neither |
| 1016 | /// touches this map -- only pieces the writer really codes a residual for. |
| 1017 | pub |
| 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 | /// One frame's per-superblock `cdef_idx` plan (see [`arm_cdef_idx`]). |
| 1091 | |
| 1092 | |
| 1093 | |
| 1094 | |
| 1095 | |
| 1096 | |
| 1097 | |
| 1098 | |
| 1099 | |
| 1100 | |
| 1101 | |
| 1102 | |
| 1103 | |
| 1104 | thread_local! |
| 1105 | |
| 1106 | |
| 1107 | |
| 1108 | |
| 1109 | /// Arms the next tile write with one `cdef_idx` per 64x64 superblock. |
| 1110 | /// `bits == 0` disarms (the header codes a single strength pair, so the tile |
| 1111 | /// carries no literal at all). |
| 1112 | pub |
| 1113 | |
| 1114 | |
| 1115 | |
| 1116 | |
| 1117 | |
| 1118 | /// One frame's per-superblock quantizer plan (lane-deltaq, see |
| 1119 | /// [`arm_delta_q`]): the writer side of decode.rs `maybe_read_delta_q`. |
| 1120 | |
| 1121 | |
| 1122 | |
| 1123 | |
| 1124 | |
| 1125 | |
| 1126 | |
| 1127 | |
| 1128 | |
| 1129 | |
| 1130 | |
| 1131 | |
| 1132 | |
| 1133 | |
| 1134 | |
| 1135 | |
| 1136 | thread_local! |
| 1137 | |
| 1138 | |
| 1139 | |
| 1140 | |
| 1141 | /// Arms the next tile write with one absolute `qindex` per 64x64 superblock. |
| 1142 | /// Disarmed (a plain no-op writer, byte for byte what this crate wrote before |
| 1143 | /// lane-deltaq) when `res == 0`. |
| 1144 | pub |
| 1145 | |
| 1146 | |
| 1147 | |
| 1148 | |
| 1149 | |
| 1150 | |
| 1151 | thread_local! |
| 1152 | |
| 1153 | |
| 1154 | |
| 1155 | |
| 1156 | /// Arms the next tile write with this frame's `ref_frame_sign_bias` (spec |
| 1157 | /// 5.9.2), the table its MV-stack scans run under. Armed the same way |
| 1158 | /// [`arm_cdef_idx`]/[`arm_lr`] are -- and disarmed by the same guard -- so |
| 1159 | /// that a frame with a backward reference needs no new parameter on the four |
| 1160 | /// nested writer helpers between here and `find_mv_stack`. A frame that never |
| 1161 | /// names a future reference leaves this alone: all-`false` is what every |
| 1162 | /// stream this crate wrote before pyramids existed codes under. |
| 1163 | pub |
| 1164 | |
| 1165 | |
| 1166 | |
| 1167 | thread_local! |
| 1168 | |
| 1169 | |
| 1170 | |
| 1171 | /// Arms the next tile write with this frame's `allow_screen_content_tools` |
| 1172 | /// (spec 5.9.2), which is what makes every intra block carry the |
| 1173 | /// `palette_y_mode`/`palette_uv_mode` symbols spec 5.11.46 |
| 1174 | /// `read_palette_mode_info` reads. Armed the same way [`arm_cdef_idx`]/ |
| 1175 | /// [`arm_sign_bias`] are -- and disarmed by the same guard -- so a frame that |
| 1176 | /// never detected screen content writes exactly the stream it wrote before |
| 1177 | /// this lane. |
| 1178 | pub |
| 1179 | |
| 1180 | |
| 1181 | |
| 1182 | thread_local! |
| 1183 | |
| 1184 | |
| 1185 | |
| 1186 | |
| 1187 | |
| 1188 | |
| 1189 | |
| 1190 | |
| 1191 | |
| 1192 | |
| 1193 | |
| 1194 | /// Arms the next tile write with this frame's `(mi_rows, mi_cols)`. |
| 1195 | pub |
| 1196 | |
| 1197 | |
| 1198 | |
| 1199 | /// The armed `(mi_rows, mi_cols)`, or a grid big enough to clamp nothing. |
| 1200 | |
| 1201 | |
| 1202 | |
| 1203 | |
| 1204 | |
| 1205 | |
| 1206 | |
| 1207 | |
| 1208 | |
| 1209 | |
| 1210 | |
| 1211 | thread_local! |
| 1212 | |
| 1213 | |
| 1214 | |
| 1215 | |
| 1216 | |
| 1217 | |
| 1218 | |
| 1219 | |
| 1220 | |
| 1221 | |
| 1222 | |
| 1223 | |
| 1224 | |
| 1225 | |
| 1226 | |
| 1227 | /// Arms the frame's `allow_intrabc` bit for the next tile written on this |
| 1228 | /// thread; cleared by [`CdefIdxGuard`] when that writer returns. |
| 1229 | pub |
| 1230 | |
| 1231 | |
| 1232 | |
| 1233 | |
| 1234 | |
| 1235 | |
| 1236 | |
| 1237 | thread_local! |
| 1238 | |
| 1239 | |
| 1240 | |
| 1241 | |
| 1242 | |
| 1243 | |
| 1244 | |
| 1245 | |
| 1246 | |
| 1247 | /// Arms the sequence's `enable_filter_intra` bit for the next tile written on |
| 1248 | /// this thread; cleared by [`CdefIdxGuard`] when that writer returns. |
| 1249 | pub |
| 1250 | |
| 1251 | |
| 1252 | |
| 1253 | |
| 1254 | |
| 1255 | |
| 1256 | |
| 1257 | /// How many blocks this writer coded `use_filter_intra == 1`, and the |
| 1258 | /// histogram of the five `filter_intra_mode`s (index 1..=5) -- the fire count |
| 1259 | /// a gate prints so that "filter intra is on" is a measurement rather than a |
| 1260 | /// claim (class `gate-blind-to-feature`). Index 0 is the block count. |
| 1261 | static FILTER_INTRA_HITS: = |
| 1262 | ; |
| 1263 | |
| 1264 | /// Reads [`FILTER_INTRA_HITS`] and zeroes it, so a gate can attribute the |
| 1265 | /// counts to its own encode. |
| 1266 | |
| 1267 | pub |
| 1268 | |
| 1269 | |
| 1270 | |
| 1271 | /// `filter_intra_mode_info` (spec 5.11.14) written out, mirrored symbol for |
| 1272 | /// symbol from decode.rs `read_intra_mode`: a `use_filter_intra` flag on every |
| 1273 | /// DC_PRED block whose sides `av1_filter_intra_allowed_bsize` admits (both <= |
| 1274 | /// 32, [`crate::decode::filter_intra_size_class`]) and that took no luma |
| 1275 | /// palette (`av1_filter_intra_allowed`, reconintra.h:77), then the chosen mode |
| 1276 | /// of five. Sits between the palette COLOUR lists and the colour-index maps, |
| 1277 | /// where libaom reads it (`av1_visit_palette` runs after |
| 1278 | /// `read_filter_intra_mode_info`). |
| 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 | /// The coefficient-table row a block's luma transform types are coded from: |
| 1304 | /// `fimode_to_intradir[filter_intra_mode]` for a filter-intra block, its own |
| 1305 | /// luma mode otherwise (class `filter-intra tx_type row`, decode.rs |
| 1306 | /// [`crate::decode::fi_tx_row`]). The block still PUBLISHES `DC_PRED` as its |
| 1307 | /// neighbour mode -- libaom's `mbmi->mode` is unchanged by filter intra. |
| 1308 | |
| 1309 | |
| 1310 | |
| 1311 | |
| 1312 | /// How many blocks this writer coded `use_intrabc == 1`, and the histogram of |
| 1313 | /// their DV magnitudes in full pels (index 1..=6 = 1, 2, 4, 8, 16, 32 pels |
| 1314 | /// and up, by the larger component) -- the fire count a gate prints so that |
| 1315 | /// "intrabc is on" is a measurement rather than a claim (class |
| 1316 | /// `gate-blind-to-feature`). Index 0 is the block count. |
| 1317 | static INTRABC_HITS: = |
| 1318 | ; |
| 1319 | |
| 1320 | |
| 1321 | |
| 1322 | |
| 1323 | |
| 1324 | |
| 1325 | |
| 1326 | |
| 1327 | /// Reads [`INTRABC_HITS`] and zeroes it, so a gate can attribute the counts |
| 1328 | /// to its own encode. |
| 1329 | // read only from the `#[cfg(test)]` gates |
| 1330 | pub |
| 1331 | |
| 1332 | |
| 1333 | |
| 1334 | thread_local! |
| 1335 | |
| 1336 | |
| 1337 | |
| 1338 | |
| 1339 | |
| 1340 | |
| 1341 | |
| 1342 | |
| 1343 | |
| 1344 | /// Arms the frame's `reference_select` bit for the next tile written on this |
| 1345 | /// thread; cleared by [`CdefIdxGuard`] when that writer returns. |
| 1346 | pub |
| 1347 | |
| 1348 | |
| 1349 | |
| 1350 | thread_local! |
| 1351 | |
| 1352 | |
| 1353 | |
| 1354 | |
| 1355 | |
| 1356 | |
| 1357 | |
| 1358 | |
| 1359 | thread_local! |
| 1360 | |
| 1361 | |
| 1362 | |
| 1363 | |
| 1364 | |
| 1365 | |
| 1366 | |
| 1367 | |
| 1368 | |
| 1369 | |
| 1370 | |
| 1371 | |
| 1372 | |
| 1373 | |
| 1374 | |
| 1375 | |
| 1376 | /// Arms [`WARPED_MOTION`] for the next tile written on this thread. |
| 1377 | pub |
| 1378 | |
| 1379 | |
| 1380 | |
| 1381 | /// Arms the frame's `is_motion_mode_switchable` bit for the next tile written |
| 1382 | /// on this thread; cleared by [`CdefIdxGuard`] when that writer returns. |
| 1383 | pub |
| 1384 | |
| 1385 | |
| 1386 | |
| 1387 | /// How many single-reference inter blocks this writer coded a `motion_mode` |
| 1388 | /// symbol for, split by the value it coded and by the block's own footprint |
| 1389 | /// -- the histogram a gate prints so that "OBMC is on" is a measurement, not |
| 1390 | /// a claim (class `gate-blind-to-feature`). Index: `0 + 2 * bucket` for |
| 1391 | /// SIMPLE, `1 + 2 * bucket` for OBMC, bucket 0/1/2 = 32x32/16x16/8x8. |
| 1392 | static MOTION_MODE_HITS: = |
| 1393 | ; |
| 1394 | |
| 1395 | /// Reads [`MOTION_MODE_HITS`] and zeroes it, so a gate can attribute the |
| 1396 | /// counts to its own encode. |
| 1397 | // read only from the `#[cfg(test)]` gates |
| 1398 | pub |
| 1399 | |
| 1400 | |
| 1401 | |
| 1402 | /// What the 3-symbol `motion_mode` symbol costs, in bits, against the same |
| 1403 | /// frame tables [`obmc_symbol_bits`] prices the 2-symbol alphabet off -- |
| 1404 | /// which alphabet a block reads is `motion_mode_allowed`'s own choice |
| 1405 | /// ([`write_motion_mode`]). |
| 1406 | pub |
| 1407 | |
| 1408 | |
| 1409 | |
| 1410 | |
| 1411 | |
| 1412 | |
| 1413 | /// What the `motion_mode`/`obmc` symbol costs, in bits, against the tables |
| 1414 | /// this frame's writer really starts from ([`arm_pricing_cdfs`]) -- the same |
| 1415 | /// tables the coefficients are priced off since lane-av1price2, rather than |
| 1416 | /// the static defaults the symbol used to be estimated with. Falls back to |
| 1417 | /// the default table whenever the search is armed with the defaults (a key |
| 1418 | /// frame, or a screen frame the gate turned off). |
| 1419 | pub |
| 1420 | |
| 1421 | |
| 1422 | |
| 1423 | |
| 1424 | |
| 1425 | |
| 1426 | /// `read_motion_mode`'s write side (spec 5.11.24), called on a |
| 1427 | /// single-reference inter block right after its MV syntax and before the |
| 1428 | /// (never switchable here) interpolation filter -- libaom's own sequential |
| 1429 | /// order in `read_inter_block_mode_info`. |
| 1430 | /// |
| 1431 | /// Eligibility is decode.rs' own `motion_mode_eligible`, term for term, with |
| 1432 | /// the terms this writer settles statically dropped: no block it codes is |
| 1433 | /// `skip_mode`, interintra or a non-IDENTITY-global `GLOBALMV` one, so what |
| 1434 | /// is left is the footprint floor and the overlappable-neighbour walk |
| 1435 | /// ([`crate::decode::has_overlappable_neighbour`], shared with the decoder so |
| 1436 | /// the two cannot drift). The frame header keeps `allow_warped_motion == 0`, |
| 1437 | /// so the alphabet is always the 2-symbol `obmc_cdf`, never the 3-symbol |
| 1438 | /// `motion_mode_cdf`. |
| 1439 | |
| 1440 | |
| 1441 | |
| 1442 | |
| 1443 | |
| 1444 | |
| 1445 | |
| 1446 | |
| 1447 | |
| 1448 | |
| 1449 | |
| 1450 | |
| 1451 | |
| 1452 | |
| 1453 | |
| 1454 | |
| 1455 | |
| 1456 | |
| 1457 | |
| 1458 | |
| 1459 | |
| 1460 | |
| 1461 | |
| 1462 | |
| 1463 | |
| 1464 | |
| 1465 | |
| 1466 | |
| 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 | /// The compound half of a block's end-of-block neighbour record: nothing for |
| 1525 | /// a single-reference or intra block, and `record_compound_mi`'s overwrite of |
| 1526 | /// the ALTREF default for a compound one (this writer only codes |
| 1527 | /// `comp_group_idx == 0`, `compound_idx == 1`). |
| 1528 | |
| 1529 | |
| 1530 | |
| 1531 | |
| 1532 | |
| 1533 | |
| 1534 | /// decode.rs' own `is_uni_comp_ref`: a pair is `UNIDIR_COMP_REFERENCE` |
| 1535 | /// exactly when both references sit on the same temporal side. |
| 1536 | use crateis_uni_comp_ref; |
| 1537 | |
| 1538 | thread_local! |
| 1539 | |
| 1540 | |
| 1541 | |
| 1542 | |
| 1543 | |
| 1544 | |
| 1545 | |
| 1546 | /// Arms this frame's order hints for the next tile written on this thread. |
| 1547 | pub |
| 1548 | |
| 1549 | |
| 1550 | |
| 1551 | /// What [`arm_order_hints`] last armed: `(order_hint_bits, order_hint, |
| 1552 | /// ref_order_hints)`, for the encoder's own per-reference distance. |
| 1553 | pub |
| 1554 | |
| 1555 | |
| 1556 | |
| 1557 | thread_local! |
| 1558 | |
| 1559 | |
| 1560 | |
| 1561 | |
| 1562 | |
| 1563 | |
| 1564 | /// Arms this frame's `allow_high_precision_mv` for the next tile written -- |
| 1565 | /// or searched -- on this thread. |
| 1566 | pub |
| 1567 | |
| 1568 | |
| 1569 | |
| 1570 | /// What [`arm_high_precision_mv`] last armed on this thread. |
| 1571 | pub |
| 1572 | |
| 1573 | |
| 1574 | |
| 1575 | /// lane-hpmv's witness counters: `[0]` counts every `mv_hp`/`mv_class0_hp` |
| 1576 | /// symbol this process's writers coded (zero without |
| 1577 | /// `allow_high_precision_mv`, one per non-zero mv component with it), `[1]` |
| 1578 | /// counts the ones that came out ZERO -- an eighth-pel vector, i.e. one a |
| 1579 | /// frame without the flag cannot name at all. |
| 1580 | static HP_SYMBOLS: = |
| 1581 | ; |
| 1582 | |
| 1583 | /// Reads and clears [`HP_SYMBOLS`]: `(hp symbols coded, eighth-pel ones)`. |
| 1584 | // read only from the `#[cfg(test)]` witness |
| 1585 | pub |
| 1586 | |
| 1587 | |
| 1588 | |
| 1589 | |
| 1590 | /// [`take_hp_symbols`] without clearing -- what the NEWMV census prints. |
| 1591 | pub |
| 1592 | |
| 1593 | |
| 1594 | |
| 1595 | |
| 1596 | /// Writer-side counterpart of decode.rs `read_compound_ref_frames` (spec |
| 1597 | /// 5.11.25's `comp_reference_type`/`uni_comp_ref`/`comp_ref`/`comp_bwdref` |
| 1598 | /// trees), symbol for symbol at the same contexts -- which are, as that |
| 1599 | /// function's own doc records, `single_ref_p1_ctx`..`single_ref_p6_ctx`/ |
| 1600 | /// `uni_comp_ref_p1_ctx` under libaom's compound names. |
| 1601 | /// |
| 1602 | /// # Errors |
| 1603 | /// A pair this writer never forms (its `ref0` is not `LAST_FRAME`). |
| 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 | /// Per-mode and per-pair fire counts of [`write_compound_block`], for the |
| 1687 | /// gate's own census (gate-blind-to-feature): modes indexed by the spec's |
| 1688 | /// `INTER_COMPOUND_MODES`, pairs by `ref1` (`LAST`..`ALTREF`). |
| 1689 | static COMPOUND_MODE_HITS: = |
| 1690 | ; |
| 1691 | static COMPOUND_PAIR_HITS: = |
| 1692 | ; |
| 1693 | |
| 1694 | /// Takes and clears the compound mode histogram. |
| 1695 | |
| 1696 | pub |
| 1697 | |
| 1698 | |
| 1699 | |
| 1700 | /// Takes and clears the compound pair histogram, indexed by the SECOND |
| 1701 | /// reference (`LAST` = 0 .. `ALTREF` = 6). |
| 1702 | |
| 1703 | pub |
| 1704 | |
| 1705 | |
| 1706 | |
| 1707 | /// Per-SIZE fire counts of [`write_compound_block`], indexed by |
| 1708 | /// `log2(bw4)` (1 = 8x8, 2 = 16x16, 3 = 32x32 and up): compound started as a |
| 1709 | /// 32x32-only tool, so the share by size is what says whether the leaf |
| 1710 | /// candidates fire at all (gate-blind-to-feature). |
| 1711 | static COMPOUND_SIZE_HITS: = |
| 1712 | ; |
| 1713 | |
| 1714 | /// Takes and clears the compound size histogram. |
| 1715 | |
| 1716 | pub |
| 1717 | |
| 1718 | |
| 1719 | |
| 1720 | /// The compound mode histogram of the LEAVES alone (`bw4 <= 4`, so 16x16 and |
| 1721 | /// below). The frame-wide histogram above cannot say whether a mode reaches |
| 1722 | /// the leaves at all, which is exactly the question every leaf compound step |
| 1723 | /// asks (gate-blind-to-feature): before lane-av1comp4 gave a leaf its second |
| 1724 | /// reference search, the two half-new modes were structurally impossible |
| 1725 | /// there and screen capture's leaf compound was 100% `NEAREST_NEARESTMV`. |
| 1726 | static COMPOUND_LEAF_MODE_HITS: = |
| 1727 | ; |
| 1728 | |
| 1729 | /// Takes and clears the leaf-only compound mode histogram. |
| 1730 | |
| 1731 | pub |
| 1732 | |
| 1733 | |
| 1734 | |
| 1735 | |
| 1736 | |
| 1737 | /// Writes one COMPOUND_REFERENCE block's whole mode chain -- the writer side |
| 1738 | /// of decode.rs' `read_compound_ref_frames` / `read_inter_compound_mode` / |
| 1739 | /// `assign_compound_mv` / `comp_group_idx` / `compound_idx` sequence, in that |
| 1740 | /// order. Returns the two motion vectors the decoder derives (what the MI |
| 1741 | /// grid must record) and whether the mode was a `NEW*` one. |
| 1742 | /// |
| 1743 | /// Only the modes [`InterMode::compound_index`] names are written, and |
| 1744 | /// only the `comp_group_idx == 0`, `compound_idx == 1` blend (spec |
| 1745 | /// `COMPOUND_AVERAGE`) -- masked compound and the distance-weighted blend are |
| 1746 | /// not searched. |
| 1747 | /// |
| 1748 | /// # Errors |
| 1749 | /// As [`write_mv`], or a pair/mode this writer does not form. |
| 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 | /// Writer-side counterpart of decode.rs `read_comp_mode` (spec 5.11.25's |
| 1903 | /// `comp_mode`): on a `reference_select` frame every inter block whose size |
| 1904 | /// allows compound (`is_comp_ref_allowed`, always true here -- this writer's |
| 1905 | /// smallest leaf is 8x8) names SINGLE or COMPOUND, at |
| 1906 | /// `mvstack::reference_mode_ctx`'s own context off the same two neighbour |
| 1907 | /// bands decode.rs builds its `NeighbourRef` pair from. |
| 1908 | |
| 1909 | |
| 1910 | |
| 1911 | |
| 1912 | |
| 1913 | |
| 1914 | |
| 1915 | |
| 1916 | |
| 1917 | |
| 1918 | |
| 1919 | |
| 1920 | |
| 1921 | |
| 1922 | |
| 1923 | |
| 1924 | |
| 1925 | |
| 1926 | |
| 1927 | |
| 1928 | |
| 1929 | |
| 1930 | |
| 1931 | |
| 1932 | |
| 1933 | /// Clears the armed plan when the tile writer that consumed it returns. |
| 1934 | ; |
| 1935 | |
| 1936 | |
| 1937 | |
| 1938 | |
| 1939 | |
| 1940 | |
| 1941 | |
| 1942 | |
| 1943 | |
| 1944 | |
| 1945 | |
| 1946 | |
| 1947 | |
| 1948 | |
| 1949 | |
| 1950 | |
| 1951 | |
| 1952 | /// `read_cdef`'s write side, called right after every block's `skip` symbol: |
| 1953 | /// writes this superblock's `cdef_idx` literal the first time a non-skip |
| 1954 | /// block of it is coded. `mi` is the block's own position in 4x4 mode-info |
| 1955 | /// units. |
| 1956 | |
| 1957 | |
| 1958 | |
| 1959 | |
| 1960 | |
| 1961 | |
| 1962 | |
| 1963 | |
| 1964 | |
| 1965 | |
| 1966 | |
| 1967 | |
| 1968 | |
| 1969 | |
| 1970 | |
| 1971 | |
| 1972 | |
| 1973 | |
| 1974 | |
| 1975 | /// `read_delta_qindex`'s write side (spec 5.11.10), called right after every |
| 1976 | /// block's [`write_cdef_idx`] -- the spec's own `skip -> cdef -> delta_q` |
| 1977 | /// order, and decode.rs `maybe_read_delta_q` is the reader this mirrors |
| 1978 | /// symbol for symbol. A no-op unless this block sits at its superblock's own |
| 1979 | /// top-left mode-info position, and (the one case the reader skips too) when |
| 1980 | /// that block IS the whole superblock and is skipped, in which case |
| 1981 | /// `CurrentQIndex` carries over unchanged on both sides. |
| 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 | /// round-4 av1-truesize debugging aid: prints `msg()` to stderr when the |
| 2030 | /// `EC_RNG` environment variable is set, mirroring the `EC_PART`/`EC_TOK` |
| 2031 | /// trace `/tmp/libaom-src`'s debug `aomdec` build already emits under the |
| 2032 | /// same variable, so the two traces line up symbol for symbol. Checked once |
| 2033 | /// per process, so unset (the default) costs one atomic load per call and no |
| 2034 | /// allocation. Only the real tile writer below calls this -- the mode/rate |
| 2035 | /// search's own trial encoders never do -- so the trace does not need the |
| 2036 | /// throwaway-encoder gating a whole-encoder trace would. |
| 2037 | |
| 2038 | |
| 2039 | |
| 2040 | |
| 2041 | |
| 2042 | |
| 2043 | |
| 2044 | |
| 2045 | |
| 2046 | |
| 2047 | |
| 2048 | |
| 2049 | |
| 2050 | |
| 2051 | |
| 2052 | |
| 2053 | /// `PARTITION_NONE` (spec 6.10.4): the whole block, undivided. |
| 2054 | const PARTITION_NONE: usize = 0; |
| 2055 | /// `PARTITION_HORZ` (spec 6.10.4): the block cut into a top and a bottom half. |
| 2056 | const PARTITION_HORZ: usize = 1; |
| 2057 | /// `PARTITION_VERT` (spec 6.10.4): the block cut into a left and a right half. |
| 2058 | const PARTITION_VERT: usize = 2; |
| 2059 | /// `PARTITION_SPLIT` (spec 6.10.4): the block cut into four quadrants. |
| 2060 | const PARTITION_SPLIT: usize = 3; |
| 2061 | |
| 2062 | /// The partition types whose probability mass the split-or-horizontal flag of |
| 2063 | /// a superblock hanging off the bottom of the frame gathers (spec 9.3, |
| 2064 | /// `partition_gather_vert_alike`): the flag says split, so everything vertical |
| 2065 | /// or split lands on it. |
| 2066 | const VERT_ALIKE: = ; |
| 2067 | |
| 2068 | /// The same for a superblock hanging off the right-hand edge |
| 2069 | /// (`partition_gather_horz_alike`). |
| 2070 | const HORZ_ALIKE: = ; |
| 2071 | |
| 2072 | /// Mode-info units across a 32x32 block. |
| 2073 | pub const BLOCK_MI: u32 = SB_MI / 2; |
| 2074 | |
| 2075 | /// Mode-info units across a 16x16 block, the smallest this crate's key-frame |
| 2076 | /// writer codes. |
| 2077 | pub const SUB_MI: u32 = BLOCK_MI / 2; |
| 2078 | |
| 2079 | /// spec `decode_partition`'s `hasRows`/`hasCols` (5.11.4), recomputed at |
| 2080 | /// whichever block size is asking: a block of `side_mi` mode-info units at mi |
| 2081 | /// position `pos` may be coded unsplit (its own `PARTITION_NONE`) only when |
| 2082 | /// this is true in both directions -- the frame's *true* size can put the |
| 2083 | /// boundary inside a superblock, a 32x32 quadrant or (since this writer's |
| 2084 | /// smallest block is 16x16) even a leaf, and each level must ask again with |
| 2085 | /// its own half, not just once at the superblock. |
| 2086 | pub |
| 2087 | |
| 2088 | |
| 2089 | |
| 2090 | /// The number of 32x32 block columns/rows a frame whose *true* (unpadded) |
| 2091 | /// size gives `mi_cols`/`mi_rows` is coded over: every block whose mi origin |
| 2092 | /// (`col * BLOCK_MI`) is inside the true bound is coded, so this is a |
| 2093 | /// ceiling, not the exact division a block-aligned frame would give. Shared |
| 2094 | /// by the tile writer's own iteration and by [`crate::encode`]'s block/ |
| 2095 | /// superblock generation, which must agree with it exactly. |
| 2096 | pub |
| 2097 | |
| 2098 | |
| 2099 | /// `DC_PRED` (spec 6.10.2), as both the luma and the chroma mode. |
| 2100 | const DC_PRED: usize = 0; |
| 2101 | |
| 2102 | /// `V_PRED` (spec 6.10.2), the first of the eight directional intra modes and |
| 2103 | /// so the first mode that carries an angle delta. |
| 2104 | const V_PRED: usize = 1; |
| 2105 | |
| 2106 | /// `H_PRED`, which predicts every row from the column to the block's left. |
| 2107 | |
| 2108 | const H_PRED: usize = 2; |
| 2109 | |
| 2110 | /// The last directional mode, `D67_PRED`. |
| 2111 | const D67_PRED: usize = 8; |
| 2112 | |
| 2113 | /// The number of intra modes a key frame's luma block chooses from, |
| 2114 | /// `INTRA_MODES` (spec 3). |
| 2115 | const INTRA_MODES: usize = 13; |
| 2116 | |
| 2117 | /// `Intra_Mode_Context` (spec 9.3): the five-way class each intra mode puts |
| 2118 | /// its neighbours in when they pick the CDF for the next block's mode. |
| 2119 | pub const INTRA_MODE_CTX: = ; |
| 2120 | |
| 2121 | /// The symbol an angle delta of zero codes as: the alphabet runs from -3 to |
| 2122 | /// +3, so `MAX_ANGLE_DELTA` is the middle of it. |
| 2123 | pub const ANGLE_DELTA_ZERO: usize = 3; |
| 2124 | /// Side of a superblock in 4x4 mode-info units when 128x128 superblocks are off. |
| 2125 | pub const SB_MI: u32 = 16; |
| 2126 | |
| 2127 | /// `NUM_BASE_LEVELS` (spec 3): levels above this carry a base-range tail. |
| 2128 | const NUM_BASE_LEVELS: i32 = 2; |
| 2129 | /// Where DCT_DCT sits in the spec's `Tx_Type_Intra_Inv_Set2`, the set a 16x16 |
| 2130 | /// intra luma transform picks its type from. |
| 2131 | const TX_TYPE_DCT_DCT_SET2: usize = 1; |
| 2132 | /// `COEFF_BASE_RANGE` (spec 3): how far the base-range tail reaches before the |
| 2133 | /// Golomb tail takes over. |
| 2134 | const COEFF_BASE_RANGE: i32 = 12; |
| 2135 | /// `BR_CDF_SIZE - 1` (spec 3): the largest increment one base-range symbol |
| 2136 | /// carries. |
| 2137 | const BR_STEP: i32 = 3; |
| 2138 | /// The largest level the base and base-range syntax carry between them. |
| 2139 | /// Anything above it is written as a Golomb tail on top of this. |
| 2140 | const MAX_BR_LEVEL: i32 = NUM_BASE_LEVELS + COEFF_BASE_RANGE; |
| 2141 | /// The largest level this writer codes. The Golomb tail is a length in unary |
| 2142 | /// followed by that many bits, and the spec's decoder reads at most twenty of |
| 2143 | /// each, so a level a decoder cannot read back is refused rather than written. |
| 2144 | const MAX_LEVEL: i32 = MAX_BR_LEVEL + ; |
| 2145 | |
| 2146 | /// The coefficient q-context (spec 8.3.2's `Get_Qctx`, `Default_..._Cdf`'s |
| 2147 | /// leading index) a frame's `base_q_idx` picks its default CDFs from. |
| 2148 | /// [`crate::cdf`] carries all four, one constant set per context. |
| 2149 | pub |
| 2150 | |
| 2151 | |
| 2152 | |
| 2153 | |
| 2154 | |
| 2155 | |
| 2156 | |
| 2157 | |
| 2158 | /// Both writers here code whole superblocks only: a partial one forces the |
| 2159 | /// partition syntax down the block tree, which they do not code yet. |
| 2160 | /// The probability the CDF gives one symbol on its own. |
| 2161 | |
| 2162 | |
| 2163 | |
| 2164 | |
| 2165 | /// The two-symbol CDF a partial superblock's partition flag is coded with: the |
| 2166 | /// mass of the listed partition types becomes the probability of a split, and |
| 2167 | /// the rest is the one partition the frame edge still allows. |
| 2168 | |
| 2169 | |
| 2170 | |
| 2171 | |
| 2172 | |
| 2173 | |
| 2174 | |
| 2175 | |
| 2176 | |
| 2177 | |
| 2178 | |
| 2179 | |
| 2180 | |
| 2181 | |
| 2182 | |
| 2183 | |
| 2184 | |
| 2185 | |
| 2186 | |
| 2187 | |
| 2188 | /// Writes the payload of a one-tile key frame in which every superblock is a |
| 2189 | /// skipped 64x64 DC-predicted block. |
| 2190 | /// |
| 2191 | /// `mi_cols` and `mi_rows` are the frame's dimensions in 4x4 mode-info units, |
| 2192 | /// as the frame header carries them. |
| 2193 | /// |
| 2194 | /// # Errors |
| 2195 | /// Returns an error when the frame is not a whole number of 64x64 superblocks: |
| 2196 | /// a partial superblock forces the partition syntax down the block tree, which |
| 2197 | /// this writer does not code yet. |
| 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 | /// Writes the payload of a one-tile key frame in which every superblock is a |
| 2232 | /// 64x64 DC-predicted block carrying one luma DC coefficient of `dc_level` and |
| 2233 | /// no chroma residual. |
| 2234 | /// |
| 2235 | /// `dc_level` is a quantised level, not a sample value: the decoder multiplies |
| 2236 | /// it by the frame's DC quantiser and inverse-transforms it over the whole |
| 2237 | /// block, so the picture it makes is a flat grey some distance either side of |
| 2238 | /// the mid-grey a zero level gives. `base_q_idx` is the frame header's, and |
| 2239 | /// picks the coefficient CDFs. |
| 2240 | /// |
| 2241 | /// # Errors |
| 2242 | /// As [`dc_key_frame_tile_levels`], which this is the one-level case of. |
| 2243 | |
| 2244 | |
| 2245 | |
| 2246 | |
| 2247 | |
| 2248 | |
| 2249 | |
| 2250 | |
| 2251 | |
| 2252 | |
| 2253 | |
| 2254 | /// Writes the payload of a one-tile key frame carrying one luma DC coefficient |
| 2255 | /// per superblock, `levels` giving them in the raster order the superblocks are |
| 2256 | /// coded in. |
| 2257 | /// |
| 2258 | /// Each superblock decodes to a flat block of its own grey, so a frame written |
| 2259 | /// here is a grid of greys the caller chooses — which is what makes the sign |
| 2260 | /// context observable: a block's sign context is read off its coded neighbours, |
| 2261 | /// and a frame whose levels differ in sign exercises the three-way split that a |
| 2262 | /// single-sign frame cannot reach. |
| 2263 | /// |
| 2264 | /// # Errors |
| 2265 | /// Returns an error when the frame is not a whole number of 64x64 superblocks, |
| 2266 | /// when `levels` does not carry exactly one level per superblock, when a level |
| 2267 | /// is outside the range the base and base-range syntax carry (`-14..=14` |
| 2268 | /// without zero). |
| 2269 | |
| 2270 | |
| 2271 | |
| 2272 | |
| 2273 | |
| 2274 | |
| 2275 | |
| 2276 | |
| 2277 | |
| 2278 | |
| 2279 | |
| 2280 | |
| 2281 | |
| 2282 | |
| 2283 | |
| 2284 | |
| 2285 | |
| 2286 | |
| 2287 | |
| 2288 | |
| 2289 | |
| 2290 | |
| 2291 | |
| 2292 | |
| 2293 | |
| 2294 | |
| 2295 | |
| 2296 | |
| 2297 | |
| 2298 | |
| 2299 | |
| 2300 | |
| 2301 | |
| 2302 | |
| 2303 | |
| 2304 | |
| 2305 | |
| 2306 | |
| 2307 | |
| 2308 | |
| 2309 | |
| 2310 | |
| 2311 | |
| 2312 | |
| 2313 | |
| 2314 | |
| 2315 | |
| 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 | /// Writes the payload of a one-tile key frame in which every superblock is |
| 2345 | /// split into four 32x32 DC-predicted blocks, each carrying one luma DC |
| 2346 | /// coefficient and no chroma residual. |
| 2347 | /// |
| 2348 | /// `levels` gives one level per 32x32 block in raster order across the frame, |
| 2349 | /// so the grid is twice as wide and twice as tall as the superblock grid. The |
| 2350 | /// blocks are coded in the z-order a superblock's split walks, but every |
| 2351 | /// block's neighbours above and to its left are coded before it either way, so |
| 2352 | /// the picture reads in raster order. |
| 2353 | /// |
| 2354 | /// # Errors |
| 2355 | /// As [`dc_key_frame_tile_levels`], with `levels` sized for the 32x32 grid. |
| 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 | |
| 2391 | |
| 2392 | |
| 2393 | |
| 2394 | |
| 2395 | |
| 2396 | |
| 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 | |
| 2438 | |
| 2439 | /// One quantised coefficient of a transform block. |
| 2440 | /// |
| 2441 | /// `row` and `col` are its position in the transform it belongs to — 32x32 for |
| 2442 | /// luma, 16x16 for each chroma plane — not in the picture: a coefficient at |
| 2443 | /// row 0 varies along the picture's width and one at column 0 along its |
| 2444 | /// height, and the coefficient at the origin is the DC the block's average |
| 2445 | /// sample value rides on. |
| 2446 | |
| 2447 | |
| 2448 | |
| 2449 | |
| 2450 | |
| 2451 | |
| 2452 | |
| 2453 | |
| 2454 | |
| 2455 | |
| 2456 | |
| 2457 | /// The coefficients of one coded block: a 32x32 luma transform and, at 4:2:0, |
| 2458 | /// the 16x16 transform each chroma plane covers the same area with. |
| 2459 | |
| 2460 | |
| 2461 | |
| 2462 | |
| 2463 | |
| 2464 | |
| 2465 | |
| 2466 | |
| 2467 | |
| 2468 | |
| 2469 | |
| 2470 | |
| 2471 | |
| 2472 | |
| 2473 | |
| 2474 | |
| 2475 | |
| 2476 | |
| 2477 | |
| 2478 | |
| 2479 | |
| 2480 | |
| 2481 | |
| 2482 | |
| 2483 | |
| 2484 | |
| 2485 | |
| 2486 | |
| 2487 | |
| 2488 | |
| 2489 | |
| 2490 | |
| 2491 | |
| 2492 | |
| 2493 | |
| 2494 | |
| 2495 | |
| 2496 | |
| 2497 | |
| 2498 | |
| 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 | /// A block's luma palette: its base colours (ascending, only the first |
| 2554 | /// `size` entries are real) and the per-pixel colour-index map, `side*side` |
| 2555 | /// row-major -- exactly what [`crate::decode`]'s own `PaletteY` carries back |
| 2556 | /// out of the stream. |
| 2557 | |
| 2558 | |
| 2559 | |
| 2560 | |
| 2561 | |
| 2562 | |
| 2563 | |
| 2564 | |
| 2565 | |
| 2566 | |
| 2567 | /// As [`PaletteY`], for a block's chroma palette -- one colour-index map |
| 2568 | /// SHARED by U and V (spec `av1_visit_palette`'s plane-1 pass; the two planes |
| 2569 | /// are co-located after 4:2:0 subsampling) plus each plane's own base |
| 2570 | /// colours, exactly what [`crate::decode`]'s own `PaletteUv` carries out of |
| 2571 | /// the stream. |
| 2572 | |
| 2573 | |
| 2574 | |
| 2575 | |
| 2576 | |
| 2577 | |
| 2578 | |
| 2579 | |
| 2580 | |
| 2581 | |
| 2582 | |
| 2583 | |
| 2584 | |
| 2585 | |
| 2586 | |
| 2587 | |
| 2588 | /// One inter mode [`sb_coeff_inter_frame_tile`]'s blocks may take: the whole |
| 2589 | /// single-reference set of spec 5.11.24 `read_inter_mode`, each written by |
| 2590 | /// [`write_inter_mode`] with the decoder's own contexts. |
| 2591 | |
| 2592 | |
| 2593 | |
| 2594 | |
| 2595 | |
| 2596 | |
| 2597 | |
| 2598 | |
| 2599 | |
| 2600 | |
| 2601 | |
| 2602 | |
| 2603 | |
| 2604 | |
| 2605 | |
| 2606 | |
| 2607 | |
| 2608 | |
| 2609 | |
| 2610 | |
| 2611 | |
| 2612 | |
| 2613 | |
| 2614 | |
| 2615 | |
| 2616 | |
| 2617 | |
| 2618 | |
| 2619 | |
| 2620 | |
| 2621 | |
| 2622 | |
| 2623 | |
| 2624 | |
| 2625 | |
| 2626 | |
| 2627 | |
| 2628 | |
| 2629 | |
| 2630 | |
| 2631 | |
| 2632 | |
| 2633 | |
| 2634 | |
| 2635 | |
| 2636 | |
| 2637 | |
| 2638 | |
| 2639 | |
| 2640 | |
| 2641 | |
| 2642 | /// An inter-coded block's mode and motion vector, `mv` in the spec's 1/8-pel |
| 2643 | /// `(row, col)` units. For [`InterMode::NearestMv`] this writer ignores `mv` |
| 2644 | /// and codes the stack's own candidate instead — the decoder derives it, so |
| 2645 | /// nothing here can disagree with it. |
| 2646 | |
| 2647 | |
| 2648 | |
| 2649 | |
| 2650 | |
| 2651 | |
| 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 | /// Side of the luma transform the coefficient writer codes. |
| 2680 | const TX32: usize = 32; |
| 2681 | /// Side of the larger of the two blocks a superblock splits into, in samples. |
| 2682 | const BLOCK: usize = 32; |
| 2683 | /// Side of the chroma transform beside it at 4:2:0, and of the luma transform |
| 2684 | /// of a 16x16 block. |
| 2685 | const TX16: usize = 16; |
| 2686 | /// Side of the chroma transform of a 16x16 block at 4:2:0, and of the luma |
| 2687 | /// transform of an 8x8 leaf under a straddling 16x16 (lane-av1-rect). |
| 2688 | const TX8: usize = 8; |
| 2689 | /// Side of the chroma transform of an 8x8 leaf at 4:2:0 (lane-av1-rect). |
| 2690 | const TX4: usize = 4; |
| 2691 | /// Side of a superblock, in samples, which is the size a block outside the |
| 2692 | /// tile reads as. |
| 2693 | const SB: usize = 64; |
| 2694 | |
| 2695 | /// The `above_side`/`left_side` value a cell with no coded neighbour holds |
| 2696 | /// (tile start, superblock-row start) -- the writer's copy of |
| 2697 | /// `crate::decode::NO_NEIGHBOUR_SIDE`, and 128 for the same reason: at 64 it |
| 2698 | /// reads identically at every level up to 64x64 but sets the bit at the |
| 2699 | /// `BLOCK_128X128` root (64 * 2 <= 128), putting that root's partition symbol |
| 2700 | /// on CDF row 3 where libaom uses row 0. |
| 2701 | const NO_NEIGHBOUR_SIDE: usize = 128; |
| 2702 | /// Side of the smallest block the writer codes, in samples, which is the grid |
| 2703 | /// the neighbour bookkeeping is kept on. |
| 2704 | const SUB: usize = 16; |
| 2705 | /// Side of a 4x4 mode-info unit, in samples: the granularity libaom's above |
| 2706 | /// and left entropy-context arrays are actually kept on (spec |
| 2707 | /// `get_txb_ctx`/`av1_set_entropy_contexts`), finer than [`SUB`]. |
| 2708 | const MI: usize = 4; |
| 2709 | |
| 2710 | /// What one coded block leaves behind for the blocks that read it as a |
| 2711 | /// neighbour: whether it coded anything at all, and the sign of its DC. |
| 2712 | |
| 2713 | |
| 2714 | |
| 2715 | |
| 2716 | |
| 2717 | |
| 2718 | |
| 2719 | |
| 2720 | |
| 2721 | |
| 2722 | |
| 2723 | |
| 2724 | |
| 2725 | /// Rejects a frame with no mode-info grid at all. |
| 2726 | /// |
| 2727 | /// `mi_cols`/`mi_rows` are the frame's *true* (unpadded) size in 4x4 units |
| 2728 | /// (spec `compute_image_size`), not necessarily a multiple of the 32x32 block |
| 2729 | /// grid: a block whose origin sits at or past this bound is not coded (spec's |
| 2730 | /// `decode_partition` never visits it), and one that straddles the bound is |
| 2731 | /// coded whole, its samples coming from the padded planes. |
| 2732 | |
| 2733 | |
| 2734 | |
| 2735 | |
| 2736 | |
| 2737 | |
| 2738 | |
| 2739 | |
| 2740 | |
| 2741 | |
| 2742 | /// The coefficients of one superblock: either one 64x64 block covering it, or |
| 2743 | /// the four 32x32 blocks it is split into. |
| 2744 | /// |
| 2745 | /// A superblock at the right-hand or bottom edge of the frame may be half |
| 2746 | /// outside it, and such a superblock cannot be left whole — the spec has no |
| 2747 | /// partition that keeps a block outside the frame — so it must be |
| 2748 | /// [`Split`](Superblock::Split), and carries only the quadrants that are |
| 2749 | /// inside, in raster order among themselves. |
| 2750 | |
| 2751 | |
| 2752 | |
| 2753 | |
| 2754 | |
| 2755 | |
| 2756 | |
| 2757 | |
| 2758 | |
| 2759 | |
| 2760 | |
| 2761 | /// One 32x32 quadrant of a split superblock. |
| 2762 | |
| 2763 | |
| 2764 | |
| 2765 | |
| 2766 | |
| 2767 | |
| 2768 | |
| 2769 | |
| 2770 | |
| 2771 | |
| 2772 | |
| 2773 | |
| 2774 | |
| 2775 | |
| 2776 | |
| 2777 | |
| 2778 | |
| 2779 | |
| 2780 | |
| 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 | |
| 2809 | |
| 2810 | |
| 2811 | |
| 2812 | |
| 2813 | |
| 2814 | |
| 2815 | |
| 2816 | |
| 2817 | |
| 2818 | |
| 2819 | |
| 2820 | |
| 2821 | |
| 2822 | |
| 2823 | |
| 2824 | |
| 2825 | |
| 2826 | |
| 2827 | |
| 2828 | |
| 2829 | |
| 2830 | |
| 2831 | /// What the blocks above and to the left of the one being coded left behind, |
| 2832 | /// kept on the 16x16 grid the smallest block sits on. |
| 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 | /// What one plane's neighbours leave for a block, gathered across every cell |
| 2960 | /// the block spans -- which is what the decoder's own derivation reads |
| 2961 | /// (spec 5.11.39), and what a single cell only stands in for while every block |
| 2962 | /// is the same size. |
| 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 | |
| 2995 | |
| 2996 | |
| 2997 | |
| 2998 | |
| 2999 | |
| 3000 | |
| 3001 | |
| 3002 | |
| 3003 | |
| 3004 | |
| 3005 | |
| 3006 | |
| 3007 | |
| 3008 | |
| 3009 | |
| 3010 | |
| 3011 | |
| 3012 | |
| 3013 | |
| 3014 | |
| 3015 | |
| 3016 | |
| 3017 | |
| 3018 | |
| 3019 | |
| 3020 | |
| 3021 | |
| 3022 | |
| 3023 | |
| 3024 | |
| 3025 | |
| 3026 | |
| 3027 | |
| 3028 | |
| 3029 | |
| 3030 | |
| 3031 | |
| 3032 | |
| 3033 | |
| 3034 | |
| 3035 | |
| 3036 | |
| 3037 | |
| 3038 | |
| 3039 | |
| 3040 | |
| 3041 | |
| 3042 | |
| 3043 | |
| 3044 | |
| 3045 | |
| 3046 | |
| 3047 | |
| 3048 | |
| 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 | |
| 3128 | |
| 3129 | |
| 3130 | |
| 3131 | |
| 3132 | |
| 3133 | |
| 3134 | |
| 3135 | |
| 3136 | |
| 3137 | |
| 3138 | |
| 3139 | |
| 3140 | |
| 3141 | |
| 3142 | |
| 3143 | |
| 3144 | |
| 3145 | |
| 3146 | |
| 3147 | |
| 3148 | |
| 3149 | |
| 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 | |
| 3187 | |
| 3188 | |
| 3189 | |
| 3190 | |
| 3191 | |
| 3192 | |
| 3193 | |
| 3194 | |
| 3195 | |
| 3196 | |
| 3197 | |
| 3198 | |
| 3199 | |
| 3200 | |
| 3201 | |
| 3202 | |
| 3203 | |
| 3204 | |
| 3205 | |
| 3206 | |
| 3207 | |
| 3208 | |
| 3209 | |
| 3210 | |
| 3211 | |
| 3212 | |
| 3213 | |
| 3214 | |
| 3215 | |
| 3216 | |
| 3217 | |
| 3218 | |
| 3219 | |
| 3220 | |
| 3221 | |
| 3222 | |
| 3223 | |
| 3224 | |
| 3225 | |
| 3226 | |
| 3227 | |
| 3228 | |
| 3229 | |
| 3230 | |
| 3231 | |
| 3232 | |
| 3233 | |
| 3234 | |
| 3235 | |
| 3236 | |
| 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 | |
| 3344 | |
| 3345 | |
| 3346 | |
| 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 | |
| 3378 | |
| 3379 | |
| 3380 | |
| 3381 | |
| 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 | |
| 3414 | |
| 3415 | |
| 3416 | |
| 3417 | |
| 3418 | |
| 3419 | |
| 3420 | |
| 3421 | |
| 3422 | |
| 3423 | |
| 3424 | |
| 3425 | |
| 3426 | |
| 3427 | |
| 3428 | |
| 3429 | |
| 3430 | |
| 3431 | |
| 3432 | |
| 3433 | |
| 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 | |
| 3464 | |
| 3465 | |
| 3466 | |
| 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 | |
| 3520 | |
| 3521 | |
| 3522 | |
| 3523 | |
| 3524 | |
| 3525 | |
| 3526 | |
| 3527 | |
| 3528 | |
| 3529 | |
| 3530 | |
| 3531 | |
| 3532 | |
| 3533 | |
| 3534 | |
| 3535 | |
| 3536 | |
| 3537 | |
| 3538 | |
| 3539 | |
| 3540 | |
| 3541 | |
| 3542 | |
| 3543 | |
| 3544 | |
| 3545 | |
| 3546 | |
| 3547 | |
| 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 | |
| 3622 | |
| 3623 | |
| 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 | |
| 3666 | |
| 3667 | |
| 3668 | |
| 3669 | |
| 3670 | |
| 3671 | |
| 3672 | |
| 3673 | /// Writes the payload of a one-tile key frame built from `superblocks`, each |
| 3674 | /// either one 64x64 block or the 32x32 blocks it splits into. |
| 3675 | /// |
| 3676 | /// `superblocks` gives one entry per superblock in raster order across the |
| 3677 | /// frame. Every block is DC-predicted unless its [`BlockCoeffs::mode`] says |
| 3678 | /// otherwise, and carries the coefficients its lists give; the coefficients |
| 3679 | /// may sit anywhere in their transform, so a block is a picture rather than a |
| 3680 | /// flat grey. |
| 3681 | /// |
| 3682 | /// # Errors |
| 3683 | /// Returns an error when the frame is not a whole number of 32x32 blocks, when |
| 3684 | /// `superblocks` does not carry exactly one entry per superblock or an entry |
| 3685 | /// does not carry one block per quadrant inside the frame, when a superblock |
| 3686 | /// that is half outside the frame is left whole, when a block names an intra |
| 3687 | /// mode a key frame does not code, when a coefficient sits outside its |
| 3688 | /// transform, repeats a position, carries a zero level or one wider than the |
| 3689 | /// Golomb tail reaches. |
| 3690 | |
| 3691 | |
| 3692 | |
| 3693 | |
| 3694 | |
| 3695 | |
| 3696 | |
| 3697 | |
| 3698 | |
| 3699 | /// [`sb_coeff_key_frame_tile`] for a frame header carrying |
| 3700 | /// `tx_mode == TxMode::Select` (`tx_select`): every block then codes a |
| 3701 | /// `tx_depth` symbol and, where that depth is nonzero, its luma residual as |
| 3702 | /// several transform units ([`write_luma_select`]). With `tx_select` false |
| 3703 | /// this writes exactly the stream it always did. |
| 3704 | /// |
| 3705 | /// # Errors |
| 3706 | /// As [`sb_coeff_key_frame_tile`], plus a 64x64 block whose `tx_depth` is |
| 3707 | /// nonzero (not written yet). |
| 3708 | |
| 3709 | |
| 3710 | |
| 3711 | |
| 3712 | |
| 3713 | |
| 3714 | |
| 3715 | |
| 3716 | |
| 3717 | |
| 3718 | |
| 3719 | |
| 3720 | |
| 3721 | |
| 3722 | |
| 3723 | |
| 3724 | |
| 3725 | |
| 3726 | |
| 3727 | /// [`sb_coeff_key_frame_tile_tx`] starting from -- and leaving behind -- the |
| 3728 | /// caller's own CDF state, which is what a frame whose |
| 3729 | /// `disable_frame_end_update_cdf` is off needs: the next frame's writer must |
| 3730 | /// start where this tile ended (spec 7.20, mirrored by |
| 3731 | /// `crate::stream::stored_cdfs_for`). |
| 3732 | /// |
| 3733 | /// # Errors |
| 3734 | /// As [`sb_coeff_key_frame_tile_tx`]. |
| 3735 | pub |
| 3736 | |
| 3737 | |
| 3738 | |
| 3739 | |
| 3740 | |
| 3741 | |
| 3742 | |
| 3743 | |
| 3744 | |
| 3745 | |
| 3746 | |
| 3747 | |
| 3748 | |
| 3749 | |
| 3750 | |
| 3751 | |
| 3752 | |
| 3753 | |
| 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 | |
| 3786 | |
| 3787 | |
| 3788 | |
| 3789 | |
| 3790 | |
| 3791 | |
| 3792 | |
| 3793 | |
| 3794 | |
| 3795 | |
| 3796 | |
| 3797 | |
| 3798 | |
| 3799 | |
| 3800 | |
| 3801 | |
| 3802 | |
| 3803 | |
| 3804 | |
| 3805 | |
| 3806 | |
| 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 | |
| 3839 | |
| 3840 | |
| 3841 | |
| 3842 | |
| 3843 | |
| 3844 | |
| 3845 | |
| 3846 | |
| 3847 | |
| 3848 | |
| 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 | |
| 3904 | |
| 3905 | |
| 3906 | |
| 3907 | |
| 3908 | |
| 3909 | |
| 3910 | |
| 3911 | |
| 3912 | |
| 3913 | |
| 3914 | |
| 3915 | |
| 3916 | |
| 3917 | |
| 3918 | |
| 3919 | |
| 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 | |
| 3988 | |
| 3989 | |
| 3990 | |
| 3991 | |
| 3992 | |
| 3993 | |
| 3994 | |
| 3995 | |
| 3996 | |
| 3997 | |
| 3998 | |
| 3999 | |
| 4000 | |
| 4001 | |
| 4002 | |
| 4003 | |
| 4004 | |
| 4005 | |
| 4006 | |
| 4007 | |
| 4008 | |
| 4009 | |
| 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 | |
| 4173 | |
| 4174 | |
| 4175 | |
| 4176 | |
| 4177 | |
| 4178 | |
| 4179 | |
| 4180 | |
| 4181 | |
| 4182 | |
| 4183 | |
| 4184 | |
| 4185 | |
| 4186 | |
| 4187 | |
| 4188 | |
| 4189 | |
| 4190 | |
| 4191 | |
| 4192 | |
| 4193 | |
| 4194 | |
| 4195 | |
| 4196 | |
| 4197 | |
| 4198 | |
| 4199 | |
| 4200 | |
| 4201 | |
| 4202 | |
| 4203 | |
| 4204 | |
| 4205 | |
| 4206 | |
| 4207 | |
| 4208 | |
| 4209 | |
| 4210 | |
| 4211 | |
| 4212 | |
| 4213 | |
| 4214 | |
| 4215 | |
| 4216 | |
| 4217 | |
| 4218 | |
| 4219 | |
| 4220 | |
| 4221 | |
| 4222 | |
| 4223 | |
| 4224 | |
| 4225 | |
| 4226 | |
| 4227 | |
| 4228 | |
| 4229 | |
| 4230 | |
| 4231 | /// `av1_write_uniform` -- the inverse of [`crate::decode`]'s `read_uniform`, |
| 4232 | /// which the palette colour-index map's first (context-free) symbol is coded |
| 4233 | /// with. |
| 4234 | |
| 4235 | |
| 4236 | |
| 4237 | |
| 4238 | |
| 4239 | |
| 4240 | |
| 4241 | |
| 4242 | |
| 4243 | |
| 4244 | |
| 4245 | /// `write_palette_colors_y` (bitstream.c:1178), the write side of |
| 4246 | /// [`crate::decode`]'s `read_palette_colors_y` at 8 bits: one flag per cache |
| 4247 | /// entry (taken when this palette holds that colour, in cache order, stopping |
| 4248 | /// once `n` are cached), then the colours the cache did not supply -- the |
| 4249 | /// first raw, the rest as deltas off a bit width that shrinks with the range |
| 4250 | /// left. `colors` is ascending and distinct, so the decoder's `merge_colors` |
| 4251 | /// of the two ascending lists puts it back exactly. |
| 4252 | |
| 4253 | |
| 4254 | |
| 4255 | |
| 4256 | |
| 4257 | |
| 4258 | |
| 4259 | |
| 4260 | |
| 4261 | |
| 4262 | |
| 4263 | |
| 4264 | |
| 4265 | |
| 4266 | |
| 4267 | |
| 4268 | |
| 4269 | |
| 4270 | |
| 4271 | |
| 4272 | |
| 4273 | |
| 4274 | |
| 4275 | |
| 4276 | |
| 4277 | |
| 4278 | |
| 4279 | |
| 4280 | |
| 4281 | |
| 4282 | |
| 4283 | |
| 4284 | |
| 4285 | |
| 4286 | |
| 4287 | |
| 4288 | |
| 4289 | |
| 4290 | |
| 4291 | |
| 4292 | |
| 4293 | |
| 4294 | |
| 4295 | |
| 4296 | |
| 4297 | |
| 4298 | |
| 4299 | |
| 4300 | |
| 4301 | |
| 4302 | |
| 4303 | |
| 4304 | |
| 4305 | |
| 4306 | /// `write_palette_colors_uv` (bitstream.c:1236), the write side of |
| 4307 | /// [`crate::decode`]'s `read_palette_colors_uv` at 8 bits. U is |
| 4308 | /// [`write_palette_colors_y`]'s cache/delta scheme with the reader's two |
| 4309 | /// documented differences -- the shrinking range starts at `256 - first` |
| 4310 | /// (not `255 - first`) and each delta is written unbiased (no `-1`). |
| 4311 | /// |
| 4312 | /// corner-cut: V takes the reader's RAW form (the leading bit 0, then `n` |
| 4313 | /// 8-bit literals) rather than its first-value-plus-signed-deltas form. |
| 4314 | /// Ceiling: about `n` bits per chroma-palette block more than the delta form |
| 4315 | /// would spend (8n against roughly 10 + (n-1)*(5..8)), which the RD pricer |
| 4316 | /// below sees, so it only ever makes the encoder take FEWER chroma palettes |
| 4317 | /// than it should -- never a wrong stream. Upgrade path: price both forms |
| 4318 | /// here and write the cheaper one under its own leading bit. |
| 4319 | |
| 4320 | |
| 4321 | |
| 4322 | |
| 4323 | |
| 4324 | |
| 4325 | |
| 4326 | |
| 4327 | |
| 4328 | |
| 4329 | |
| 4330 | |
| 4331 | |
| 4332 | |
| 4333 | |
| 4334 | |
| 4335 | |
| 4336 | |
| 4337 | |
| 4338 | |
| 4339 | |
| 4340 | |
| 4341 | |
| 4342 | |
| 4343 | |
| 4344 | |
| 4345 | |
| 4346 | |
| 4347 | |
| 4348 | |
| 4349 | |
| 4350 | |
| 4351 | |
| 4352 | |
| 4353 | |
| 4354 | |
| 4355 | |
| 4356 | |
| 4357 | |
| 4358 | |
| 4359 | |
| 4360 | |
| 4361 | |
| 4362 | |
| 4363 | |
| 4364 | |
| 4365 | |
| 4366 | |
| 4367 | |
| 4368 | |
| 4369 | |
| 4370 | |
| 4371 | |
| 4372 | /// `write_palette_color_map` (bitstream.c), the write side of |
| 4373 | /// [`crate::decode`]'s `decode_color_index_map`: the same wavefront diagonal, |
| 4374 | /// each symbol written as the position its colour takes in the neighbour |
| 4375 | /// ordering `av1_get_palette_color_index_context` hands back. |
| 4376 | |
| 4377 | |
| 4378 | |
| 4379 | |
| 4380 | |
| 4381 | |
| 4382 | |
| 4383 | |
| 4384 | |
| 4385 | |
| 4386 | |
| 4387 | |
| 4388 | |
| 4389 | |
| 4390 | |
| 4391 | |
| 4392 | |
| 4393 | |
| 4394 | |
| 4395 | |
| 4396 | |
| 4397 | |
| 4398 | |
| 4399 | |
| 4400 | |
| 4401 | |
| 4402 | |
| 4403 | |
| 4404 | |
| 4405 | |
| 4406 | |
| 4407 | /// What one block's palette syntax costs, in bits: the `palette_y_mode` flag, |
| 4408 | /// the size symbol, the colours and the whole colour-index map, priced |
| 4409 | /// through the very writers above on a [`SymbolEncoder::pricer`] -- so the |
| 4410 | /// search reads the rate the tile will really spend, not an estimate of it. |
| 4411 | /// The neighbour cache is taken as empty (the search runs before the tile |
| 4412 | /// knows what its neighbours will be), which only ever over-prices. |
| 4413 | pub |
| 4414 | |
| 4415 | |
| 4416 | |
| 4417 | |
| 4418 | |
| 4419 | |
| 4420 | |
| 4421 | |
| 4422 | |
| 4423 | |
| 4424 | |
| 4425 | |
| 4426 | |
| 4427 | |
| 4428 | |
| 4429 | /// [`palette_bits`] for the chroma palette: the `palette_uv_mode` flag, the |
| 4430 | /// size symbol, both colour lists and the shared colour-index map, priced |
| 4431 | /// through the very writers above (empty cache, which only over-prices). |
| 4432 | pub |
| 4433 | |
| 4434 | |
| 4435 | |
| 4436 | |
| 4437 | |
| 4438 | |
| 4439 | |
| 4440 | |
| 4441 | |
| 4442 | |
| 4443 | |
| 4444 | |
| 4445 | |
| 4446 | |
| 4447 | |
| 4448 | /// Writes everything a key frame's block carries before its coefficients: the |
| 4449 | /// skip flag, its luma intra mode against the CDF its neighbours' modes pick, |
| 4450 | /// the angle a directional mode is steered by, and its chroma mode. Hands back |
| 4451 | /// the luma mode, which is what the blocks beside it read. |
| 4452 | /// The DV predictor decode.rs `read_intrabc_dv` derives, mirrored line for |
| 4453 | /// line off the writer's own copy of the intrabc mi grid: the `INTRA_FRAME` |
| 4454 | /// stack's `nearest_mv` (or `near_mv` when that is zero), or -- when both are |
| 4455 | /// -- `av1_find_ref_dv`'s fallback one superblock up, or 256 pixels plus one |
| 4456 | /// superblock to the left on the tile's first superblock row, then floored to |
| 4457 | /// full pel. Returns `(0, 0)` when no grid is armed, which no `allow_intrabc` |
| 4458 | /// tile ever reaches. |
| 4459 | |
| 4460 | |
| 4461 | |
| 4462 | |
| 4463 | |
| 4464 | |
| 4465 | |
| 4466 | |
| 4467 | |
| 4468 | |
| 4469 | |
| 4470 | |
| 4471 | |
| 4472 | |
| 4473 | |
| 4474 | |
| 4475 | |
| 4476 | |
| 4477 | |
| 4478 | |
| 4479 | |
| 4480 | |
| 4481 | |
| 4482 | |
| 4483 | |
| 4484 | |
| 4485 | |
| 4486 | |
| 4487 | |
| 4488 | |
| 4489 | |
| 4490 | |
| 4491 | |
| 4492 | |
| 4493 | |
| 4494 | |
| 4495 | /// Publishes one coded block into [`INTRABC_GRID`], mirroring decode.rs |
| 4496 | /// `record_intrabc_mi`: every block contributes its size, an intrabc one also |
| 4497 | /// its DV as an `INTRA_FRAME` candidate. |
| 4498 | |
| 4499 | |
| 4500 | |
| 4501 | |
| 4502 | |
| 4503 | |
| 4504 | |
| 4505 | |
| 4506 | |
| 4507 | |
| 4508 | |
| 4509 | |
| 4510 | |
| 4511 | |
| 4512 | |
| 4513 | |
| 4514 | |
| 4515 | |
| 4516 | |
| 4517 | |
| 4518 | |
| 4519 | |
| 4520 | |
| 4521 | |
| 4522 | |
| 4523 | |
| 4524 | /// One full-pel block-vector component, [`write_mv_component`]'s |
| 4525 | /// `force_integer_mv` twin: decode.rs `read_mv_component` infers `mv_fr`/ |
| 4526 | /// `mv_class0_fr` as 3 and the high-precision bit as 1 under |
| 4527 | /// `force_integer_mv`, so neither symbol is written here -- writing them |
| 4528 | /// would leave the decoder two symbols behind from this block on. |
| 4529 | |
| 4530 | |
| 4531 | |
| 4532 | |
| 4533 | |
| 4534 | |
| 4535 | |
| 4536 | |
| 4537 | |
| 4538 | |
| 4539 | |
| 4540 | |
| 4541 | |
| 4542 | |
| 4543 | |
| 4544 | |
| 4545 | |
| 4546 | |
| 4547 | |
| 4548 | |
| 4549 | |
| 4550 | |
| 4551 | |
| 4552 | |
| 4553 | /// One intrabc block's DV as a residual against [`intrabc_dv_pred`], off the |
| 4554 | /// `dv` nmv context (decode.rs `read_intrabc_dv` -> `read_mv`). |
| 4555 | |
| 4556 | |
| 4557 | |
| 4558 | |
| 4559 | |
| 4560 | |
| 4561 | |
| 4562 | |
| 4563 | |
| 4564 | |
| 4565 | |
| 4566 | |
| 4567 | |
| 4568 | |
| 4569 | |
| 4570 | |
| 4571 | |
| 4572 | |
| 4573 | /// The mode-info half of an intrabc block (decode.rs `read_intra_mode`'s |
| 4574 | /// early return): `skip`, `cdef_idx`, `use_intrabc` and the DV, then nothing |
| 4575 | /// -- no y/uv mode, no angle delta, no palette, and (because it is skipped) |
| 4576 | /// no transform size and no residual. Publishes the block into every |
| 4577 | /// neighbour band an ordinary block leaves behind, at the DC_PRED/uncoded/ |
| 4578 | /// skipped state a decoder reads back for it. |
| 4579 | |
| 4580 | |
| 4581 | |
| 4582 | |
| 4583 | |
| 4584 | |
| 4585 | |
| 4586 | |
| 4587 | |
| 4588 | |
| 4589 | |
| 4590 | |
| 4591 | |
| 4592 | |
| 4593 | |
| 4594 | |
| 4595 | |
| 4596 | |
| 4597 | |
| 4598 | |
| 4599 | |
| 4600 | |
| 4601 | |
| 4602 | |
| 4603 | |
| 4604 | |
| 4605 | |
| 4606 | |
| 4607 | |
| 4608 | |
| 4609 | |
| 4610 | |
| 4611 | |
| 4612 | |
| 4613 | |
| 4614 | |
| 4615 | |
| 4616 | |
| 4617 | /// `UV_CFL_PRED` (spec 6.10.19's chroma mode enum), the fourteenth entry of |
| 4618 | /// [`crate::cdf::UV_MODE_CFL`] -- the writer's twin of the decoder's own |
| 4619 | /// constant. |
| 4620 | pub const UV_CFL_PRED: usize = 13; |
| 4621 | |
| 4622 | /// The `cfl_alpha_signs` joint value (0..8) that codes this signed alpha pair, |
| 4623 | /// inverting the decoder's own `read_cfl_alphas` split (`sign_u = |
| 4624 | /// ((joint+1)*11)>>5`, `sign_v = (joint+1) - 3*sign_u`, with 0 ZERO, 1 NEG, |
| 4625 | /// 2 POS). There is no (ZERO, ZERO) joint value, so at least one alpha of a |
| 4626 | /// CfL block is nonzero by construction. |
| 4627 | pub |
| 4628 | |
| 4629 | |
| 4630 | |
| 4631 | |
| 4632 | |
| 4633 | |
| 4634 | |
| 4635 | |
| 4636 | |
| 4637 | |
| 4638 | |
| 4639 | |
| 4640 | |
| 4641 | |
| 4642 | /// The `cfl_alpha_u`/`cfl_alpha_v` magnitude CDF row for one plane, by the |
| 4643 | /// same `CFL_CONTEXT_U`/`CFL_CONTEXT_V` derivation the decoder reads with |
| 4644 | /// (libaom cfl.h). `joint` is [`cfl_joint_sign`]'s value. |
| 4645 | |
| 4646 | |
| 4647 | |
| 4648 | |
| 4649 | |
| 4650 | |
| 4651 | |
| 4652 | |
| 4653 | |
| 4654 | |
| 4655 | |
| 4656 | /// What [`write_cfl_alphas`] will spend on this alpha pair, through the same |
| 4657 | /// tables -- the encoder's RD price for the CfL arm. |
| 4658 | pub |
| 4659 | |
| 4660 | |
| 4661 | |
| 4662 | |
| 4663 | |
| 4664 | |
| 4665 | |
| 4666 | |
| 4667 | |
| 4668 | |
| 4669 | |
| 4670 | |
| 4671 | |
| 4672 | |
| 4673 | /// `read_cfl_alphas` (spec 5.11.45) written: the joint sign, then each |
| 4674 | /// plane's magnitude where its sign is nonzero. |
| 4675 | |
| 4676 | |
| 4677 | |
| 4678 | |
| 4679 | |
| 4680 | |
| 4681 | |
| 4682 | |
| 4683 | |
| 4684 | |
| 4685 | |
| 4686 | |
| 4687 | |
| 4688 | |
| 4689 | |
| 4690 | |
| 4691 | |
| 4692 | |
| 4693 | |
| 4694 | |
| 4695 | |
| 4696 | |
| 4697 | |
| 4698 | |
| 4699 | |
| 4700 | |
| 4701 | |
| 4702 | |
| 4703 | |
| 4704 | |
| 4705 | |
| 4706 | |
| 4707 | |
| 4708 | |
| 4709 | |
| 4710 | |
| 4711 | |
| 4712 | |
| 4713 | |
| 4714 | |
| 4715 | |
| 4716 | |
| 4717 | |
| 4718 | |
| 4719 | |
| 4720 | |
| 4721 | |
| 4722 | |
| 4723 | |
| 4724 | |
| 4725 | |
| 4726 | |
| 4727 | |
| 4728 | |
| 4729 | |
| 4730 | |
| 4731 | |
| 4732 | |
| 4733 | |
| 4734 | |
| 4735 | |
| 4736 | |
| 4737 | |
| 4738 | |
| 4739 | |
| 4740 | |
| 4741 | |
| 4742 | |
| 4743 | |
| 4744 | |
| 4745 | |
| 4746 | |
| 4747 | |
| 4748 | |
| 4749 | |
| 4750 | |
| 4751 | |
| 4752 | |
| 4753 | |
| 4754 | |
| 4755 | |
| 4756 | |
| 4757 | |
| 4758 | |
| 4759 | |
| 4760 | |
| 4761 | |
| 4762 | |
| 4763 | |
| 4764 | |
| 4765 | |
| 4766 | |
| 4767 | |
| 4768 | |
| 4769 | |
| 4770 | /// `read_palette_mode_info` (spec 5.11.46) written out, mirrored symbol for |
| 4771 | /// symbol from the decoder's own read in `read_intra_mode`: on a frame whose |
| 4772 | /// header set `allow_screen_content_tools`, a `DC_PRED` luma block and a |
| 4773 | /// `UV_DC_PRED` chroma pair each carry a use-palette flag, and a luma palette |
| 4774 | /// then codes its size, its colours (against the neighbour colour cache) and |
| 4775 | /// -- after the chroma flag, exactly where libaom's `av1_visit_palette` runs |
| 4776 | /// -- its colour-index map. Shared by the key frame's [`write_intra_mode`] and |
| 4777 | /// by the three intra arms of the inter-frame writers, which read the same |
| 4778 | /// syntax back through `decode_inter_block`/`decode_intra_rect_in_inter`. |
| 4779 | /// |
| 4780 | /// The band publication is deferred to [`Neighbours::record_mi_planes`] (the |
| 4781 | /// one point every block passes through), so a block that takes no palette |
| 4782 | /// still clears what the column held. |
| 4783 | |
| 4784 | |
| 4785 | |
| 4786 | |
| 4787 | |
| 4788 | |
| 4789 | |
| 4790 | |
| 4791 | |
| 4792 | |
| 4793 | |
| 4794 | |
| 4795 | |
| 4796 | |
| 4797 | |
| 4798 | |
| 4799 | |
| 4800 | |
| 4801 | |
| 4802 | |
| 4803 | |
| 4804 | |
| 4805 | |
| 4806 | |
| 4807 | |
| 4808 | |
| 4809 | |
| 4810 | |
| 4811 | |
| 4812 | |
| 4813 | |
| 4814 | |
| 4815 | |
| 4816 | |
| 4817 | |
| 4818 | |
| 4819 | |
| 4820 | |
| 4821 | |
| 4822 | |
| 4823 | |
| 4824 | |
| 4825 | |
| 4826 | |
| 4827 | |
| 4828 | |
| 4829 | |
| 4830 | |
| 4831 | |
| 4832 | |
| 4833 | |
| 4834 | |
| 4835 | |
| 4836 | |
| 4837 | |
| 4838 | |
| 4839 | |
| 4840 | |
| 4841 | |
| 4842 | |
| 4843 | |
| 4844 | |
| 4845 | |
| 4846 | |
| 4847 | |
| 4848 | |
| 4849 | |
| 4850 | |
| 4851 | |
| 4852 | |
| 4853 | |
| 4854 | |
| 4855 | |
| 4856 | |
| 4857 | |
| 4858 | |
| 4859 | |
| 4860 | |
| 4861 | |
| 4862 | |
| 4863 | |
| 4864 | |
| 4865 | |
| 4866 | |
| 4867 | |
| 4868 | |
| 4869 | |
| 4870 | |
| 4871 | |
| 4872 | |
| 4873 | |
| 4874 | /// The side of a chroma palette's shared colour-index map for a square luma |
| 4875 | /// block of `side` samples: `av1_get_plane_block_size(bsize, 1, 1)` floored at |
| 4876 | /// the 4-px transform, NOT a plain halving (decode.rs reads the map at |
| 4877 | /// exactly this size). |
| 4878 | pub |
| 4879 | |
| 4880 | |
| 4881 | |
| 4882 | /// How many blocks took a palette, and of what size -- the fire count a gate |
| 4883 | /// prints so that "palette is on" is a measurement rather than a claim |
| 4884 | /// (class `gate-blind-to-feature`). Index 0 is the block count, 2..=8 the |
| 4885 | /// per-size histogram. |
| 4886 | static PALETTE_HITS: = |
| 4887 | ; |
| 4888 | |
| 4889 | /// lane-palw: colour-index maps written over the ON-SCREEN corner only, |
| 4890 | /// i.e. palette blocks this writer cut at the frame's right/bottom mi edge. |
| 4891 | /// A gate asserts it non-zero so it cannot pass on a stream that never cuts |
| 4892 | /// one (class `gate-blind-to-feature`). |
| 4893 | static PALETTE_CUT_MAPS: AtomicUsize = |
| 4894 | new; |
| 4895 | |
| 4896 | /// Current value of [`PALETTE_CUT_MAPS`] (colour-index maps). |
| 4897 | |
| 4898 | |
| 4899 | |
| 4900 | |
| 4901 | /// Zeroes [`PALETTE_CUT_MAPS`] before a gate's own encode. |
| 4902 | |
| 4903 | |
| 4904 | |
| 4905 | |
| 4906 | |
| 4907 | |
| 4908 | |
| 4909 | |
| 4910 | |
| 4911 | /// [`PALETTE_HITS`] for the chroma palette -- the same shape, so a gate can |
| 4912 | /// print the share of each plane's palette separately. |
| 4913 | static PALETTE_UV_HITS: = |
| 4914 | ; |
| 4915 | |
| 4916 | |
| 4917 | |
| 4918 | |
| 4919 | |
| 4920 | |
| 4921 | /// How many chroma base colours came out of the NEIGHBOUR CACHE rather than |
| 4922 | /// the stream -- the half of `write_palette_colors_uv` a test cannot see from |
| 4923 | /// the block counts alone, and the one that desyncs the tile if this writer's |
| 4924 | /// cache ever disagrees with the decoder's (`gate-blind-to-feature`). |
| 4925 | static PALETTE_UV_CACHE_HITS: AtomicUsize = |
| 4926 | new; |
| 4927 | |
| 4928 | /// Reads [`PALETTE_UV_CACHE_HITS`] and zeroes it. |
| 4929 | |
| 4930 | pub |
| 4931 | |
| 4932 | |
| 4933 | |
| 4934 | /// [`take_palette_hits`] for the chroma palette. |
| 4935 | |
| 4936 | pub |
| 4937 | |
| 4938 | |
| 4939 | |
| 4940 | /// Reads [`PALETTE_HITS`] and zeroes it, so a gate can attribute the counts to |
| 4941 | /// its own encode. |
| 4942 | |
| 4943 | pub |
| 4944 | |
| 4945 | |
| 4946 | |
| 4947 | /// Writes one coded block: its mode, its three transform blocks, and what it |
| 4948 | /// leaves behind for the blocks beside it. Its partition symbol is already |
| 4949 | /// written, because only the caller knows what tree led here. |
| 4950 | |
| 4951 | |
| 4952 | |
| 4953 | |
| 4954 | |
| 4955 | |
| 4956 | |
| 4957 | |
| 4958 | |
| 4959 | |
| 4960 | |
| 4961 | |
| 4962 | |
| 4963 | |
| 4964 | |
| 4965 | |
| 4966 | |
| 4967 | |
| 4968 | |
| 4969 | |
| 4970 | |
| 4971 | |
| 4972 | |
| 4973 | |
| 4974 | |
| 4975 | |
| 4976 | |
| 4977 | |
| 4978 | |
| 4979 | |
| 4980 | |
| 4981 | |
| 4982 | |
| 4983 | |
| 4984 | |
| 4985 | |
| 4986 | |
| 4987 | |
| 4988 | |
| 4989 | |
| 4990 | |
| 4991 | |
| 4992 | |
| 4993 | |
| 4994 | |
| 4995 | |
| 4996 | |
| 4997 | |
| 4998 | |
| 4999 | |
| 5000 | |
| 5001 | |
| 5002 | |
| 5003 | |
| 5004 | |
| 5005 | |
| 5006 | |
| 5007 | |
| 5008 | |
| 5009 | |
| 5010 | |
| 5011 | |
| 5012 | |
| 5013 | |
| 5014 | |
| 5015 | |
| 5016 | |
| 5017 | |
| 5018 | |
| 5019 | |
| 5020 | |
| 5021 | |
| 5022 | |
| 5023 | |
| 5024 | |
| 5025 | |
| 5026 | |
| 5027 | /// An unskipped block's own `skip` publication: only an `allow_intrabc` |
| 5028 | /// frame ever sets these bands, so a frame without one leaves them exactly |
| 5029 | /// as they were before this lane (all false). |
| 5030 | |
| 5031 | |
| 5032 | |
| 5033 | |
| 5034 | |
| 5035 | |
| 5036 | |
| 5037 | |
| 5038 | |
| 5039 | |
| 5040 | /// Writes one 8x8 leaf of a straddling 16x16 block (lane-av1-rect): its own |
| 5041 | /// luma transform and 4x4 chroma transforms, coded exactly like |
| 5042 | /// [`write_block`] but reading its intra-mode context from the *enclosing* |
| 5043 | /// 16x16 slot -- `outer_at`, in [`SUB`]-grid units -- rather than from its own |
| 5044 | /// finer position, since [`Neighbours`]'s `above_mode`/`left_mode` arrays stay |
| 5045 | /// at [`SUB`] (16-sample) granularity. `leaf_mi` is this leaf's own position |
| 5046 | /// in 4x4 mode-info units, which is what its coefficient context (finer than |
| 5047 | /// [`SUB`]) is kept and read at. |
| 5048 | |
| 5049 | |
| 5050 | |
| 5051 | |
| 5052 | |
| 5053 | |
| 5054 | |
| 5055 | |
| 5056 | |
| 5057 | |
| 5058 | |
| 5059 | |
| 5060 | |
| 5061 | |
| 5062 | |
| 5063 | |
| 5064 | |
| 5065 | |
| 5066 | |
| 5067 | |
| 5068 | |
| 5069 | |
| 5070 | |
| 5071 | |
| 5072 | |
| 5073 | |
| 5074 | |
| 5075 | |
| 5076 | |
| 5077 | |
| 5078 | |
| 5079 | |
| 5080 | |
| 5081 | |
| 5082 | |
| 5083 | |
| 5084 | |
| 5085 | |
| 5086 | |
| 5087 | |
| 5088 | |
| 5089 | |
| 5090 | |
| 5091 | |
| 5092 | |
| 5093 | |
| 5094 | |
| 5095 | |
| 5096 | |
| 5097 | |
| 5098 | |
| 5099 | |
| 5100 | |
| 5101 | |
| 5102 | |
| 5103 | |
| 5104 | |
| 5105 | |
| 5106 | |
| 5107 | |
| 5108 | |
| 5109 | |
| 5110 | |
| 5111 | |
| 5112 | |
| 5113 | |
| 5114 | |
| 5115 | |
| 5116 | |
| 5117 | |
| 5118 | |
| 5119 | |
| 5120 | |
| 5121 | |
| 5122 | |
| 5123 | |
| 5124 | |
| 5125 | |
| 5126 | |
| 5127 | |
| 5128 | /// Writes the three transform blocks of one coded block, in the order a |
| 5129 | /// decoder reads them. |
| 5130 | |
| 5131 | |
| 5132 | |
| 5133 | |
| 5134 | |
| 5135 | |
| 5136 | |
| 5137 | |
| 5138 | |
| 5139 | |
| 5140 | |
| 5141 | |
| 5142 | |
| 5143 | |
| 5144 | |
| 5145 | |
| 5146 | |
| 5147 | |
| 5148 | |
| 5149 | |
| 5150 | |
| 5151 | |
| 5152 | |
| 5153 | |
| 5154 | |
| 5155 | |
| 5156 | |
| 5157 | |
| 5158 | |
| 5159 | |
| 5160 | |
| 5161 | |
| 5162 | |
| 5163 | |
| 5164 | |
| 5165 | |
| 5166 | |
| 5167 | |
| 5168 | |
| 5169 | |
| 5170 | |
| 5171 | |
| 5172 | |
| 5173 | |
| 5174 | |
| 5175 | |
| 5176 | |
| 5177 | |
| 5178 | |
| 5179 | |
| 5180 | |
| 5181 | |
| 5182 | |
| 5183 | |
| 5184 | |
| 5185 | |
| 5186 | |
| 5187 | |
| 5188 | |
| 5189 | |
| 5190 | |
| 5191 | |
| 5192 | |
| 5193 | |
| 5194 | |
| 5195 | |
| 5196 | |
| 5197 | |
| 5198 | |
| 5199 | |
| 5200 | |
| 5201 | |
| 5202 | |
| 5203 | |
| 5204 | |
| 5205 | |
| 5206 | |
| 5207 | |
| 5208 | |
| 5209 | |
| 5210 | |
| 5211 | |
| 5212 | |
| 5213 | |
| 5214 | |
| 5215 | |
| 5216 | |
| 5217 | |
| 5218 | /// The single luma transform type a block carries, `DCT_DCT` for one that |
| 5219 | /// never searched one (lane-txset). |
| 5220 | |
| 5221 | |
| 5222 | |
| 5223 | |
| 5224 | /// The `(side / tx)^2` transform units of one block's luma residual, raster |
| 5225 | /// order, each with its own coefficient context and each published before the |
| 5226 | /// next one reads it (decode.rs `decode_block`'s multi-transform-unit branch). |
| 5227 | /// `grid` is the block's levels in BLOCK coordinates when the transform |
| 5228 | /// splits, and the single transform's own coefficient grid when it does not. |
| 5229 | |
| 5230 | |
| 5231 | |
| 5232 | |
| 5233 | |
| 5234 | |
| 5235 | |
| 5236 | |
| 5237 | |
| 5238 | |
| 5239 | |
| 5240 | |
| 5241 | |
| 5242 | |
| 5243 | |
| 5244 | |
| 5245 | |
| 5246 | |
| 5247 | |
| 5248 | |
| 5249 | |
| 5250 | |
| 5251 | |
| 5252 | |
| 5253 | |
| 5254 | |
| 5255 | |
| 5256 | |
| 5257 | |
| 5258 | |
| 5259 | |
| 5260 | |
| 5261 | |
| 5262 | |
| 5263 | |
| 5264 | |
| 5265 | |
| 5266 | |
| 5267 | |
| 5268 | |
| 5269 | |
| 5270 | |
| 5271 | |
| 5272 | |
| 5273 | |
| 5274 | |
| 5275 | |
| 5276 | |
| 5277 | |
| 5278 | |
| 5279 | |
| 5280 | |
| 5281 | |
| 5282 | |
| 5283 | |
| 5284 | |
| 5285 | |
| 5286 | |
| 5287 | |
| 5288 | |
| 5289 | |
| 5290 | |
| 5291 | |
| 5292 | |
| 5293 | |
| 5294 | |
| 5295 | |
| 5296 | |
| 5297 | |
| 5298 | |
| 5299 | |
| 5300 | |
| 5301 | |
| 5302 | |
| 5303 | |
| 5304 | |
| 5305 | |
| 5306 | |
| 5307 | |
| 5308 | |
| 5309 | |
| 5310 | |
| 5311 | |
| 5312 | |
| 5313 | |
| 5314 | |
| 5315 | |
| 5316 | |
| 5317 | |
| 5318 | |
| 5319 | |
| 5320 | |
| 5321 | |
| 5322 | |
| 5323 | |
| 5324 | |
| 5325 | |
| 5326 | |
| 5327 | |
| 5328 | |
| 5329 | |
| 5330 | |
| 5331 | |
| 5332 | |
| 5333 | |
| 5334 | |
| 5335 | |
| 5336 | |
| 5337 | |
| 5338 | |
| 5339 | |
| 5340 | |
| 5341 | |
| 5342 | |
| 5343 | |
| 5344 | |
| 5345 | /// Writes one intra block's luma residual under `TxMode::Select`: the |
| 5346 | /// `tx_depth` symbol (spec 5.11.16 `read_selected_tx_size`, off the size |
| 5347 | /// category's own CDF at [`Neighbours::tx_size_ctx`]'s row), then the |
| 5348 | /// `(side / tx)^2` transform units in raster order -- each predicted and |
| 5349 | /// coded against what the units before it already left behind, which is why |
| 5350 | /// every unit publishes its own coefficient context before the next one reads |
| 5351 | /// it (decode.rs `decode_block`'s multi-transform-unit branch). |
| 5352 | /// |
| 5353 | /// `grid` is the block's levels in BLOCK coordinates (`side` by `side`) when |
| 5354 | /// the transform splits, and the single transform's own coefficient grid when |
| 5355 | /// it does not. Hands back the resolved transform side in pixels. |
| 5356 | |
| 5357 | |
| 5358 | |
| 5359 | |
| 5360 | |
| 5361 | |
| 5362 | |
| 5363 | |
| 5364 | |
| 5365 | |
| 5366 | |
| 5367 | |
| 5368 | |
| 5369 | |
| 5370 | |
| 5371 | |
| 5372 | |
| 5373 | |
| 5374 | |
| 5375 | |
| 5376 | |
| 5377 | |
| 5378 | |
| 5379 | |
| 5380 | |
| 5381 | |
| 5382 | |
| 5383 | |
| 5384 | |
| 5385 | |
| 5386 | |
| 5387 | |
| 5388 | |
| 5389 | /// The transform syntax one block of an INTER frame coded with |
| 5390 | /// `tx_mode == TxMode::Select` carries, in the place spec 5.11.16's |
| 5391 | /// `read_block_tx_size` reads it -- after the modes and the motion vector, |
| 5392 | /// before the residual: |
| 5393 | /// * an inter block that codes a residual walks a var-tx tree; this writer |
| 5394 | /// keeps it at its own largest transform, so that is one `txfm_split` flag |
| 5395 | /// of zero, off `txfm_partition_ctx_rect`'s row, publishing the bands per |
| 5396 | /// unit the way `read_var_tx_size` does. |
| 5397 | /// * a skipped inter block codes nothing and records its own BLOCK size |
| 5398 | /// (`set_txfm_ctxs`'s `skip_inter` term). |
| 5399 | /// * an intra block codes `tx_depth` like a key frame's, but off the |
| 5400 | /// `TXFM_CONTEXT` bands rather than the deblock grid. |
| 5401 | /// |
| 5402 | /// Hands back the block's resolved luma transform side. |
| 5403 | |
| 5404 | |
| 5405 | |
| 5406 | |
| 5407 | |
| 5408 | |
| 5409 | |
| 5410 | |
| 5411 | |
| 5412 | |
| 5413 | |
| 5414 | |
| 5415 | |
| 5416 | |
| 5417 | |
| 5418 | |
| 5419 | |
| 5420 | |
| 5421 | |
| 5422 | |
| 5423 | |
| 5424 | |
| 5425 | |
| 5426 | |
| 5427 | |
| 5428 | |
| 5429 | |
| 5430 | |
| 5431 | |
| 5432 | |
| 5433 | |
| 5434 | |
| 5435 | |
| 5436 | |
| 5437 | |
| 5438 | |
| 5439 | |
| 5440 | |
| 5441 | |
| 5442 | |
| 5443 | |
| 5444 | |
| 5445 | |
| 5446 | |
| 5447 | |
| 5448 | |
| 5449 | |
| 5450 | |
| 5451 | |
| 5452 | |
| 5453 | |
| 5454 | |
| 5455 | |
| 5456 | |
| 5457 | |
| 5458 | |
| 5459 | |
| 5460 | |
| 5461 | |
| 5462 | |
| 5463 | |
| 5464 | |
| 5465 | |
| 5466 | |
| 5467 | |
| 5468 | |
| 5469 | |
| 5470 | |
| 5471 | |
| 5472 | |
| 5473 | |
| 5474 | |
| 5475 | /// What a coded transform block leaves behind for the blocks that read it as a |
| 5476 | /// neighbour. |
| 5477 | |
| 5478 | |
| 5479 | |
| 5480 | |
| 5481 | |
| 5482 | |
| 5483 | |
| 5484 | |
| 5485 | /// Writes the payload of a one-tile key frame in which every superblock is |
| 5486 | /// split into 32x32 blocks, each carrying the coefficients `blocks` gives it. |
| 5487 | /// |
| 5488 | /// `blocks` gives one coefficient set per 32x32 block in raster order across |
| 5489 | /// the frame. This is [`sb_coeff_key_frame_tile`] with every superblock split. |
| 5490 | /// |
| 5491 | /// # Errors |
| 5492 | /// As [`sb_coeff_key_frame_tile`], with `blocks` sized for the 32x32 grid. |
| 5493 | |
| 5494 | |
| 5495 | |
| 5496 | |
| 5497 | |
| 5498 | |
| 5499 | |
| 5500 | |
| 5501 | |
| 5502 | |
| 5503 | |
| 5504 | |
| 5505 | |
| 5506 | |
| 5507 | |
| 5508 | |
| 5509 | |
| 5510 | |
| 5511 | |
| 5512 | |
| 5513 | |
| 5514 | |
| 5515 | |
| 5516 | |
| 5517 | |
| 5518 | |
| 5519 | |
| 5520 | |
| 5521 | |
| 5522 | |
| 5523 | /// Lays one plane's coefficient list out over its transform, rejecting the |
| 5524 | /// positions and levels the writer does not code. |
| 5525 | |
| 5526 | |
| 5527 | |
| 5528 | |
| 5529 | |
| 5530 | |
| 5531 | |
| 5532 | |
| 5533 | |
| 5534 | |
| 5535 | |
| 5536 | |
| 5537 | |
| 5538 | |
| 5539 | |
| 5540 | |
| 5541 | |
| 5542 | |
| 5543 | |
| 5544 | |
| 5545 | |
| 5546 | |
| 5547 | |
| 5548 | |
| 5549 | |
| 5550 | |
| 5551 | |
| 5552 | |
| 5553 | |
| 5554 | /// The default scan of a square transform (spec 8.4.2's `Default_Scan_NxN`), |
| 5555 | /// as raster positions in the order they are coded. |
| 5556 | /// |
| 5557 | /// The table is a rule rather than hundreds of pinned numbers: the scan walks |
| 5558 | /// the anti-diagonals of the transform outwards from the origin, each diagonal |
| 5559 | /// from its top-right end on odd diagonals and from its bottom-left end on |
| 5560 | /// even ones. |
| 5561 | |
| 5562 | |
| 5563 | |
| 5564 | |
| 5565 | |
| 5566 | |
| 5567 | |
| 5568 | |
| 5569 | |
| 5570 | |
| 5571 | |
| 5572 | |
| 5573 | |
| 5574 | |
| 5575 | |
| 5576 | /// What one 32x32 luma transform block's levels cost, in bits, priced through |
| 5577 | /// the very CDFs [`write_coeffs`] will write them with -- end-of-block |
| 5578 | /// position, base levels, base range, signs and the Golomb tail all included. |
| 5579 | /// |
| 5580 | /// The mode search calls this before the block's neighbours exist, so the two |
| 5581 | /// neighbour-derived contexts (the block-skip context and the DC sign context) |
| 5582 | /// are taken as zero. Every other context inside the block is exact, because |
| 5583 | /// those are read from the block's own levels. |
| 5584 | /// |
| 5585 | /// The encoder codes 32x32 luma only -- every superblock it emits is split -- |
| 5586 | /// so one table is all the search needs; a second block size would need its |
| 5587 | /// own entry point rather than a size argument, because the table and the scan |
| 5588 | /// have to agree. |
| 5589 | /// What the search paid for every coefficient of `blocks`, in bits: the same |
| 5590 | /// [`coeff_bits`] price the mode search ranked those blocks by, summed over |
| 5591 | /// the blocks that were actually kept. |
| 5592 | /// |
| 5593 | /// The instrument behind `predicted_coeff_bits_track_the_tile_the_writer_wrote` |
| 5594 | /// (lane-av1rd1): the writer codes these levels against a state that has |
| 5595 | /// adapted away from the defaults `coeff_bits` prices with, and against real |
| 5596 | /// neighbour contexts instead of the empty ones, so the sum here and the tile |
| 5597 | /// the writer produced differ by exactly that drift plus the non-coefficient |
| 5598 | /// syntax (partition/mode/skip/mv symbols) the sum leaves out. |
| 5599 | |
| 5600 | |
| 5601 | |
| 5602 | |
| 5603 | |
| 5604 | |
| 5605 | |
| 5606 | |
| 5607 | |
| 5608 | |
| 5609 | pub |
| 5610 | |
| 5611 | |
| 5612 | |
| 5613 | |
| 5614 | |
| 5615 | |
| 5616 | |
| 5617 | |
| 5618 | |
| 5619 | |
| 5620 | |
| 5621 | |
| 5622 | |
| 5623 | |
| 5624 | |
| 5625 | |
| 5626 | |
| 5627 | |
| 5628 | |
| 5629 | pub |
| 5630 | |
| 5631 | |
| 5632 | |
| 5633 | |
| 5634 | |
| 5635 | |
| 5636 | |
| 5637 | |
| 5638 | |
| 5639 | |
| 5640 | |
| 5641 | |
| 5642 | |
| 5643 | |
| 5644 | |
| 5645 | |
| 5646 | |
| 5647 | |
| 5648 | |
| 5649 | |
| 5650 | |
| 5651 | |
| 5652 | |
| 5653 | |
| 5654 | |
| 5655 | |
| 5656 | |
| 5657 | |
| 5658 | |
| 5659 | |
| 5660 | |
| 5661 | |
| 5662 | |
| 5663 | |
| 5664 | |
| 5665 | |
| 5666 | |
| 5667 | |
| 5668 | |
| 5669 | |
| 5670 | |
| 5671 | |
| 5672 | |
| 5673 | |
| 5674 | |
| 5675 | |
| 5676 | |
| 5677 | |
| 5678 | |
| 5679 | |
| 5680 | |
| 5681 | |
| 5682 | |
| 5683 | |
| 5684 | |
| 5685 | |
| 5686 | |
| 5687 | |
| 5688 | |
| 5689 | |
| 5690 | |
| 5691 | |
| 5692 | |
| 5693 | |
| 5694 | |
| 5695 | |
| 5696 | |
| 5697 | |
| 5698 | |
| 5699 | |
| 5700 | |
| 5701 | |
| 5702 | |
| 5703 | |
| 5704 | |
| 5705 | pub |
| 5706 | |
| 5707 | |
| 5708 | |
| 5709 | /// What one transform block's levels cost through the CDFs of `set`, in bits. |
| 5710 | /// |
| 5711 | /// The search runs before the tile is written, so the adapted state the block |
| 5712 | /// will really be coded against does not exist yet: the price is taken against |
| 5713 | /// the defaults every tile starts from, at the frame's own coefficient |
| 5714 | /// q-context (`q_ctx_of(base_q_idx)`, what `Cdfs::new` is given at |
| 5715 | /// `sb_coeff_*_tile` -- lane-av1rd1: this used to be pinned at 2, so two of |
| 5716 | /// the four points of the BD ladder were priced against another quantizer's |
| 5717 | /// tables), and against the contexts a block whose neighbours coded nothing |
| 5718 | /// reads. |
| 5719 | /// |
| 5720 | /// lane-av1skipctx CLOSED that row: `skip_ctx`/`sign_ctx` are the caller's |
| 5721 | /// now, and [`crate::encode::CoefCtxMap`] -- a per-plane, per-4x4-cell map |
| 5722 | /// committed in coding order and undone with a losing partition trial's |
| 5723 | /// pixels -- is the per-trial neighbour state the previous lane said the |
| 5724 | /// search did not have. The census (6 frames of each clip at 640x384, q=100, |
| 5725 | /// `pricer_error_census_on_clips`) moved: |
| 5726 | /// |
| 5727 | /// | row | before | after | |
| 5728 | /// |---|---|---| |
| 5729 | /// | screen total | +10.3% | +9.5% | |
| 5730 | /// | screen Chroma8 nz=0 | -73.0% | -1.9% | |
| 5731 | /// | screen Chroma16 nz=0 | -48% | -23.4% | |
| 5732 | /// | screen Chroma4 nz=0 | -74% | -6.7% | |
| 5733 | /// | screen Chroma8 nz=1 / nz=2 | +32.2% / +26.2% | +4.9% / +7.9% | |
| 5734 | /// | screen Luma4 nz=0 | +464% | +89.5% | |
| 5735 | /// | film total | +5.3% | +1.5% | |
| 5736 | /// |
| 5737 | /// What is left in the all-zero rows is table ADAPTATION, not context: the |
| 5738 | /// price is taken against the frame's starting tables, and a frame whose |
| 5739 | /// blocks mostly code nothing narrows `txb_skip` far below where it started. |
| 5740 | /// A whole-block luma transform still reads context 0 -- that is what the |
| 5741 | /// writer codes (`write_luma_tus`, `n == 1`), not an approximation. |
| 5742 | /// The default scan of one transform size, built once per size: the search |
| 5743 | /// prices thirteen modes for every block, and the scan is the same table |
| 5744 | /// every time. |
| 5745 | |
| 5746 | |
| 5747 | |
| 5748 | |
| 5749 | |
| 5750 | |
| 5751 | |
| 5752 | |
| 5753 | |
| 5754 | |
| 5755 | |
| 5756 | |
| 5757 | |
| 5758 | |
| 5759 | |
| 5760 | |
| 5761 | |
| 5762 | /// [`scan_of`]'s `TX_CLASS_HORIZ`/`TX_CLASS_VERT` sibling (lane-txw): the |
| 5763 | /// `Mrow_Scan`/`Mcol_Scan` a `V_DCT`/`H_DCT` unit is coded in, built off the |
| 5764 | /// DECODER's own table so the two cannot drift, cached per size and class. |
| 5765 | |
| 5766 | |
| 5767 | |
| 5768 | |
| 5769 | |
| 5770 | |
| 5771 | |
| 5772 | |
| 5773 | |
| 5774 | |
| 5775 | |
| 5776 | |
| 5777 | |
| 5778 | |
| 5779 | |
| 5780 | |
| 5781 | |
| 5782 | |
| 5783 | |
| 5784 | |
| 5785 | /// [`coeff_bits_typed`] at `DCT_DCT`, the only type the test-only pricers |
| 5786 | /// ([`predicted_coeff_bits`]) model. |
| 5787 | |
| 5788 | pub |
| 5789 | |
| 5790 | |
| 5791 | |
| 5792 | |
| 5793 | |
| 5794 | |
| 5795 | |
| 5796 | |
| 5797 | |
| 5798 | /// What levels a named transform type produced cost: the `tx_type` |
| 5799 | /// symbol is part of what the block spends, so a search comparing types has |
| 5800 | /// to see each one's own symbol priced (lane-txset). |
| 5801 | pub |
| 5802 | |
| 5803 | |
| 5804 | |
| 5805 | |
| 5806 | |
| 5807 | |
| 5808 | |
| 5809 | |
| 5810 | |
| 5811 | |
| 5812 | |
| 5813 | |
| 5814 | |
| 5815 | |
| 5816 | |
| 5817 | |
| 5818 | |
| 5819 | |
| 5820 | |
| 5821 | |
| 5822 | |
| 5823 | |
| 5824 | |
| 5825 | |
| 5826 | |
| 5827 | |
| 5828 | |
| 5829 | |
| 5830 | |
| 5831 | |
| 5832 | |
| 5833 | |
| 5834 | |
| 5835 | |
| 5836 | |
| 5837 | |
| 5838 | |
| 5839 | |
| 5840 | |
| 5841 | |
| 5842 | |
| 5843 | |
| 5844 | |
| 5845 | |
| 5846 | |
| 5847 | |
| 5848 | |
| 5849 | |
| 5850 | |
| 5851 | |
| 5852 | |
| 5853 | |
| 5854 | |
| 5855 | |
| 5856 | |
| 5857 | |
| 5858 | |
| 5859 | |
| 5860 | |
| 5861 | |
| 5862 | |
| 5863 | |
| 5864 | |
| 5865 | |
| 5866 | |
| 5867 | |
| 5868 | |
| 5869 | |
| 5870 | |
| 5871 | |
| 5872 | |
| 5873 | |
| 5874 | |
| 5875 | |
| 5876 | |
| 5877 | |
| 5878 | |
| 5879 | /// The largest level [`rdoq`] offers a candidate for, and the most prices it |
| 5880 | /// may spend on one block. `EC_AV1_RDOQ_MAXLEVEL` / `EC_AV1_RDOQ_BUDGET` |
| 5881 | /// sweep them; see [`rdoq`] for why both exist. |
| 5882 | const RDOQ_MAX_LEVEL: u32 = 2; |
| 5883 | const RDOQ_BUDGET: u32 = 24; |
| 5884 | |
| 5885 | |
| 5886 | |
| 5887 | |
| 5888 | |
| 5889 | |
| 5890 | |
| 5891 | |
| 5892 | |
| 5893 | |
| 5894 | |
| 5895 | |
| 5896 | |
| 5897 | |
| 5898 | |
| 5899 | |
| 5900 | |
| 5901 | |
| 5902 | |
| 5903 | |
| 5904 | |
| 5905 | /// Rate-distortion optimised quantisation (lane-rdoq): the pass every |
| 5906 | /// reference encoder runs after the quantiser and this one did not have. |
| 5907 | /// |
| 5908 | /// The deadzone quantiser rounds each coefficient on its own, blind to what |
| 5909 | /// the coded level costs. Every reference decides that per coefficient |
| 5910 | /// against the entropy coder (libaom `av1_optimize_txb`, rav1e |
| 5911 | /// `optimize_txb`): a level is lowered toward zero when the bits it gives |
| 5912 | /// back are worth more than the squared error it adds, which also shortens |
| 5913 | /// the eob when the tail levels go to zero. |
| 5914 | /// |
| 5915 | /// Mirroring rav1e's shape without its incremental cost model: the candidate |
| 5916 | /// set per coefficient is `{level, level - 1, .., 0}` walked one step at a |
| 5917 | /// time in REVERSE scan order (the tail first, so a dropped tail is retried |
| 5918 | /// against the shorter eob it leaves), and each candidate is priced by |
| 5919 | /// re-coding the whole block through [`coeff_bits`] -- the same CDFs, the |
| 5920 | /// same neighbour contexts and the same writer the search already prices |
| 5921 | /// with, so no second cost model can drift from the writer (class |
| 5922 | /// `table-and-reader-move-together`). That costs one `write_coeffs` per |
| 5923 | /// candidate instead of rav1e's table lookup, which is why this is a preset |
| 5924 | /// lever (`crate::speed::RDOQ`) and not unconditional. |
| 5925 | /// |
| 5926 | /// `levels` is the side-strided grid the inverse transform and the writer |
| 5927 | /// will read, `scaled` the pre-rounding `coeff / q` of each position |
| 5928 | /// (`crate::transform::forward_and_quantize_scaled`). `lambda` is the rate |
| 5929 | /// weight in units of ONE SQUARED AC QUANTISER STEP: the search's own |
| 5930 | /// `sse + lambda * bits` is `step^2 * (sum (scaled - level)^2 + LAMBDA_SCALE |
| 5931 | /// * bits)` once the pixel-domain error of a level is written through the |
| 5932 | /// orthonormal transform (`(coeff - level * q) / 8`, `INVERSE_GAIN_RECIPROCAL`), |
| 5933 | /// so `step^2` divides out of every comparison here and the DC's different |
| 5934 | /// quantiser is the only per-position weight left. |
| 5935 | /// |
| 5936 | /// Returns what the block's levels cost after the pass, so the caller prices |
| 5937 | /// the tile it will actually write and never the pre-RDOQ grid. |
| 5938 | |
| 5939 | pub |
| 5940 | |
| 5941 | |
| 5942 | |
| 5943 | |
| 5944 | |
| 5945 | |
| 5946 | |
| 5947 | |
| 5948 | |
| 5949 | |
| 5950 | |
| 5951 | |
| 5952 | |
| 5953 | |
| 5954 | |
| 5955 | |
| 5956 | |
| 5957 | |
| 5958 | |
| 5959 | |
| 5960 | |
| 5961 | |
| 5962 | |
| 5963 | |
| 5964 | |
| 5965 | |
| 5966 | |
| 5967 | |
| 5968 | |
| 5969 | |
| 5970 | |
| 5971 | |
| 5972 | |
| 5973 | |
| 5974 | |
| 5975 | |
| 5976 | |
| 5977 | |
| 5978 | |
| 5979 | |
| 5980 | |
| 5981 | |
| 5982 | |
| 5983 | |
| 5984 | |
| 5985 | |
| 5986 | |
| 5987 | |
| 5988 | |
| 5989 | |
| 5990 | |
| 5991 | |
| 5992 | |
| 5993 | |
| 5994 | |
| 5995 | |
| 5996 | |
| 5997 | |
| 5998 | |
| 5999 | |
| 6000 | |
| 6001 | |
| 6002 | |
| 6003 | |
| 6004 | |
| 6005 | |
| 6006 | |
| 6007 | |
| 6008 | |
| 6009 | |
| 6010 | |
| 6011 | |
| 6012 | |
| 6013 | |
| 6014 | |
| 6015 | |
| 6016 | |
| 6017 | |
| 6018 | |
| 6019 | |
| 6020 | |
| 6021 | |
| 6022 | |
| 6023 | |
| 6024 | |
| 6025 | |
| 6026 | |
| 6027 | |
| 6028 | |
| 6029 | |
| 6030 | |
| 6031 | |
| 6032 | |
| 6033 | |
| 6034 | |
| 6035 | |
| 6036 | |
| 6037 | |
| 6038 | |
| 6039 | |
| 6040 | |
| 6041 | |
| 6042 | |
| 6043 | |
| 6044 | |
| 6045 | |
| 6046 | |
| 6047 | |
| 6048 | /// blocks, coded coefficients, +-1 levels, trailing +-1 levels (a run of them |
| 6049 | /// at the end of the scan), zeroed coefficients, lowered coefficients, bits |
| 6050 | /// after the pass * 64, bits before the pass * 64. |
| 6051 | pub static RDOQ_STATS: = |
| 6052 | |
| 6053 | |
| 6054 | ; |
| 6055 | |
| 6056 | /// The pre-pass half of [`RDOQ_STATS`] (`EC_AV1_RDOQ_CENSUS`): what the |
| 6057 | /// quantiser handed the pass, which is the instrument for how much is at |
| 6058 | /// stake before any decision is taken. |
| 6059 | |
| 6060 | |
| 6061 | |
| 6062 | |
| 6063 | |
| 6064 | |
| 6065 | |
| 6066 | |
| 6067 | |
| 6068 | |
| 6069 | |
| 6070 | |
| 6071 | |
| 6072 | |
| 6073 | |
| 6074 | |
| 6075 | |
| 6076 | |
| 6077 | /// Reads and clears [`RDOQ_STATS`]. |
| 6078 | |
| 6079 | |
| 6080 | |
| 6081 | |
| 6082 | thread_local! |
| 6083 | |
| 6084 | |
| 6085 | |
| 6086 | |
| 6087 | |
| 6088 | |
| 6089 | |
| 6090 | |
| 6091 | |
| 6092 | |
| 6093 | |
| 6094 | /// Arms the tables [`coeff_bits`] prices against on this thread: the state |
| 6095 | /// this frame's tile writer starts from. `None` goes back to the per-q-context |
| 6096 | /// defaults (a key frame, whose writer really does start there), and so does |
| 6097 | /// any frame the screen detector said yes to (`screen`). |
| 6098 | /// |
| 6099 | /// ON by default for non-screen frames since lane-av1price2; |
| 6100 | /// `EC_AV1_PRICE_FRAME_CDFS` selects 0 = never (the pre-lane behaviour), |
| 6101 | /// 1 = always, unset/2 = the screen-gated default. |
| 6102 | /// |
| 6103 | /// Pricing against the frame's REAL starting tables is the more accurate |
| 6104 | /// estimate by measurement -- the pricer census |
| 6105 | /// (`pricer_error_census_by_block_class`) goes from +7.6% to +4.8% over every |
| 6106 | /// transform block, and the one- and two-coefficient inter blocks the search |
| 6107 | /// lives on from +31.4%/+22.3% to +3.1%/+3.6% -- but the accuracy only |
| 6108 | /// converts into ladder bytes on camera content. Measured on ONE build |
| 6109 | /// (lane-av1price2, mode 0 vs mode 2), BD-rate vs libaom / vs rav1e: |
| 6110 | /// |
| 6111 | /// | clip | 640x384 base | 640x384 gated | native base | native gated | |
| 6112 | /// |---|---|---|---|---| |
| 6113 | /// | film 1080p | +79.9 / +37.3 | +78.8 / +36.1 | +18.7 / +1.4 | +18.0 / +0.7 | |
| 6114 | /// | film 2160p | +94.6 / +55.7 | +95.1 / +56.4 | +48.1 / +19.8 | +47.3 / +19.2 | |
| 6115 | /// | screen | +54.5 / +1.1 | +54.5 / +1.1 | +59.4 / -10.0 | +59.4 / -10.0 | |
| 6116 | /// |
| 6117 | /// The screen rows are not merely close, they are byte-identical (the ladders |
| 6118 | /// print 8832/13507/18772/24754 and 39312/52829/70719/92134 in both modes): |
| 6119 | /// the gate is per frame and the detector fires on 48 of 48 screen frames, so |
| 6120 | /// no screen frame is ever armed with anything but the defaults. At native |
| 6121 | /// resolution -- the resolution his library is in -- both films come down |
| 6122 | /// against both references and the screen capture is flat, which is this |
| 6123 | /// lane's keep rule. At the downscaled 640x384 gate the 2160p film goes the |
| 6124 | /// other way (+0.5/+0.7) while the 1080p one comes down further (-1.1/-1.2); |
| 6125 | /// the downscale is the same recipe that exaggerated the frame pyramid's loss |
| 6126 | /// sixfold, so the native table decides and the 640x384 2160p regression is |
| 6127 | /// recorded here rather than argued away. |
| 6128 | /// |
| 6129 | /// Why the screen capture needs the gate at all is in the census |
| 6130 | /// (`pricer_error_census_on_clips`, 6 frames of each clip at 640x384, q=100). |
| 6131 | /// Real tables take the film clip's total pricer error from +7.8% to +5.3% |
| 6132 | /// and flatten its inter classes outright (Luma8Inter/Luma16Inter/Luma32Inter |
| 6133 | /// 1-coefficient rows from +11.7%/+17.4%/+24.9% to -0.3%/-5.5%/+8.8%). On the |
| 6134 | /// screen capture the total only moves +12.8% -> +10.3%, because the classes |
| 6135 | /// that dominate a screen frame are not the ones the tables fix: its chroma |
| 6136 | /// stays over-priced (Chroma8 nz=1 +32.2% -> +31.8%, nz=2 +26.2% -> +26.2%, |
| 6137 | /// unmoved) and its all-zero blocks stay hugely UNDER-priced (Chroma8 nz=0 |
| 6138 | /// -73.0% -> -73.0%, Luma4 nz=0 +464% -> +467% -- both a pricer that assumes |
| 6139 | /// `skip_ctx` 0, not a table set). So on screen the change makes the inter |
| 6140 | /// luma price accurate while leaving the bigger chroma and all-zero errors |
| 6141 | /// exactly where they were, which SKEWS the search's tradeoffs between them |
| 6142 | /// instead of correcting them -- and the bytes get worse. The fix for that |
| 6143 | /// row was the neighbour skip context, not another table set, and |
| 6144 | /// lane-av1skipctx landed it (see [`coeff_bits`]): with the real contexts |
| 6145 | /// under every price the screen capture comes down +59.4 -> +58.3 vs libaom |
| 6146 | /// at native, still with every one of its frames armed with the defaults. |
| 6147 | pub |
| 6148 | |
| 6149 | |
| 6150 | |
| 6151 | |
| 6152 | |
| 6153 | |
| 6154 | |
| 6155 | |
| 6156 | |
| 6157 | |
| 6158 | |
| 6159 | |
| 6160 | |
| 6161 | |
| 6162 | |
| 6163 | |
| 6164 | |
| 6165 | /// How many times a frame's search was armed with the DEFAULT tables and how |
| 6166 | /// many with the frame's REAL starting tables ([`arm_pricing_cdfs`]), so a |
| 6167 | /// gate can print which side of the screen gate every frame landed on. Counts |
| 6168 | /// arming calls, not frames: a multi-tile frame arms one worker per tile. |
| 6169 | pub static PRICING_HITS: = |
| 6170 | ; |
| 6171 | |
| 6172 | /// Reads and clears [`PRICING_HITS`]: (default-table armings, real-table |
| 6173 | /// armings). |
| 6174 | |
| 6175 | pub |
| 6176 | |
| 6177 | |
| 6178 | |
| 6179 | |
| 6180 | |
| 6181 | |
| 6182 | /// The pricer census (`pricer_census_on`): for every transform block the tile |
| 6183 | /// writer really codes, the bits it spent against the bits [`coeff_bits`] |
| 6184 | /// prices those very levels at -- the search's rate term measured against the |
| 6185 | /// rate it is meant to predict. Keyed by (table set, non-zero bucket) so a |
| 6186 | /// class that is systematically mispriced (all-zero blocks' `txb_skip`, the |
| 6187 | /// eob of a one-coefficient block, a whole size) shows up on its own row |
| 6188 | /// rather than inside one average. |
| 6189 | /// Thread-local, so a census cannot pick up the blocks of another test's |
| 6190 | /// encode running beside it; a multi-tile, multi-threaded encode would |
| 6191 | /// therefore only census the tiles this thread wrote, which is every tile of |
| 6192 | /// the one-tile-one-thread encodes the gates print it from. |
| 6193 | |
| 6194 | type CensusRows = ; |
| 6195 | |
| 6196 | thread_local! |
| 6197 | |
| 6198 | |
| 6199 | |
| 6200 | /// Starts a census on this thread, discarding anything a previous one left. |
| 6201 | |
| 6202 | pub |
| 6203 | |
| 6204 | |
| 6205 | |
| 6206 | /// Stops the census and hands back its rows: (set, non-zero bucket) -> |
| 6207 | /// (blocks, priced bits, written bits). |
| 6208 | |
| 6209 | pub |
| 6210 | |
| 6211 | |
| 6212 | |
| 6213 | /// The label of a non-zero bucket, for the tables the gates print. |
| 6214 | |
| 6215 | pub |
| 6216 | |
| 6217 | |
| 6218 | |
| 6219 | |
| 6220 | |
| 6221 | |
| 6222 | |
| 6223 | |
| 6224 | |
| 6225 | |
| 6226 | |
| 6227 | |
| 6228 | |
| 6229 | |
| 6230 | |
| 6231 | |
| 6232 | |
| 6233 | |
| 6234 | |
| 6235 | |
| 6236 | |
| 6237 | |
| 6238 | |
| 6239 | |
| 6240 | |
| 6241 | |
| 6242 | |
| 6243 | |
| 6244 | |
| 6245 | |
| 6246 | |
| 6247 | |
| 6248 | |
| 6249 | |
| 6250 | |
| 6251 | |
| 6252 | |
| 6253 | |
| 6254 | |
| 6255 | /// What the partition symbol of a block of `side` samples costs, in bits, when |
| 6256 | /// it says the block is split (or that it is not). |
| 6257 | /// |
| 6258 | /// The price is taken at context zero — a block whose neighbours are no finer |
| 6259 | /// than it is — because the search that reads it runs before the tile knows |
| 6260 | /// what its neighbours will be. |
| 6261 | pub |
| 6262 | |
| 6263 | |
| 6264 | |
| 6265 | |
| 6266 | |
| 6267 | |
| 6268 | |
| 6269 | |
| 6270 | |
| 6271 | |
| 6272 | |
| 6273 | |
| 6274 | |
| 6275 | |
| 6276 | |
| 6277 | |
| 6278 | |
| 6279 | |
| 6280 | |
| 6281 | |
| 6282 | /// lane-b128hv: [`partition_bits`] for any partition symbol, at the same |
| 6283 | /// fixed (round-2) tables -- what the 128 root's HORZ/VERT candidate is priced |
| 6284 | /// with (`PARTITION_HORZ` = 1, `PARTITION_VERT` = 2). |
| 6285 | pub |
| 6286 | |
| 6287 | |
| 6288 | |
| 6289 | |
| 6290 | |
| 6291 | |
| 6292 | |
| 6293 | |
| 6294 | |
| 6295 | |
| 6296 | |
| 6297 | |
| 6298 | /// coeffs() for one plane's transform block of any coefficients the base and |
| 6299 | /// base-range syntax reach (spec 5.11.39). |
| 6300 | /// |
| 6301 | /// A 16x16 luma transform codes which transform type it is, because its set |
| 6302 | /// holds more than one; 32x32 and 64x64 are DCT-only by spec 5.11.40. The |
| 6303 | /// levels the contexts below are read from are the levels of |
| 6304 | /// coefficients later in the scan, which a decoder walking the scan backwards |
| 6305 | /// already has. |
| 6306 | |
| 6307 | |
| 6308 | |
| 6309 | |
| 6310 | |
| 6311 | |
| 6312 | |
| 6313 | |
| 6314 | |
| 6315 | |
| 6316 | |
| 6317 | |
| 6318 | |
| 6319 | |
| 6320 | |
| 6321 | |
| 6322 | |
| 6323 | |
| 6324 | |
| 6325 | |
| 6326 | |
| 6327 | |
| 6328 | |
| 6329 | |
| 6330 | |
| 6331 | |
| 6332 | |
| 6333 | |
| 6334 | |
| 6335 | |
| 6336 | |
| 6337 | |
| 6338 | |
| 6339 | |
| 6340 | |
| 6341 | |
| 6342 | |
| 6343 | |
| 6344 | |
| 6345 | |
| 6346 | |
| 6347 | |
| 6348 | |
| 6349 | |
| 6350 | |
| 6351 | |
| 6352 | |
| 6353 | |
| 6354 | |
| 6355 | |
| 6356 | |
| 6357 | |
| 6358 | |
| 6359 | |
| 6360 | |
| 6361 | |
| 6362 | |
| 6363 | |
| 6364 | |
| 6365 | |
| 6366 | |
| 6367 | |
| 6368 | |
| 6369 | |
| 6370 | |
| 6371 | |
| 6372 | |
| 6373 | |
| 6374 | |
| 6375 | |
| 6376 | |
| 6377 | |
| 6378 | |
| 6379 | |
| 6380 | |
| 6381 | |
| 6382 | |
| 6383 | |
| 6384 | |
| 6385 | |
| 6386 | |
| 6387 | |
| 6388 | |
| 6389 | |
| 6390 | |
| 6391 | |
| 6392 | |
| 6393 | |
| 6394 | |
| 6395 | |
| 6396 | |
| 6397 | |
| 6398 | |
| 6399 | |
| 6400 | |
| 6401 | |
| 6402 | |
| 6403 | |
| 6404 | |
| 6405 | |
| 6406 | |
| 6407 | |
| 6408 | |
| 6409 | |
| 6410 | |
| 6411 | |
| 6412 | |
| 6413 | |
| 6414 | |
| 6415 | |
| 6416 | |
| 6417 | |
| 6418 | |
| 6419 | |
| 6420 | |
| 6421 | |
| 6422 | |
| 6423 | |
| 6424 | |
| 6425 | |
| 6426 | |
| 6427 | |
| 6428 | |
| 6429 | |
| 6430 | |
| 6431 | |
| 6432 | |
| 6433 | |
| 6434 | |
| 6435 | |
| 6436 | |
| 6437 | |
| 6438 | |
| 6439 | |
| 6440 | |
| 6441 | |
| 6442 | |
| 6443 | |
| 6444 | |
| 6445 | |
| 6446 | |
| 6447 | |
| 6448 | |
| 6449 | |
| 6450 | |
| 6451 | |
| 6452 | |
| 6453 | |
| 6454 | |
| 6455 | |
| 6456 | |
| 6457 | |
| 6458 | |
| 6459 | |
| 6460 | |
| 6461 | |
| 6462 | |
| 6463 | |
| 6464 | |
| 6465 | |
| 6466 | |
| 6467 | |
| 6468 | |
| 6469 | |
| 6470 | |
| 6471 | |
| 6472 | |
| 6473 | |
| 6474 | |
| 6475 | |
| 6476 | |
| 6477 | |
| 6478 | |
| 6479 | |
| 6480 | |
| 6481 | |
| 6482 | |
| 6483 | /// The end-of-block position (spec 5.11.39): which group of scan positions the |
| 6484 | /// last coded coefficient falls in, then its offset inside that group — the |
| 6485 | /// offset's top bit from a CDF and the rest as raw bits. |
| 6486 | |
| 6487 | |
| 6488 | |
| 6489 | |
| 6490 | |
| 6491 | |
| 6492 | |
| 6493 | |
| 6494 | |
| 6495 | |
| 6496 | |
| 6497 | |
| 6498 | |
| 6499 | |
| 6500 | |
| 6501 | |
| 6502 | |
| 6503 | |
| 6504 | |
| 6505 | |
| 6506 | |
| 6507 | |
| 6508 | |
| 6509 | |
| 6510 | |
| 6511 | |
| 6512 | |
| 6513 | |
| 6514 | |
| 6515 | |
| 6516 | |
| 6517 | |
| 6518 | |
| 6519 | |
| 6520 | |
| 6521 | |
| 6522 | |
| 6523 | |
| 6524 | |
| 6525 | |
| 6526 | |
| 6527 | |
| 6528 | |
| 6529 | |
| 6530 | |
| 6531 | |
| 6532 | |
| 6533 | |
| 6534 | |
| 6535 | |
| 6536 | |
| 6537 | |
| 6538 | |
| 6539 | |
| 6540 | |
| 6541 | |
| 6542 | |
| 6543 | |
| 6544 | |
| 6545 | |
| 6546 | |
| 6547 | |
| 6548 | |
| 6549 | |
| 6550 | /// Writes the remainder of a level the base and base-range syntax could not |
| 6551 | /// reach (spec 5.11.40): the value plus one, as its bit length in unary |
| 6552 | /// followed by the value's own bits, most significant first. |
| 6553 | pub |
| 6554 | |
| 6555 | |
| 6556 | |
| 6557 | |
| 6558 | |
| 6559 | |
| 6560 | |
| 6561 | |
| 6562 | |
| 6563 | |
| 6564 | /// The context of the level of the last coded coefficient (spec 8.3.2): how |
| 6565 | /// far into the scan it sits, in quarters and eighths of the transform. |
| 6566 | |
| 6567 | |
| 6568 | |
| 6569 | |
| 6570 | |
| 6571 | |
| 6572 | |
| 6573 | |
| 6574 | |
| 6575 | /// The context of a coefficient's level (spec 8.3.2): the magnitudes of the |
| 6576 | /// five neighbours below and to the right of it — the ones a decoder walking |
| 6577 | /// the scan backwards already has — plus a term for where in the transform it |
| 6578 | /// sits. The DC reads context 0 whatever its neighbours carry. |
| 6579 | |
| 6580 | |
| 6581 | |
| 6582 | |
| 6583 | |
| 6584 | |
| 6585 | |
| 6586 | |
| 6587 | |
| 6588 | |
| 6589 | |
| 6590 | |
| 6591 | |
| 6592 | |
| 6593 | |
| 6594 | |
| 6595 | |
| 6596 | |
| 6597 | |
| 6598 | |
| 6599 | |
| 6600 | |
| 6601 | |
| 6602 | |
| 6603 | |
| 6604 | |
| 6605 | |
| 6606 | |
| 6607 | |
| 6608 | |
| 6609 | |
| 6610 | |
| 6611 | |
| 6612 | |
| 6613 | |
| 6614 | |
| 6615 | |
| 6616 | |
| 6617 | |
| 6618 | |
| 6619 | |
| 6620 | |
| 6621 | |
| 6622 | |
| 6623 | |
| 6624 | |
| 6625 | |
| 6626 | |
| 6627 | |
| 6628 | /// The context of a coefficient's base-range tail (spec 8.3.2): the magnitudes |
| 6629 | /// of its three closest neighbours below and to the right, uncapped, and a |
| 6630 | /// term separating the DC, the corner of the transform, and the rest. |
| 6631 | |
| 6632 | |
| 6633 | |
| 6634 | |
| 6635 | |
| 6636 | |
| 6637 | |
| 6638 | |
| 6639 | |
| 6640 | |
| 6641 | |
| 6642 | |
| 6643 | |
| 6644 | |
| 6645 | |
| 6646 | |
| 6647 | |
| 6648 | |
| 6649 | |
| 6650 | |
| 6651 | |
| 6652 | |
| 6653 | |
| 6654 | |
| 6655 | |
| 6656 | |
| 6657 | |
| 6658 | |
| 6659 | |
| 6660 | |
| 6661 | |
| 6662 | |
| 6663 | |
| 6664 | |
| 6665 | |
| 6666 | |
| 6667 | |
| 6668 | |
| 6669 | |
| 6670 | |
| 6671 | |
| 6672 | |
| 6673 | |
| 6674 | /// A level at a position that may fall off the transform, where the levels a |
| 6675 | /// context reads are zero. |
| 6676 | |
| 6677 | |
| 6678 | |
| 6679 | |
| 6680 | |
| 6681 | |
| 6682 | |
| 6683 | |
| 6684 | /// Shared by both DC writers: one level per block, none of them zero. |
| 6685 | |
| 6686 | |
| 6687 | |
| 6688 | |
| 6689 | |
| 6690 | |
| 6691 | |
| 6692 | |
| 6693 | |
| 6694 | |
| 6695 | |
| 6696 | |
| 6697 | |
| 6698 | |
| 6699 | |
| 6700 | |
| 6701 | |
| 6702 | /// coeffs() for a luma transform block whose only coefficient is the DC (spec |
| 6703 | /// 5.11.39). The block size is the transform size, so the all-zero flag's |
| 6704 | /// context is 0; an end-of-block of one is token 0 of the position alphabet |
| 6705 | /// with no extra bits; the transform sizes here are all DCT-only, so no |
| 6706 | /// transform type is coded; and the DC's own neighbours are zero, so its |
| 6707 | /// magnitude contexts are 0 throughout. |
| 6708 | |
| 6709 | |
| 6710 | |
| 6711 | |
| 6712 | |
| 6713 | |
| 6714 | |
| 6715 | |
| 6716 | |
| 6717 | |
| 6718 | |
| 6719 | |
| 6720 | |
| 6721 | |
| 6722 | |
| 6723 | |
| 6724 | |
| 6725 | |
| 6726 | |
| 6727 | |
| 6728 | |
| 6729 | |
| 6730 | |
| 6731 | |
| 6732 | |
| 6733 | |
| 6734 | |
| 6735 | |
| 6736 | |
| 6737 | |
| 6738 | |
| 6739 | |
| 6740 | |
| 6741 | |
| 6742 | |
| 6743 | |
| 6744 | |
| 6745 | |
| 6746 | |
| 6747 | |
| 6748 | |
| 6749 | |
| 6750 | |
| 6751 | |
| 6752 | /// One 4x4 unit's vote in `Dc_Sign_Contexts` (spec 8.3.2): plus one for a |
| 6753 | /// positive DC, minus one for a negative one, nothing for a unit whose block |
| 6754 | /// carried no DC or that sits past the frame's true edge (spec |
| 6755 | /// `av1_set_entropy_contexts`), which is why the vote is gathered per 4x4 |
| 6756 | /// unit and not per coded cell -- a unit past the edge does not vote even |
| 6757 | /// when the rest of its cell does. |
| 6758 | |
| 6759 | |
| 6760 | |
| 6761 | |
| 6762 | |
| 6763 | |
| 6764 | |
| 6765 | |
| 6766 | /// Which of the three DC sign contexts a gathered vote picks. |
| 6767 | |
| 6768 | |
| 6769 | |
| 6770 | |
| 6771 | |
| 6772 | |
| 6773 | |
| 6774 | |
| 6775 | /// The `is_inter` context (spec 5.11.16 via `av1_get_intra_inter_context`, |
| 6776 | /// `pred_common.c`): both neighbours' intra/inter state when both are |
| 6777 | /// available, one neighbour's when only one is, and zero at a tile's own |
| 6778 | /// top-left corner. |
| 6779 | pub |
| 6780 | |
| 6781 | |
| 6782 | |
| 6783 | |
| 6784 | |
| 6785 | |
| 6786 | |
| 6787 | |
| 6788 | |
| 6789 | |
| 6790 | |
| 6791 | |
| 6792 | |
| 6793 | |
| 6794 | |
| 6795 | |
| 6796 | |
| 6797 | |
| 6798 | |
| 6799 | |
| 6800 | /// `CLASS0_SIZE << (class + 2)` (spec 3), the magnitude an `MV_CLASS_n` |
| 6801 | /// component's own bits start counting from; class zero starts at zero. |
| 6802 | |
| 6803 | |
| 6804 | |
| 6805 | |
| 6806 | /// The class a pre-offset magnitude `z` (`|diff| - 1`) falls in — the inverse |
| 6807 | /// of `mv_class_base`'s doubling ranges, ported from libaom's |
| 6808 | /// `av1_get_mv_class` (`mv.h`). |
| 6809 | |
| 6810 | |
| 6811 | |
| 6812 | |
| 6813 | |
| 6814 | |
| 6815 | |
| 6816 | |
| 6817 | /// Writes one motion vector component's non-zero diff (spec 5.11.32 |
| 6818 | /// `read_mv_component`, run backwards): sign, class, then the class's own |
| 6819 | /// bits, and (lane-hpmv) the eighth-pel bit when the frame armed through |
| 6820 | /// [`arm_high_precision_mv`] carries `allow_high_precision_mv`. Without that |
| 6821 | /// flag the eighth-pel bit is inferred as one rather than coded, so only |
| 6822 | /// diffs whose eighth-pel bit really is one are representable; anything else |
| 6823 | /// is refused rather than rounded, since rounding would silently code a |
| 6824 | /// different vector than the caller asked for. |
| 6825 | /// |
| 6826 | /// # Errors |
| 6827 | /// Returns an error when `diff` needs eighth-pel precision in a frame coded |
| 6828 | /// without `allow_high_precision_mv`. |
| 6829 | |
| 6830 | |
| 6831 | |
| 6832 | |
| 6833 | |
| 6834 | |
| 6835 | |
| 6836 | |
| 6837 | |
| 6838 | |
| 6839 | |
| 6840 | |
| 6841 | |
| 6842 | |
| 6843 | |
| 6844 | |
| 6845 | |
| 6846 | |
| 6847 | |
| 6848 | |
| 6849 | |
| 6850 | |
| 6851 | |
| 6852 | |
| 6853 | |
| 6854 | |
| 6855 | |
| 6856 | |
| 6857 | |
| 6858 | |
| 6859 | |
| 6860 | |
| 6861 | |
| 6862 | |
| 6863 | |
| 6864 | |
| 6865 | |
| 6866 | |
| 6867 | |
| 6868 | |
| 6869 | |
| 6870 | |
| 6871 | |
| 6872 | |
| 6873 | |
| 6874 | |
| 6875 | |
| 6876 | |
| 6877 | |
| 6878 | /// Writes a motion vector as a residual against `pred` (spec 5.11.32 |
| 6879 | /// `read_mv`): the joint symbol naming which components differ, then each |
| 6880 | /// differing component. |
| 6881 | |
| 6882 | |
| 6883 | |
| 6884 | |
| 6885 | |
| 6886 | |
| 6887 | |
| 6888 | |
| 6889 | |
| 6890 | |
| 6891 | |
| 6892 | |
| 6893 | |
| 6894 | |
| 6895 | |
| 6896 | |
| 6897 | |
| 6898 | |
| 6899 | |
| 6900 | |
| 6901 | |
| 6902 | |
| 6903 | |
| 6904 | |
| 6905 | /// What a block leaves in the neighbour reference bands: its own reference, |
| 6906 | /// or `-1` when it is intra (decode.rs `Neighbours::above_ref`'s convention). |
| 6907 | |
| 6908 | |
| 6909 | |
| 6910 | |
| 6911 | /// Writer-side counterpart of decode.rs `read_single_ref` (spec 5.11.25's |
| 6912 | /// `single_ref_p1`..`p6` tree): codes `ref_frame` bit by bit, each symbol at |
| 6913 | /// the context its own `single_ref_p*_ctx` derives from the immediate |
| 6914 | /// above/left neighbours' references -- the same functions the decoder calls, |
| 6915 | /// with `-1` standing for an intra or unavailable neighbour and no second |
| 6916 | /// reference (this writer codes no compound block). |
| 6917 | |
| 6918 | |
| 6919 | |
| 6920 | |
| 6921 | |
| 6922 | |
| 6923 | |
| 6924 | |
| 6925 | |
| 6926 | |
| 6927 | |
| 6928 | |
| 6929 | |
| 6930 | |
| 6931 | |
| 6932 | |
| 6933 | |
| 6934 | |
| 6935 | |
| 6936 | |
| 6937 | |
| 6938 | |
| 6939 | |
| 6940 | |
| 6941 | |
| 6942 | |
| 6943 | |
| 6944 | |
| 6945 | |
| 6946 | |
| 6947 | |
| 6948 | |
| 6949 | |
| 6950 | |
| 6951 | |
| 6952 | |
| 6953 | |
| 6954 | |
| 6955 | |
| 6956 | |
| 6957 | |
| 6958 | |
| 6959 | |
| 6960 | |
| 6961 | |
| 6962 | |
| 6963 | |
| 6964 | |
| 6965 | |
| 6966 | |
| 6967 | |
| 6968 | |
| 6969 | |
| 6970 | |
| 6971 | |
| 6972 | |
| 6973 | |
| 6974 | |
| 6975 | |
| 6976 | /// Per-mode fire counts of [`write_inter_mode`], indexed |
| 6977 | /// `NEARESTMV`/`NEARMV`/`GLOBALMV`/`NEWMV`, and the DRL index each block |
| 6978 | /// coded (bucket 3 collects any index past 2). Read by the BD gate, which |
| 6979 | /// is the only thing that proves a newly added mode ever fires |
| 6980 | /// (gate-blind-to-feature). |
| 6981 | static INTER_MODE_HITS: = |
| 6982 | |
| 6983 | |
| 6984 | |
| 6985 | |
| 6986 | ; |
| 6987 | static DRL_HITS: = |
| 6988 | |
| 6989 | |
| 6990 | |
| 6991 | |
| 6992 | ; |
| 6993 | |
| 6994 | /// One counter per reference name (`LAST`..`ALTREF`), for the gate's own |
| 6995 | /// census of what the encoder actually picks. |
| 6996 | static REF_HITS: = |
| 6997 | |
| 6998 | |
| 6999 | |
| 7000 | |
| 7001 | |
| 7002 | |
| 7003 | |
| 7004 | ; |
| 7005 | |
| 7006 | /// Takes and clears the per-reference histogram. |
| 7007 | |
| 7008 | pub |
| 7009 | |
| 7010 | |
| 7011 | |
| 7012 | /// Bumps the two histograms for one coded inter block. |
| 7013 | /// How many blocks this process wrote whose search-chosen `ref_mv_idx` the |
| 7014 | /// write-time stack could not carry, so the writer signalled a SMALLER index |
| 7015 | /// (lane-sb128b). Every one of these used to price its residual against a |
| 7016 | /// predictor the decoder never derives. |
| 7017 | static DRL_CLAMP_HITS: AtomicUsize = new; |
| 7018 | |
| 7019 | /// Counts one clamped DRL index whose predictor differs from the one the |
| 7020 | /// search asked for -- the harmful case, and the only one a witness can see. |
| 7021 | |
| 7022 | |
| 7023 | |
| 7024 | |
| 7025 | |
| 7026 | |
| 7027 | |
| 7028 | /// Takes and clears [`DRL_CLAMP_HITS`], for a gate's own before/after delta. |
| 7029 | |
| 7030 | pub |
| 7031 | |
| 7032 | |
| 7033 | |
| 7034 | |
| 7035 | |
| 7036 | |
| 7037 | |
| 7038 | |
| 7039 | /// Takes and clears the inter-mode histogram (NEAREST/NEAR/GLOBAL/NEW). |
| 7040 | |
| 7041 | pub |
| 7042 | |
| 7043 | |
| 7044 | |
| 7045 | /// Takes and clears the DRL-index histogram (0, 1, 2, 3+). |
| 7046 | |
| 7047 | pub |
| 7048 | |
| 7049 | |
| 7050 | |
| 7051 | /// Writes the DRL index of one block: the loop the decoder runs (spec |
| 7052 | /// 5.11.24 `read_drl_idx`, decode.rs' two copies at ~26655 and ~26695), one |
| 7053 | /// `drl_mode` bit per stack entry past `start`, `1` to advance and `0` to |
| 7054 | /// stop, at most two bits. `drl_ctx[idx]` is the context between |
| 7055 | /// `entries[idx]` and `entries[idx + 1]`, exactly the pair the bit chooses |
| 7056 | /// between. Returns the index the symbols actually SIGNAL, which is `target` |
| 7057 | /// clamped by the stack (`min(target, start + 2, entries.len() - 1)`): the |
| 7058 | /// decoder derives its predictor from THAT index, so every caller must take |
| 7059 | /// its own base MV from the returned value and not from `target` (lane-sb128b: |
| 7060 | /// a search-chosen `ref_mv_idx` of 2 against a two-entry write-time stack |
| 7061 | /// signalled index 1 and priced the residual against `pred_mv`, and the |
| 7062 | /// decoder's MV silently drifted a whole frame before the drl symbols |
| 7063 | /// desynced). |
| 7064 | /// The DRL index [`write_drl_idx`]'s walk can actually SIGNAL against a stack |
| 7065 | /// of `entries` candidates: at most two `drl_mode` symbols past `start`, and |
| 7066 | /// each one needs a further entry to advance into (spec 5.11.24's |
| 7067 | /// `for (idx = 0; idx < 2; idx++) if (NumMvFound > idx + 1)`). |
| 7068 | /// |
| 7069 | /// A search that offers an index this clamps prices its residual against a |
| 7070 | /// predictor the decoder never derives (lane-sb128b's silent MV drift); the |
| 7071 | /// pricer's own offer set is enumerated against this rule by |
| 7072 | /// `crate::encode::tests::every_drl_index_the_new_mv_pricer_offers_is_one_the_writer_can_signal`. |
| 7073 | pub |
| 7074 | |
| 7075 | |
| 7076 | |
| 7077 | |
| 7078 | |
| 7079 | |
| 7080 | |
| 7081 | |
| 7082 | |
| 7083 | |
| 7084 | |
| 7085 | |
| 7086 | |
| 7087 | |
| 7088 | |
| 7089 | |
| 7090 | |
| 7091 | |
| 7092 | |
| 7093 | |
| 7094 | |
| 7095 | |
| 7096 | |
| 7097 | |
| 7098 | |
| 7099 | |
| 7100 | |
| 7101 | |
| 7102 | |
| 7103 | |
| 7104 | |
| 7105 | |
| 7106 | |
| 7107 | /// Writer-side counterpart of the decoder's single-reference |
| 7108 | /// `read_inter_mode`/`assign_mv` chain (decode.rs ~26645): writes `info`'s |
| 7109 | /// mode symbols against `stack`'s own contexts and, for `NEWMV`, the MV |
| 7110 | /// residual against the DRL-selected predictor. Returns the motion vector |
| 7111 | /// the decoder will derive for the block (what the MI grid must record) and |
| 7112 | /// whether it is `NEWMV`. |
| 7113 | /// |
| 7114 | /// `GLOBALMV` resolves to `(0, 0)` because this encoder writes no global |
| 7115 | /// motion parameters at all, so every `gm_get_motion_vector` the decoder |
| 7116 | /// runs is the identity model's zero vector; a lane that starts writing |
| 7117 | /// real `gm_params` has to feed the same vector in here. |
| 7118 | /// |
| 7119 | /// # Errors |
| 7120 | /// As [`write_mv`]: a `NEWMV` residual needing eighth-pel precision. |
| 7121 | |
| 7122 | |
| 7123 | |
| 7124 | |
| 7125 | |
| 7126 | |
| 7127 | |
| 7128 | |
| 7129 | |
| 7130 | |
| 7131 | |
| 7132 | |
| 7133 | |
| 7134 | |
| 7135 | |
| 7136 | |
| 7137 | |
| 7138 | |
| 7139 | |
| 7140 | |
| 7141 | |
| 7142 | |
| 7143 | |
| 7144 | |
| 7145 | |
| 7146 | |
| 7147 | |
| 7148 | |
| 7149 | |
| 7150 | |
| 7151 | |
| 7152 | |
| 7153 | |
| 7154 | |
| 7155 | |
| 7156 | |
| 7157 | |
| 7158 | |
| 7159 | |
| 7160 | |
| 7161 | |
| 7162 | |
| 7163 | |
| 7164 | |
| 7165 | |
| 7166 | |
| 7167 | |
| 7168 | |
| 7169 | |
| 7170 | |
| 7171 | |
| 7172 | |
| 7173 | |
| 7174 | |
| 7175 | |
| 7176 | |
| 7177 | |
| 7178 | |
| 7179 | /// Writes the payload of a one-tile inter frame built from `blocks`, one |
| 7180 | /// 32x32 block per entry in raster order across the frame — every superblock |
| 7181 | /// is split into its four quadrants the way [`split_coeff_key_frame_tile`] |
| 7182 | /// codes a key frame, because a mixed-size partition tree buys this writer's |
| 7183 | /// gate nothing a flat grid does not already prove: the CDF state, the |
| 7184 | /// neighbour contexts and the single-reference/MV-stack machinery below are |
| 7185 | /// exactly as size-sensitive whether the tree recurses or not, and recursing |
| 7186 | /// it would be undirected scaffolding — see `sb_coeff_key_frame_tile` for |
| 7187 | /// where that tree already lives, ready to graft this block's mode reads |
| 7188 | /// onto once a real partition search needs it. |
| 7189 | /// |
| 7190 | /// A block whose [`BlockCoeffs::inter`] is `Some` is coded inter: `skip`, |
| 7191 | /// then `is_inter`, then a single-reference chain that always names `LAST` |
| 7192 | /// (spec 5.11.25 `single_ref_p1`/`p3`/`p4`, this crate's only reference so |
| 7193 | /// far), then the two-mode `read_inter_mode` chain (spec 5.11.24) and, for |
| 7194 | /// [`InterMode::NewMv`], a DRL index (always zero) and a coded motion vector |
| 7195 | /// residual. A block whose `inter` is `None` codes intra, through the |
| 7196 | /// *inter*-frame intra path (spec 5.11.16's `intra_frame_mode_info` is the |
| 7197 | /// key frame writers' path; this is `inter_frame_mode_info`'s intra branch): |
| 7198 | /// `Y_MODE` by size group rather than `KF_Y_MODE` by neighbour context, since |
| 7199 | /// an inter frame's intra blocks do not read their neighbours' modes. |
| 7200 | /// |
| 7201 | /// # Errors |
| 7202 | /// Returns an error when the frame is not a whole number of 64x64 |
| 7203 | /// superblocks, when `blocks` does not carry exactly one entry per 32x32 |
| 7204 | /// block, when an intra block names a mode a key frame does not code, when a |
| 7205 | /// coefficient sits outside its transform or is one the writer cannot code, |
| 7206 | /// when a `NEWMV` block's motion vector needs eighth-pel precision. |
| 7207 | |
| 7208 | |
| 7209 | |
| 7210 | |
| 7211 | |
| 7212 | |
| 7213 | |
| 7214 | |
| 7215 | |
| 7216 | /// [`sb_coeff_inter_frame_tile`] for a frame header carrying |
| 7217 | /// `tx_mode == TxMode::Select`: every block then codes the transform syntax |
| 7218 | /// [`write_tx_syntax_inter`] writes -- one `txfm_split` flag on an inter |
| 7219 | /// block that carries a residual, a `tx_depth` symbol on an intra one -- and |
| 7220 | /// an intra block whose depth is nonzero codes its luma as several transform |
| 7221 | /// units. With `tx_select` false this writes exactly the stream it always did. |
| 7222 | /// |
| 7223 | /// # Errors |
| 7224 | /// As [`sb_coeff_inter_frame_tile`]. |
| 7225 | |
| 7226 | |
| 7227 | |
| 7228 | |
| 7229 | |
| 7230 | |
| 7231 | |
| 7232 | |
| 7233 | |
| 7234 | |
| 7235 | |
| 7236 | |
| 7237 | |
| 7238 | |
| 7239 | |
| 7240 | |
| 7241 | |
| 7242 | |
| 7243 | |
| 7244 | |
| 7245 | /// [`sb_coeff_inter_frame_tile_tx`] starting from -- and leaving behind -- |
| 7246 | /// the caller's own CDF state; see [`sb_coeff_key_frame_tile_cdfs`]. |
| 7247 | /// |
| 7248 | /// # Errors |
| 7249 | /// As [`sb_coeff_inter_frame_tile_tx`]. |
| 7250 | pub |
| 7251 | |
| 7252 | |
| 7253 | |
| 7254 | |
| 7255 | |
| 7256 | |
| 7257 | |
| 7258 | |
| 7259 | |
| 7260 | |
| 7261 | |
| 7262 | |
| 7263 | |
| 7264 | |
| 7265 | |
| 7266 | |
| 7267 | |
| 7268 | |
| 7269 | |
| 7270 | |
| 7271 | |
| 7272 | |
| 7273 | |
| 7274 | |
| 7275 | |
| 7276 | |
| 7277 | |
| 7278 | |
| 7279 | |
| 7280 | |
| 7281 | |
| 7282 | |
| 7283 | |
| 7284 | |
| 7285 | |
| 7286 | |
| 7287 | |
| 7288 | |
| 7289 | |
| 7290 | |
| 7291 | |
| 7292 | |
| 7293 | |
| 7294 | |
| 7295 | |
| 7296 | |
| 7297 | |
| 7298 | |
| 7299 | |
| 7300 | |
| 7301 | |
| 7302 | |
| 7303 | |
| 7304 | |
| 7305 | |
| 7306 | |
| 7307 | |
| 7308 | |
| 7309 | |
| 7310 | |
| 7311 | |
| 7312 | |
| 7313 | |
| 7314 | |
| 7315 | |
| 7316 | |
| 7317 | |
| 7318 | |
| 7319 | |
| 7320 | |
| 7321 | |
| 7322 | |
| 7323 | |
| 7324 | |
| 7325 | |
| 7326 | |
| 7327 | |
| 7328 | |
| 7329 | |
| 7330 | |
| 7331 | |
| 7332 | |
| 7333 | |
| 7334 | |
| 7335 | |
| 7336 | |
| 7337 | |
| 7338 | |
| 7339 | |
| 7340 | |
| 7341 | |
| 7342 | |
| 7343 | |
| 7344 | |
| 7345 | |
| 7346 | |
| 7347 | |
| 7348 | |
| 7349 | |
| 7350 | |
| 7351 | |
| 7352 | |
| 7353 | |
| 7354 | |
| 7355 | |
| 7356 | |
| 7357 | |
| 7358 | |
| 7359 | |
| 7360 | |
| 7361 | |
| 7362 | |
| 7363 | |
| 7364 | |
| 7365 | |
| 7366 | |
| 7367 | |
| 7368 | |
| 7369 | |
| 7370 | |
| 7371 | |
| 7372 | |
| 7373 | |
| 7374 | |
| 7375 | |
| 7376 | |
| 7377 | |
| 7378 | |
| 7379 | |
| 7380 | |
| 7381 | |
| 7382 | |
| 7383 | |
| 7384 | |
| 7385 | |
| 7386 | |
| 7387 | |
| 7388 | |
| 7389 | |
| 7390 | |
| 7391 | |
| 7392 | |
| 7393 | |
| 7394 | |
| 7395 | |
| 7396 | |
| 7397 | |
| 7398 | |
| 7399 | |
| 7400 | |
| 7401 | |
| 7402 | |
| 7403 | |
| 7404 | |
| 7405 | |
| 7406 | |
| 7407 | |
| 7408 | |
| 7409 | |
| 7410 | |
| 7411 | |
| 7412 | |
| 7413 | |
| 7414 | |
| 7415 | |
| 7416 | |
| 7417 | |
| 7418 | |
| 7419 | |
| 7420 | |
| 7421 | |
| 7422 | |
| 7423 | |
| 7424 | |
| 7425 | |
| 7426 | |
| 7427 | |
| 7428 | |
| 7429 | |
| 7430 | |
| 7431 | |
| 7432 | |
| 7433 | |
| 7434 | |
| 7435 | |
| 7436 | |
| 7437 | |
| 7438 | |
| 7439 | |
| 7440 | |
| 7441 | |
| 7442 | |
| 7443 | |
| 7444 | |
| 7445 | |
| 7446 | |
| 7447 | |
| 7448 | |
| 7449 | |
| 7450 | |
| 7451 | |
| 7452 | |
| 7453 | |
| 7454 | |
| 7455 | |
| 7456 | |
| 7457 | |
| 7458 | |
| 7459 | |
| 7460 | |
| 7461 | |
| 7462 | |
| 7463 | |
| 7464 | |
| 7465 | |
| 7466 | |
| 7467 | |
| 7468 | |
| 7469 | |
| 7470 | |
| 7471 | |
| 7472 | |
| 7473 | |
| 7474 | |
| 7475 | |
| 7476 | |
| 7477 | |
| 7478 | |
| 7479 | |
| 7480 | |
| 7481 | |
| 7482 | |
| 7483 | |
| 7484 | |
| 7485 | |
| 7486 | |
| 7487 | |
| 7488 | |
| 7489 | |
| 7490 | |
| 7491 | |
| 7492 | |
| 7493 | |
| 7494 | |
| 7495 | |
| 7496 | |
| 7497 | |
| 7498 | |
| 7499 | |
| 7500 | |
| 7501 | |
| 7502 | |
| 7503 | |
| 7504 | |
| 7505 | |
| 7506 | |
| 7507 | |
| 7508 | |
| 7509 | |
| 7510 | |
| 7511 | |
| 7512 | |
| 7513 | |
| 7514 | |
| 7515 | |
| 7516 | |
| 7517 | |
| 7518 | |
| 7519 | |
| 7520 | |
| 7521 | |
| 7522 | |
| 7523 | |
| 7524 | |
| 7525 | |
| 7526 | |
| 7527 | |
| 7528 | |
| 7529 | |
| 7530 | |
| 7531 | |
| 7532 | |
| 7533 | |
| 7534 | |
| 7535 | |
| 7536 | |
| 7537 | |
| 7538 | |
| 7539 | |
| 7540 | |
| 7541 | |
| 7542 | |
| 7543 | |
| 7544 | |
| 7545 | |
| 7546 | |
| 7547 | |
| 7548 | |
| 7549 | |
| 7550 | |
| 7551 | |
| 7552 | |
| 7553 | |
| 7554 | |
| 7555 | |
| 7556 | |
| 7557 | |
| 7558 | |
| 7559 | |
| 7560 | |
| 7561 | |
| 7562 | |
| 7563 | |
| 7564 | |
| 7565 | |
| 7566 | |
| 7567 | |
| 7568 | |
| 7569 | |
| 7570 | |
| 7571 | |
| 7572 | |
| 7573 | |
| 7574 | |
| 7575 | |
| 7576 | |
| 7577 | |
| 7578 | |
| 7579 | |
| 7580 | |
| 7581 | |
| 7582 | |
| 7583 | |
| 7584 | |
| 7585 | |
| 7586 | |
| 7587 | |
| 7588 | |
| 7589 | |
| 7590 | |
| 7591 | |
| 7592 | |
| 7593 | |
| 7594 | |
| 7595 | |
| 7596 | |
| 7597 | |
| 7598 | |
| 7599 | |
| 7600 | |
| 7601 | |
| 7602 | |
| 7603 | |
| 7604 | |
| 7605 | |
| 7606 | |
| 7607 | |
| 7608 | |
| 7609 | |
| 7610 | |
| 7611 | |
| 7612 | |
| 7613 | |
| 7614 | |
| 7615 | |
| 7616 | |
| 7617 | |
| 7618 | |
| 7619 | |
| 7620 | |
| 7621 | |
| 7622 | |
| 7623 | |
| 7624 | |
| 7625 | |
| 7626 | |
| 7627 | |
| 7628 | |
| 7629 | |
| 7630 | |
| 7631 | |
| 7632 | |
| 7633 | |
| 7634 | |
| 7635 | |
| 7636 | |
| 7637 | |
| 7638 | |
| 7639 | |
| 7640 | |
| 7641 | |
| 7642 | |
| 7643 | |
| 7644 | |
| 7645 | |
| 7646 | |
| 7647 | |
| 7648 | |
| 7649 | |
| 7650 | |
| 7651 | |
| 7652 | |
| 7653 | |
| 7654 | |
| 7655 | |
| 7656 | |
| 7657 | |
| 7658 | |
| 7659 | |
| 7660 | |
| 7661 | |
| 7662 | |
| 7663 | |
| 7664 | |
| 7665 | |
| 7666 | |
| 7667 | |
| 7668 | |
| 7669 | |
| 7670 | |
| 7671 | |
| 7672 | |
| 7673 | |
| 7674 | |
| 7675 | |
| 7676 | |
| 7677 | |
| 7678 | |
| 7679 | |
| 7680 | |
| 7681 | |
| 7682 | |
| 7683 | |
| 7684 | |
| 7685 | |
| 7686 | |
| 7687 | |
| 7688 | |
| 7689 | |
| 7690 | |
| 7691 | |
| 7692 | |
| 7693 | |
| 7694 | |
| 7695 | |
| 7696 | |
| 7697 | |
| 7698 | |
| 7699 | |
| 7700 | |
| 7701 | |
| 7702 | |
| 7703 | |
| 7704 | |
| 7705 | |
| 7706 | |
| 7707 | |
| 7708 | |
| 7709 | |
| 7710 | |
| 7711 | |
| 7712 | |
| 7713 | |
| 7714 | |
| 7715 | |
| 7716 | |
| 7717 | |
| 7718 | |
| 7719 | |
| 7720 | |
| 7721 | |
| 7722 | |
| 7723 | |
| 7724 | |
| 7725 | |
| 7726 | |
| 7727 | |
| 7728 | |
| 7729 | |
| 7730 | |
| 7731 | |
| 7732 | |
| 7733 | |
| 7734 | |
| 7735 | |
| 7736 | |
| 7737 | |
| 7738 | |
| 7739 | |
| 7740 | |
| 7741 | |
| 7742 | |
| 7743 | |
| 7744 | |
| 7745 | |
| 7746 | |
| 7747 | |
| 7748 | |
| 7749 | |
| 7750 | |
| 7751 | |
| 7752 | |
| 7753 | |
| 7754 | |
| 7755 | |
| 7756 | |
| 7757 | |
| 7758 | |
| 7759 | |
| 7760 | |
| 7761 | |
| 7762 | |
| 7763 | |
| 7764 | |
| 7765 | |
| 7766 | |
| 7767 | |
| 7768 | |
| 7769 | |
| 7770 | |
| 7771 | |
| 7772 | |
| 7773 | |
| 7774 | |
| 7775 | |
| 7776 | |
| 7777 | |
| 7778 | |
| 7779 | |
| 7780 | |
| 7781 | |
| 7782 | |
| 7783 | |
| 7784 | |
| 7785 | |
| 7786 | |
| 7787 | |
| 7788 | |
| 7789 | |
| 7790 | |
| 7791 | |
| 7792 | |
| 7793 | |
| 7794 | |
| 7795 | |
| 7796 | |
| 7797 | |
| 7798 | |
| 7799 | |
| 7800 | |
| 7801 | |
| 7802 | |
| 7803 | |
| 7804 | |
| 7805 | |
| 7806 | |
| 7807 | |
| 7808 | |
| 7809 | |
| 7810 | |
| 7811 | |
| 7812 | |
| 7813 | |
| 7814 | |
| 7815 | |
| 7816 | |
| 7817 | |
| 7818 | |
| 7819 | |
| 7820 | |
| 7821 | |
| 7822 | |
| 7823 | |
| 7824 | |
| 7825 | |
| 7826 | |
| 7827 | |
| 7828 | |
| 7829 | |
| 7830 | |
| 7831 | |
| 7832 | |
| 7833 | |
| 7834 | |
| 7835 | |
| 7836 | |
| 7837 | |
| 7838 | |
| 7839 | |
| 7840 | |
| 7841 | |
| 7842 | |
| 7843 | |
| 7844 | |
| 7845 | |
| 7846 | |
| 7847 | |
| 7848 | |
| 7849 | |
| 7850 | |
| 7851 | |
| 7852 | |
| 7853 | |
| 7854 | |
| 7855 | |
| 7856 | |
| 7857 | |
| 7858 | |
| 7859 | |
| 7860 | |
| 7861 | |
| 7862 | |
| 7863 | |
| 7864 | |
| 7865 | |
| 7866 | |
| 7867 | |
| 7868 | |
| 7869 | |
| 7870 | |
| 7871 | |
| 7872 | |
| 7873 | |
| 7874 | |
| 7875 | |
| 7876 | |
| 7877 | |
| 7878 | |
| 7879 | |
| 7880 | |
| 7881 | |
| 7882 | |
| 7883 | |
| 7884 | |
| 7885 | |
| 7886 | |
| 7887 | |
| 7888 | |
| 7889 | |
| 7890 | |
| 7891 | |
| 7892 | |
| 7893 | |
| 7894 | |
| 7895 | |
| 7896 | |
| 7897 | |
| 7898 | |
| 7899 | |
| 7900 | |
| 7901 | |
| 7902 | |
| 7903 | |
| 7904 | |
| 7905 | |
| 7906 | |
| 7907 | |
| 7908 | |
| 7909 | |
| 7910 | |
| 7911 | |
| 7912 | |
| 7913 | |
| 7914 | |
| 7915 | |
| 7916 | |
| 7917 | |
| 7918 | |
| 7919 | |
| 7920 | |
| 7921 | |
| 7922 | |
| 7923 | |
| 7924 | |
| 7925 | |
| 7926 | |
| 7927 | |
| 7928 | |
| 7929 | |
| 7930 | |
| 7931 | |
| 7932 | |
| 7933 | |
| 7934 | |
| 7935 | |
| 7936 | |
| 7937 | |
| 7938 | |
| 7939 | |
| 7940 | |
| 7941 | |
| 7942 | |
| 7943 | |
| 7944 | |
| 7945 | |
| 7946 | |
| 7947 | |
| 7948 | |
| 7949 | |
| 7950 | |
| 7951 | |
| 7952 | |
| 7953 | |
| 7954 | |
| 7955 | |
| 7956 | |
| 7957 | |
| 7958 | |
| 7959 | |
| 7960 | |
| 7961 | |
| 7962 | |
| 7963 | |
| 7964 | |
| 7965 | |
| 7966 | |
| 7967 | |
| 7968 | |
| 7969 | |
| 7970 | |
| 7971 | |
| 7972 | |
| 7973 | |
| 7974 | |
| 7975 | |
| 7976 | |
| 7977 | |
| 7978 | |
| 7979 | |
| 7980 | |
| 7981 | |
| 7982 | |
| 7983 | |
| 7984 | |
| 7985 | |
| 7986 | |
| 7987 | |
| 7988 | |
| 7989 | |
| 7990 | |
| 7991 | |
| 7992 | |
| 7993 | |
| 7994 | |
| 7995 | |
| 7996 | |
| 7997 | |
| 7998 | |
| 7999 | |
| 8000 | |
| 8001 | |
| 8002 | |
| 8003 | |
| 8004 | |
| 8005 | |
| 8006 | |
| 8007 | |
| 8008 | |
| 8009 | |
| 8010 | |
| 8011 | |
| 8012 | |
| 8013 | |
| 8014 | |
| 8015 | |
| 8016 | |
| 8017 | |
| 8018 | |
| 8019 | |
| 8020 | |
| 8021 | |
| 8022 | |
| 8023 | |
| 8024 | |
| 8025 | |
| 8026 | |
| 8027 | |
| 8028 | |
| 8029 | |
| 8030 | |
| 8031 | |
| 8032 | |
| 8033 | |
| 8034 | |
| 8035 | |
| 8036 | |
| 8037 | |
| 8038 | |
| 8039 | |
| 8040 | |
| 8041 | |
| 8042 | |
| 8043 | |
| 8044 | |
| 8045 | |
| 8046 | |
| 8047 | |
| 8048 | |
| 8049 | |
| 8050 | |
| 8051 | |
| 8052 | |
| 8053 | |
| 8054 | |
| 8055 | |
| 8056 | |
| 8057 | |
| 8058 | |
| 8059 | |
| 8060 | |
| 8061 | |
| 8062 | |
| 8063 | |
| 8064 | |
| 8065 | |
| 8066 | |
| 8067 | |
| 8068 | |
| 8069 | |
| 8070 | |
| 8071 | |
| 8072 | |
| 8073 | |
| 8074 | |
| 8075 | |
| 8076 | |
| 8077 | |
| 8078 | |
| 8079 | |
| 8080 | |
| 8081 | |
| 8082 | |
| 8083 | |
| 8084 | |
| 8085 | |
| 8086 | |
| 8087 | |
| 8088 | |
| 8089 | |
| 8090 | |
| 8091 | |
| 8092 | |
| 8093 | |
| 8094 | |
| 8095 | |
| 8096 | |
| 8097 | |
| 8098 | |
| 8099 | |
| 8100 | |
| 8101 | |
| 8102 | |
| 8103 | |
| 8104 | |
| 8105 | |
| 8106 | |
| 8107 | |
| 8108 | |
| 8109 | |
| 8110 | |
| 8111 | |
| 8112 | |
| 8113 | |
| 8114 | |
| 8115 | |
| 8116 | |
| 8117 | |
| 8118 | |
| 8119 | |
| 8120 | |
| 8121 | |
| 8122 | |
| 8123 | |
| 8124 | |
| 8125 | |
| 8126 | |
| 8127 | |
| 8128 | |
| 8129 | |
| 8130 | |
| 8131 | |
| 8132 | |
| 8133 | |
| 8134 | |
| 8135 | |
| 8136 | |
| 8137 | |
| 8138 | |
| 8139 | |
| 8140 | |
| 8141 | |
| 8142 | |
| 8143 | |
| 8144 | |
| 8145 | |
| 8146 | |
| 8147 | |
| 8148 | |
| 8149 | |
| 8150 | |
| 8151 | |
| 8152 | |
| 8153 | |
| 8154 | |
| 8155 | |
| 8156 | |
| 8157 | |
| 8158 | |
| 8159 | |
| 8160 | |
| 8161 | |
| 8162 | |
| 8163 | |
| 8164 | |
| 8165 | |
| 8166 | |
| 8167 | |
| 8168 | |
| 8169 | |
| 8170 | |
| 8171 | /// Writes one 16x16 leaf a straddling 32x32 quadrant's [`Quadrant::Split`] |
| 8172 | /// splits into: intra (spec `inter_frame_mode_info`'s intra branch, the only |
| 8173 | /// one this writer used to code here) or real inter (`is_inter` coded |
| 8174 | /// `true`), `NEARESTMV` only -- `NEWMV` at this size is this function's |
| 8175 | /// caller's to never build (`Quadrant::Split`'s `BlockCoeffs.inter`) -- same |
| 8176 | /// `single_ref`/mv-stack/DRL symbol chain as the whole-32x32 branch above, |
| 8177 | /// just at this leaf's own 4x4-mi window (`bw4`/`bh4` of 4, not 8) and coded |
| 8178 | /// through [`TxbSet::Luma16Inter`] rather than [`TxbSet::Luma32Inter`]. Its |
| 8179 | /// own `PARTITION_NONE` symbol is already written, same contract as |
| 8180 | /// [`write_block`]. |
| 8181 | |
| 8182 | |
| 8183 | |
| 8184 | |
| 8185 | |
| 8186 | |
| 8187 | |
| 8188 | |
| 8189 | |
| 8190 | |
| 8191 | |
| 8192 | |
| 8193 | |
| 8194 | |
| 8195 | |
| 8196 | |
| 8197 | |
| 8198 | |
| 8199 | |
| 8200 | |
| 8201 | |
| 8202 | |
| 8203 | |
| 8204 | |
| 8205 | |
| 8206 | |
| 8207 | |
| 8208 | |
| 8209 | |
| 8210 | |
| 8211 | |
| 8212 | |
| 8213 | |
| 8214 | |
| 8215 | |
| 8216 | |
| 8217 | |
| 8218 | |
| 8219 | |
| 8220 | |
| 8221 | |
| 8222 | |
| 8223 | |
| 8224 | |
| 8225 | |
| 8226 | |
| 8227 | |
| 8228 | |
| 8229 | |
| 8230 | |
| 8231 | |
| 8232 | |
| 8233 | |
| 8234 | |
| 8235 | |
| 8236 | |
| 8237 | |
| 8238 | |
| 8239 | |
| 8240 | |
| 8241 | |
| 8242 | |
| 8243 | |
| 8244 | |
| 8245 | |
| 8246 | |
| 8247 | |
| 8248 | |
| 8249 | |
| 8250 | |
| 8251 | |
| 8252 | |
| 8253 | |
| 8254 | |
| 8255 | |
| 8256 | |
| 8257 | |
| 8258 | |
| 8259 | |
| 8260 | |
| 8261 | |
| 8262 | |
| 8263 | |
| 8264 | |
| 8265 | |
| 8266 | |
| 8267 | |
| 8268 | |
| 8269 | |
| 8270 | |
| 8271 | |
| 8272 | |
| 8273 | |
| 8274 | |
| 8275 | |
| 8276 | |
| 8277 | |
| 8278 | |
| 8279 | |
| 8280 | |
| 8281 | |
| 8282 | |
| 8283 | |
| 8284 | |
| 8285 | |
| 8286 | |
| 8287 | |
| 8288 | |
| 8289 | |
| 8290 | |
| 8291 | |
| 8292 | |
| 8293 | |
| 8294 | |
| 8295 | |
| 8296 | |
| 8297 | |
| 8298 | |
| 8299 | |
| 8300 | |
| 8301 | |
| 8302 | |
| 8303 | |
| 8304 | |
| 8305 | |
| 8306 | |
| 8307 | |
| 8308 | |
| 8309 | |
| 8310 | |
| 8311 | |
| 8312 | |
| 8313 | |
| 8314 | |
| 8315 | |
| 8316 | |
| 8317 | |
| 8318 | |
| 8319 | |
| 8320 | |
| 8321 | |
| 8322 | |
| 8323 | |
| 8324 | |
| 8325 | |
| 8326 | |
| 8327 | |
| 8328 | |
| 8329 | |
| 8330 | |
| 8331 | |
| 8332 | |
| 8333 | |
| 8334 | |
| 8335 | |
| 8336 | |
| 8337 | |
| 8338 | |
| 8339 | |
| 8340 | |
| 8341 | |
| 8342 | |
| 8343 | |
| 8344 | |
| 8345 | |
| 8346 | |
| 8347 | |
| 8348 | |
| 8349 | |
| 8350 | |
| 8351 | |
| 8352 | |
| 8353 | |
| 8354 | |
| 8355 | |
| 8356 | |
| 8357 | |
| 8358 | |
| 8359 | |
| 8360 | |
| 8361 | |
| 8362 | |
| 8363 | |
| 8364 | |
| 8365 | |
| 8366 | |
| 8367 | |
| 8368 | |
| 8369 | |
| 8370 | |
| 8371 | |
| 8372 | |
| 8373 | |
| 8374 | |
| 8375 | |
| 8376 | |
| 8377 | |
| 8378 | |
| 8379 | |
| 8380 | |
| 8381 | |
| 8382 | |
| 8383 | |
| 8384 | |
| 8385 | |
| 8386 | |
| 8387 | |
| 8388 | |
| 8389 | |
| 8390 | |
| 8391 | |
| 8392 | |
| 8393 | |
| 8394 | |
| 8395 | |
| 8396 | |
| 8397 | |
| 8398 | |
| 8399 | |
| 8400 | |
| 8401 | |
| 8402 | |
| 8403 | |
| 8404 | |
| 8405 | |
| 8406 | |
| 8407 | |
| 8408 | |
| 8409 | |
| 8410 | /// Writes one 8x8 leaf of a straddling 16x16 inter-frame block |
| 8411 | /// (lane-av1inter8): its own skip flag, intra/inter choice and (when inter) |
| 8412 | /// `NEARESTMV`/`NEWMV` chain, or (when intra) `Y_MODE`, then its own luma and |
| 8413 | /// two chroma transform blocks -- coded exactly like |
| 8414 | /// [`write_inter_frame_leaf`] but through [`TxbSet::Luma8Inter`]/ |
| 8415 | /// [`TxbSet::Chroma4`] and at this leaf's own 2x2-mi mv-stack window, reading |
| 8416 | /// its skip/intra-inter context from the *enclosing* 16x16 slot's |
| 8417 | /// [`Neighbours`] arrays (`outer_at`, in [`SUB`]-grid units) unless |
| 8418 | /// `prev_leaf` names this straddling block's own first leaf as the true |
| 8419 | /// mi-adjacent neighbour -- the same override [`write_leaf8`] applies to its |
| 8420 | /// mode context, needed for the same reason: `Neighbours`' above/left arrays |
| 8421 | /// only resolve to [`SUB`] granularity, too coarse for the second leaf of a |
| 8422 | /// straddling 16x16 to see the first. `Y_MODE`'s own context (`Size_Group`) |
| 8423 | /// is not neighbour-dependent, unlike the key frame path's `kf_y_mode`, so no |
| 8424 | /// override is needed there. Hands back this leaf's own skip flag and |
| 8425 | /// intra/inter choice, which is what the next leaf (or the caller's final |
| 8426 | /// write-back, mirroring `write_leaf8`'s caller) reads. |
| 8427 | |
| 8428 | |
| 8429 | |
| 8430 | |
| 8431 | |
| 8432 | |
| 8433 | |
| 8434 | |
| 8435 | |
| 8436 | |
| 8437 | |
| 8438 | |
| 8439 | |
| 8440 | |
| 8441 | |
| 8442 | |
| 8443 | |
| 8444 | |
| 8445 | |
| 8446 | |
| 8447 | |
| 8448 | |
| 8449 | |
| 8450 | |
| 8451 | |
| 8452 | |
| 8453 | |
| 8454 | |
| 8455 | |
| 8456 | |
| 8457 | |
| 8458 | |
| 8459 | |
| 8460 | |
| 8461 | |
| 8462 | |
| 8463 | |
| 8464 | |
| 8465 | |
| 8466 | |
| 8467 | |
| 8468 | |
| 8469 | |
| 8470 | |
| 8471 | |
| 8472 | |
| 8473 | |
| 8474 | |
| 8475 | |
| 8476 | |
| 8477 | |
| 8478 | |
| 8479 | |
| 8480 | |
| 8481 | |
| 8482 | |
| 8483 | |
| 8484 | |
| 8485 | |
| 8486 | |
| 8487 | |
| 8488 | |
| 8489 | |
| 8490 | |
| 8491 | |
| 8492 | |
| 8493 | |
| 8494 | |
| 8495 | |
| 8496 | |
| 8497 | |
| 8498 | |
| 8499 | |
| 8500 | |
| 8501 | |
| 8502 | |
| 8503 | |
| 8504 | |
| 8505 | |
| 8506 | |
| 8507 | |
| 8508 | |
| 8509 | |
| 8510 | |
| 8511 | |
| 8512 | |
| 8513 | |
| 8514 | |
| 8515 | |
| 8516 | |
| 8517 | |
| 8518 | |
| 8519 | |
| 8520 | |
| 8521 | |
| 8522 | |
| 8523 | |
| 8524 | |
| 8525 | |
| 8526 | |
| 8527 | |
| 8528 | |
| 8529 | |
| 8530 | |
| 8531 | |
| 8532 | |
| 8533 | |
| 8534 | |
| 8535 | |
| 8536 | |
| 8537 | |
| 8538 | |
| 8539 | |
| 8540 | |
| 8541 | |
| 8542 | |
| 8543 | |
| 8544 | |
| 8545 | |
| 8546 | |
| 8547 | |
| 8548 | |
| 8549 | |
| 8550 | |
| 8551 | |
| 8552 | |
| 8553 | |
| 8554 | |
| 8555 | |
| 8556 | |
| 8557 | |
| 8558 | |
| 8559 | |
| 8560 | |
| 8561 | |
| 8562 | |
| 8563 | |
| 8564 | |
| 8565 | |
| 8566 | |
| 8567 | |
| 8568 | |
| 8569 | |
| 8570 | |
| 8571 | |
| 8572 | |
| 8573 | |
| 8574 | |
| 8575 | |
| 8576 | |
| 8577 | |
| 8578 | |
| 8579 | |
| 8580 | |
| 8581 | |
| 8582 | |
| 8583 | |
| 8584 | |
| 8585 | |
| 8586 | |
| 8587 | |
| 8588 | |
| 8589 | |
| 8590 | |
| 8591 | |
| 8592 | |
| 8593 | |
| 8594 | |
| 8595 | |
| 8596 | |
| 8597 | |
| 8598 | |
| 8599 | |
| 8600 | |
| 8601 | |
| 8602 | |
| 8603 | |
| 8604 | |
| 8605 | |
| 8606 | |
| 8607 | |
| 8608 | |
| 8609 | |
| 8610 | |
| 8611 | |
| 8612 | |
| 8613 | |
| 8614 | |
| 8615 | |
| 8616 | |
| 8617 | |
| 8618 | |
| 8619 | |
| 8620 | |
| 8621 | |
| 8622 | |
| 8623 | |
| 8624 | |
| 8625 | |
| 8626 | |
| 8627 | |
| 8628 | |
| 8629 | |
| 8630 | |
| 8631 | |
| 8632 | |
| 8633 | |
| 8634 | |
| 8635 | |
| 8636 | |
| 8637 | |
| 8638 | |
| 8639 | |
| 8640 | |
| 8641 | |
| 8642 | |
| 8643 | |
| 8644 | |
| 8645 | |
| 8646 | |
| 8647 | |
| 8648 | |
| 8649 | |
| 8650 | |
| 8651 | |
| 8652 | |
| 8653 | |
| 8654 | |
| 8655 | |
| 8656 | |
| 8657 | |
| 8658 | |
| 8659 | |
| 8660 | |
| 8661 | |
| 8662 | |
| 8663 | |
| 8664 | |
| 8665 | |
| 8666 | |
| 8667 | |
| 8668 | |
| 8669 | |
| 8670 | |
| 8671 | |
| 8672 | |
| 8673 | |
| 8674 | |
| 8675 | |
| 8676 | |
| 8677 | |
| 8678 | |
| 8679 | |
| 8680 | |
| 8681 | |
| 8682 | |
| 8683 | |
| 8684 | |
| 8685 | |
| 8686 | |
| 8687 | |
| 8688 | |
| 8689 | |
| 8690 | |
| 8691 | |
| 8692 | |
| 8693 | |
| 8694 | |
| 8695 | |
| 8696 | |
| 8697 | |
| 8698 | |
| 8699 | |
| 8700 | |
| 8701 | |
| 8702 | |
| 8703 | |
| 8704 | |
| 8705 | |
| 8706 | |
| 8707 | |
| 8708 | |
| 8709 | |
| 8710 | |
| 8711 | |
| 8712 | |
| 8713 | |
| 8714 | |
| 8715 | |
| 8716 | |
| 8717 | |
| 8718 | |
| 8719 | |
| 8720 | |
| 8721 | |
| 8722 | |
| 8723 | |
| 8724 | |
| 8725 | |
| 8726 | |
| 8727 | |
| 8728 | |
| 8729 | |
| 8730 | |
| 8731 | |
| 8732 | |
| 8733 | |
| 8734 | |
| 8735 | |
| 8736 | |
| 8737 | |
| 8738 | |
| 8739 | |
| 8740 | |
| 8741 | |
| 8742 | |
| 8743 | |
| 8744 | |
| 8745 | |
| 8746 | |
| 8747 | |
| 8748 | |
| 8749 | |
| 8750 | |
| 8751 | |
| 8752 | |
| 8753 | |
| 8754 | |
| 8755 | |
| 8756 | |
| 8757 | |
| 8758 | |
| 8759 | |
| 8760 | |
| 8761 | |
| 8762 | |
| 8763 | |
| 8764 | |
| 8765 | |
| 8766 | |
| 8767 | |
| 8768 | |
| 8769 | |
| 8770 | |
| 8771 | |
| 8772 | |
| 8773 | |
| 8774 | |
| 8775 | |
| 8776 | |
| 8777 | |
| 8778 | |
| 8779 | |
| 8780 | |
| 8781 | |
| 8782 | |
| 8783 | |
| 8784 | |
| 8785 | |
| 8786 | |
| 8787 | |
| 8788 | |
| 8789 | |
| 8790 | |
| 8791 | |
| 8792 | |
| 8793 | |
| 8794 | |
| 8795 | |
| 8796 | |
| 8797 | |
| 8798 | |
| 8799 | |
| 8800 | |
| 8801 | |
| 8802 | |
| 8803 | |
| 8804 | |
| 8805 | |
| 8806 | |
| 8807 | |
| 8808 | |
| 8809 | |
| 8810 | |
| 8811 | |
| 8812 | |
| 8813 | |
| 8814 | |
| 8815 | |
| 8816 | |
| 8817 | |
| 8818 | |
| 8819 | |
| 8820 | |
| 8821 | |
| 8822 | |
| 8823 | |
| 8824 | |
| 8825 | |
| 8826 | |
| 8827 | |
| 8828 | |
| 8829 | |
| 8830 | |
| 8831 | |
| 8832 | |
| 8833 | |
| 8834 | |
| 8835 | |
| 8836 | |
| 8837 | |
| 8838 | |
| 8839 | |
| 8840 | |
| 8841 | |
| 8842 | |
| 8843 | |
| 8844 | |
| 8845 | |
| 8846 | |
| 8847 | |
| 8848 | |
| 8849 | |
| 8850 | |
| 8851 | |
| 8852 | |
| 8853 | |
| 8854 | |
| 8855 | |
| 8856 | |
| 8857 | |
| 8858 | |
| 8859 | |
| 8860 | |
| 8861 | |
| 8862 | |
| 8863 | |
| 8864 | |
| 8865 | |
| 8866 | |
| 8867 | |
| 8868 | |
| 8869 | |
| 8870 | |
| 8871 | |
| 8872 | |
| 8873 | |
| 8874 | |
| 8875 | |
| 8876 | |
| 8877 | |
| 8878 | |
| 8879 | |
| 8880 | |
| 8881 | |
| 8882 | |
| 8883 | |
| 8884 | |
| 8885 | |
| 8886 | |
| 8887 | |
| 8888 | |
| 8889 | |
| 8890 | |
| 8891 | |
| 8892 | |
| 8893 | |
| 8894 | |
| 8895 | |
| 8896 | |
| 8897 | |
| 8898 | |
| 8899 | |
| 8900 | |
| 8901 | |
| 8902 | |
| 8903 | |
| 8904 | |
| 8905 | |
| 8906 | |
| 8907 | |
| 8908 | |
| 8909 | |
| 8910 | |
| 8911 | |
| 8912 | |
| 8913 | |
| 8914 | |
| 8915 | |
| 8916 | |
| 8917 | |
| 8918 | |
| 8919 | |
| 8920 | |
| 8921 | |
| 8922 | |
| 8923 | |
| 8924 | |
| 8925 | |
| 8926 | |
| 8927 | |
| 8928 | |
| 8929 | |
| 8930 | |
| 8931 | |
| 8932 | |
| 8933 | |
| 8934 | |
| 8935 | |
| 8936 | |
| 8937 | |
| 8938 | |
| 8939 | |
| 8940 | |
| 8941 | |
| 8942 | |
| 8943 | |
| 8944 | |
| 8945 | |
| 8946 | |
| 8947 | |
| 8948 | |
| 8949 | |
| 8950 | |
| 8951 | |
| 8952 | |
| 8953 | |
| 8954 | |
| 8955 | |
| 8956 | |
| 8957 | |
| 8958 | |
| 8959 | |
| 8960 | |
| 8961 | |
| 8962 | |
| 8963 | |
| 8964 | |
| 8965 | |
| 8966 | |
| 8967 | |
| 8968 | |
| 8969 | |
| 8970 | |
| 8971 | |
| 8972 | |
| 8973 | |
| 8974 | |
| 8975 | |
| 8976 | |
| 8977 | |
| 8978 | |
| 8979 | |
| 8980 | |
| 8981 | |
| 8982 | |
| 8983 | |
| 8984 | |
| 8985 | |
| 8986 | |
| 8987 | |
| 8988 | |
| 8989 | |
| 8990 | |
| 8991 | |
| 8992 | |
| 8993 | |
| 8994 | |
| 8995 | |
| 8996 | |
| 8997 | |
| 8998 | |
| 8999 | |
| 9000 | |
| 9001 | |
| 9002 | |
| 9003 | |
| 9004 | |
| 9005 | |
| 9006 | |
| 9007 | |
| 9008 | |
| 9009 | |
| 9010 | |
| 9011 | |
| 9012 | |
| 9013 | |
| 9014 | |
| 9015 | |
| 9016 | |
| 9017 | |
| 9018 | |
| 9019 | |
| 9020 | |
| 9021 | |
| 9022 | |
| 9023 | |
| 9024 | |
| 9025 | |
| 9026 | |
| 9027 | |
| 9028 | |
| 9029 | |
| 9030 | |
| 9031 | |
| 9032 | |
| 9033 | |
| 9034 | |
| 9035 | |
| 9036 | |
| 9037 | |
| 9038 | |
| 9039 | |
| 9040 | |
| 9041 | |
| 9042 | |
| 9043 | |
| 9044 | |
| 9045 | |
| 9046 | |
| 9047 | |
| 9048 | |
| 9049 | |
| 9050 | |
| 9051 | |
| 9052 | |
| 9053 | |
| 9054 | |
| 9055 | |
| 9056 | |
| 9057 | |
| 9058 | |
| 9059 | |
| 9060 | |
| 9061 | |
| 9062 | |
| 9063 | |
| 9064 | |
| 9065 | |
| 9066 | |
| 9067 | |
| 9068 | |
| 9069 | |
| 9070 | |
| 9071 | |
| 9072 | |
| 9073 | |
| 9074 | |
| 9075 | |
| 9076 | |
| 9077 | |
| 9078 | |
| 9079 | |
| 9080 | |
| 9081 | |
| 9082 | |
| 9083 | |
| 9084 | |
| 9085 | |
| 9086 | |
| 9087 | |
| 9088 | |
| 9089 | |
| 9090 | |
| 9091 | |
| 9092 | |
| 9093 | |
| 9094 | |
| 9095 | |
| 9096 | |
| 9097 | |
| 9098 | |
| 9099 | |
| 9100 | |
| 9101 | |
| 9102 | |
| 9103 | |
| 9104 | |
| 9105 | |
| 9106 | |
| 9107 | |
| 9108 | |
| 9109 | |
| 9110 | |
| 9111 | |
| 9112 | |
| 9113 | |
| 9114 | |
| 9115 | |
| 9116 | |
| 9117 | |
| 9118 | |
| 9119 | |
| 9120 | |
| 9121 | |
| 9122 | |
| 9123 | |
| 9124 | |
| 9125 | |
| 9126 | |
| 9127 | |
| 9128 | |
| 9129 | |
| 9130 | |
| 9131 | |
| 9132 | |
| 9133 | |
| 9134 | |
| 9135 | |
| 9136 | |
| 9137 | |
| 9138 | |
| 9139 | |
| 9140 | |
| 9141 | |
| 9142 | |
| 9143 | |
| 9144 | |
| 9145 | |
| 9146 | |
| 9147 | |
| 9148 | |
| 9149 | |
| 9150 | |
| 9151 | |
| 9152 | |
| 9153 | |
| 9154 | |
| 9155 | |
| 9156 | |
| 9157 | |
| 9158 | |
| 9159 | |
| 9160 | |
| 9161 | |
| 9162 | |
| 9163 | |
| 9164 | |
| 9165 | |
| 9166 | |
| 9167 | |
| 9168 | |
| 9169 | |
| 9170 | |
| 9171 | |
| 9172 | |
| 9173 | |
| 9174 | |
| 9175 | |
| 9176 | |
| 9177 | |
| 9178 | |
| 9179 | |
| 9180 | |
| 9181 | |
| 9182 | |
| 9183 | |
| 9184 | |
| 9185 | |
| 9186 | |
| 9187 | |
| 9188 | |
| 9189 | |
| 9190 | |
| 9191 | |
| 9192 | |
| 9193 | |
| 9194 | |
| 9195 | |
| 9196 | |
| 9197 | |
| 9198 | |
| 9199 | |
| 9200 | |
| 9201 | |
| 9202 | |
| 9203 | |
| 9204 | |
| 9205 | |
| 9206 | |
| 9207 | |
| 9208 | |
| 9209 | |
| 9210 | |
| 9211 | |
| 9212 | |
| 9213 | |
| 9214 | |
| 9215 | |
| 9216 | |
| 9217 | |
| 9218 | |
| 9219 | |
| 9220 | |
| 9221 | |
| 9222 | |
| 9223 | |
| 9224 | |
| 9225 | |
| 9226 | |
| 9227 | |
| 9228 | |
| 9229 | |
| 9230 | |
| 9231 | |
| 9232 | |
| 9233 | |
| 9234 | |
| 9235 | |
| 9236 | |
| 9237 | |
| 9238 | |
| 9239 | |
| 9240 | |
| 9241 | |
| 9242 | |
| 9243 | |
| 9244 | |
| 9245 | |
| 9246 | |
| 9247 | |
| 9248 | |
| 9249 | |
| 9250 | |
| 9251 | |
| 9252 | |
| 9253 | |
| 9254 | |
| 9255 | |
| 9256 | |
| 9257 | |
| 9258 | |
| 9259 | |
| 9260 | |
| 9261 | |
| 9262 | |
| 9263 | |
| 9264 | |
| 9265 | |
| 9266 | |
| 9267 | |
| 9268 | |
| 9269 | |
| 9270 | |
| 9271 | |
| 9272 | |
| 9273 | |
| 9274 | |
| 9275 | |
| 9276 | |
| 9277 | |
| 9278 | |
| 9279 | |
| 9280 | |
| 9281 | |
| 9282 | |
| 9283 | |
| 9284 | |
| 9285 | |
| 9286 | |
| 9287 | |
| 9288 | |
| 9289 | |
| 9290 | |
| 9291 | |
| 9292 | |
| 9293 | |
| 9294 | |
| 9295 | |
| 9296 | |
| 9297 | |
| 9298 | |
| 9299 | |
| 9300 | |
| 9301 | |
| 9302 | |
| 9303 | |
| 9304 | |
| 9305 | |
| 9306 | |
| 9307 | |
| 9308 | |
| 9309 | |
| 9310 | |
| 9311 | |
| 9312 | |
| 9313 | |
| 9314 | |
| 9315 | |
| 9316 | |
| 9317 | |
| 9318 | |
| 9319 | |
| 9320 | |
| 9321 | |
| 9322 | |
| 9323 | |
| 9324 | |
| 9325 | |
| 9326 | |
| 9327 | |
| 9328 | |
| 9329 | |
| 9330 | |
| 9331 | |
| 9332 | |
| 9333 | |
| 9334 | |
| 9335 | |
| 9336 | |
| 9337 | |
| 9338 | |
| 9339 | |
| 9340 | |
| 9341 | |
| 9342 | |
| 9343 | |
| 9344 | |
| 9345 | |
| 9346 | |
| 9347 | |
| 9348 | |
| 9349 | |
| 9350 | |
| 9351 | |
| 9352 | |
| 9353 | |
| 9354 | |
| 9355 | |
| 9356 | |
| 9357 | |
| 9358 | |
| 9359 | |
| 9360 | |
| 9361 | |
| 9362 | |
| 9363 | |
| 9364 | |
| 9365 | |
| 9366 | |
| 9367 | |
| 9368 | |
| 9369 | |
| 9370 | |
| 9371 | |
| 9372 | |
| 9373 | |
| 9374 | |
| 9375 | |
| 9376 | |
| 9377 | |
| 9378 | |
| 9379 | |
| 9380 | |
| 9381 | |
| 9382 | |
| 9383 | |
| 9384 | |
| 9385 | |
| 9386 | |
| 9387 | |
| 9388 | |
| 9389 | |
| 9390 | |
| 9391 | |
| 9392 | |
| 9393 | |
| 9394 | |
| 9395 | |
| 9396 | |
| 9397 | |
| 9398 | |
| 9399 | |
| 9400 | |
| 9401 | |
| 9402 | |
| 9403 | |
| 9404 | |
| 9405 | |
| 9406 | |
| 9407 | |
| 9408 | |
| 9409 | |
| 9410 | |
| 9411 | |
| 9412 | |
| 9413 | |
| 9414 | |
| 9415 | |
| 9416 | |
| 9417 | |
| 9418 | |
| 9419 | |
| 9420 | |
| 9421 | |
| 9422 | |
| 9423 | |
| 9424 | |
| 9425 | |
| 9426 | |
| 9427 | |
| 9428 | |
| 9429 | |
| 9430 | |
| 9431 | |
| 9432 | |
| 9433 | |
| 9434 | |
| 9435 | |
| 9436 | |
| 9437 | |
| 9438 | |
| 9439 | |
| 9440 | |
| 9441 | |
| 9442 | |
| 9443 | |
| 9444 | |
| 9445 | |
| 9446 | |
| 9447 | |
| 9448 | |
| 9449 | |
| 9450 | |
| 9451 | |
| 9452 | |
| 9453 | |
| 9454 | |
| 9455 | |
| 9456 | |
| 9457 | |
| 9458 | |
| 9459 | |
| 9460 | |
| 9461 | |
| 9462 | |
| 9463 | |
| 9464 | |
| 9465 | |
| 9466 | |
| 9467 | |
| 9468 | |
| 9469 | |
| 9470 | |
| 9471 | |
| 9472 | |
| 9473 | |
| 9474 | |
| 9475 | |
| 9476 | |
| 9477 | |
| 9478 | |
| 9479 | |
| 9480 | |
| 9481 | |
| 9482 | |
| 9483 | |
| 9484 | |
| 9485 | |
| 9486 | |
| 9487 | |
| 9488 | |
| 9489 | |
| 9490 | |
| 9491 | |
| 9492 | |
| 9493 | |
| 9494 | |
| 9495 | |
| 9496 | |
| 9497 | |
| 9498 | |
| 9499 | |
| 9500 | |
| 9501 | |
| 9502 | |
| 9503 | |
| 9504 | |
| 9505 | |
| 9506 | |
| 9507 | |
| 9508 | |
| 9509 | |
| 9510 | |
| 9511 | |
| 9512 | |
| 9513 | |
| 9514 | |
| 9515 | |
| 9516 | |
| 9517 | |
| 9518 | |
| 9519 | |
| 9520 | |
| 9521 | |
| 9522 | |
| 9523 | |
| 9524 | |
| 9525 | |
| 9526 | |
| 9527 | |
| 9528 | |
| 9529 | |
| 9530 | |
| 9531 | |
| 9532 | |
| 9533 | |
| 9534 | |
| 9535 | |
| 9536 | |
| 9537 | |
| 9538 | |
| 9539 | |
| 9540 | |
| 9541 | |
| 9542 | |
| 9543 | |
| 9544 | |
| 9545 | |
| 9546 | |
| 9547 | |
| 9548 | |
| 9549 | |
| 9550 | |
| 9551 | |
| 9552 | |
| 9553 | |
| 9554 | |
| 9555 | |
| 9556 | |
| 9557 | |
| 9558 | |
| 9559 | |
| 9560 | |
| 9561 | |
| 9562 | |
| 9563 | |
| 9564 | |
| 9565 | |
| 9566 | |
| 9567 | |
| 9568 | |
| 9569 | |
| 9570 | |
| 9571 | |
| 9572 | |
| 9573 | |
| 9574 | |
| 9575 | |
| 9576 | |
| 9577 | |
| 9578 | |
| 9579 | |
| 9580 | |
| 9581 | |
| 9582 | |
| 9583 | |
| 9584 | |
| 9585 | |
| 9586 | |
| 9587 | |
| 9588 | |
| 9589 | |
| 9590 | |
| 9591 | |
| 9592 | |
| 9593 | |
| 9594 | |
| 9595 | |
| 9596 | |
| 9597 | |
| 9598 | |
| 9599 | |
| 9600 | |
| 9601 | |
| 9602 | |
| 9603 | |
| 9604 | |
| 9605 | |
| 9606 | |
| 9607 | |
| 9608 | |
| 9609 | |
| 9610 | |
| 9611 | |
| 9612 | |
| 9613 | |
| 9614 | |
| 9615 | |
| 9616 | |
| 9617 | |
| 9618 | |
| 9619 | |
| 9620 | |
| 9621 | |
| 9622 | |
| 9623 | |
| 9624 | |
| 9625 | |
| 9626 | |
| 9627 | |
| 9628 | |
| 9629 | |
| 9630 | |
| 9631 | |
| 9632 | |
| 9633 | |
| 9634 | |
| 9635 | |
| 9636 | |
| 9637 | |
| 9638 | |
| 9639 | |
| 9640 | |
| 9641 | |
| 9642 | |
| 9643 | |
| 9644 | |
| 9645 | |
| 9646 | |
| 9647 | |
| 9648 | |
| 9649 | |
| 9650 | |
| 9651 | |
| 9652 | |
| 9653 | |
| 9654 | |
| 9655 | |
| 9656 | |
| 9657 | |
| 9658 | |
| 9659 | |
| 9660 | |
| 9661 | |
| 9662 | |
| 9663 | |
| 9664 | |
| 9665 | |
| 9666 | |
| 9667 | |
| 9668 | |
| 9669 | |
| 9670 | |
| 9671 | |
| 9672 | |
| 9673 | |
| 9674 | |
| 9675 | |
| 9676 | |
| 9677 | |
| 9678 | |
| 9679 | |
| 9680 | |
| 9681 | |
| 9682 | |
| 9683 | |
| 9684 | |
| 9685 | |
| 9686 | |
| 9687 | |
| 9688 | |
| 9689 | |
| 9690 | |
| 9691 | |
| 9692 | |
| 9693 | |
| 9694 | |
| 9695 | |
| 9696 | |
| 9697 | |
| 9698 | |
| 9699 | |
| 9700 | |
| 9701 | |
| 9702 | |
| 9703 | |
| 9704 | |
| 9705 | |
| 9706 | |
| 9707 | |
| 9708 | |
| 9709 | |
| 9710 | |
| 9711 | |
| 9712 | |
| 9713 | |
| 9714 | |
| 9715 | |
| 9716 | |
| 9717 | |
| 9718 | |
| 9719 | |
| 9720 | |
| 9721 | |
| 9722 | |
| 9723 | |
| 9724 | |
| 9725 | |
| 9726 | |
| 9727 | |
| 9728 | |
| 9729 | |
| 9730 | |
| 9731 | |
| 9732 | |
| 9733 | |
| 9734 | |
| 9735 | |
| 9736 | |
| 9737 | |
| 9738 | |
| 9739 | |
| 9740 | |
| 9741 | |
| 9742 | |
| 9743 | |
| 9744 | |
| 9745 | |
| 9746 | |
| 9747 | |
| 9748 | |
| 9749 | |
| 9750 | |
| 9751 | |
| 9752 | |
| 9753 | |
| 9754 | |
| 9755 | |
| 9756 | |
| 9757 | |
| 9758 | |
| 9759 | |
| 9760 | |
| 9761 | |
| 9762 | |
| 9763 | |
| 9764 | |
| 9765 | |
| 9766 | |
| 9767 | |
| 9768 | |
| 9769 | |
| 9770 | |
| 9771 | |
| 9772 | |
| 9773 | |
| 9774 | |
| 9775 | |
| 9776 | |
| 9777 | |
| 9778 | |
| 9779 | |
| 9780 | |
| 9781 | |
| 9782 | |
| 9783 | |
| 9784 | |
| 9785 | |
| 9786 | |
| 9787 | |
| 9788 | |
| 9789 | |
| 9790 | |
| 9791 | |
| 9792 | |
| 9793 | |
| 9794 | |
| 9795 | |
| 9796 | |
| 9797 | |
| 9798 | |
| 9799 | |
| 9800 | |
| 9801 | |
| 9802 | |
| 9803 | |
| 9804 | |
| 9805 | |
| 9806 | |
| 9807 | |
| 9808 | |
| 9809 | |
| 9810 | |
| 9811 | |
| 9812 | |
| 9813 | |
| 9814 | |
| 9815 | |
| 9816 | |
| 9817 | |
| 9818 | |
| 9819 | |
| 9820 | |
| 9821 | |
| 9822 | |
| 9823 | |
| 9824 | |
| 9825 | |
| 9826 | |
| 9827 | |
| 9828 | |
| 9829 | |
| 9830 | |
| 9831 | |
| 9832 | |
| 9833 | |
| 9834 | |
| 9835 | |
| 9836 | |
| 9837 | |
| 9838 | |
| 9839 | |
| 9840 | |
| 9841 | |
| 9842 | |
| 9843 | |
| 9844 | |
| 9845 | |
| 9846 | |
| 9847 | |
| 9848 | |
| 9849 | |
| 9850 | |
| 9851 | |
| 9852 | |
| 9853 | |
| 9854 | |
| 9855 | |
| 9856 | |
| 9857 | |
| 9858 | |
| 9859 | |
| 9860 | |
| 9861 | |
| 9862 | |
| 9863 | |
| 9864 | |
| 9865 | |
| 9866 | |
| 9867 | |
| 9868 | |
| 9869 | |
| 9870 | |
| 9871 | |
| 9872 | |
| 9873 | |
| 9874 | |
| 9875 | |
| 9876 | |
| 9877 | |
| 9878 | |
| 9879 | |
| 9880 | |
| 9881 | |
| 9882 | |
| 9883 | |
| 9884 | |
| 9885 | |
| 9886 | |
| 9887 | |
| 9888 | |
| 9889 | |
| 9890 | |
| 9891 | |
| 9892 | |
| 9893 | |
| 9894 | |
| 9895 | |
| 9896 | |
| 9897 | |
| 9898 | |
| 9899 | |
| 9900 | |
| 9901 | |
| 9902 | |
| 9903 | |
| 9904 | |
| 9905 | |
| 9906 | |
| 9907 | |
| 9908 | |
| 9909 | |
| 9910 | |
| 9911 | |
| 9912 | |
| 9913 | |
| 9914 | |
| 9915 | |
| 9916 | |
| 9917 | |
| 9918 | |
| 9919 | |
| 9920 | |
| 9921 | |
| 9922 | |
| 9923 | |
| 9924 | |
| 9925 | |
| 9926 | |
| 9927 | |
| 9928 | |
| 9929 | |
| 9930 | |
| 9931 | |
| 9932 | |
| 9933 | |
| 9934 | |
| 9935 | |
| 9936 | |
| 9937 | |
| 9938 | |
| 9939 | |
| 9940 | |
| 9941 | |
| 9942 | |
| 9943 | |
| 9944 | |
| 9945 | |
| 9946 | |
| 9947 | |
| 9948 | |
| 9949 | |
| 9950 | |
| 9951 | |
| 9952 | |
| 9953 | |
| 9954 | |
| 9955 | |
| 9956 | |
| 9957 | |
| 9958 | |
| 9959 | |
| 9960 | |
| 9961 | |
| 9962 | |
| 9963 | |
| 9964 | |
| 9965 | |
| 9966 | |
| 9967 | |
| 9968 | |
| 9969 | |
| 9970 | |
| 9971 | |
| 9972 | |
| 9973 | |
| 9974 | |
| 9975 | |
| 9976 | |
| 9977 | |
| 9978 | |
| 9979 | |
| 9980 | |
| 9981 | |
| 9982 | |
| 9983 | |
| 9984 | |
| 9985 | |
| 9986 | |
| 9987 | |
| 9988 | |
| 9989 | |
| 9990 | |
| 9991 | |
| 9992 | |
| 9993 | |
| 9994 | |
| 9995 | |
| 9996 | |
| 9997 | |
| 9998 | |
| 9999 | |
| 10000 | |
| 10001 | |
| 10002 | |
| 10003 | |
| 10004 | |
| 10005 | |
| 10006 | |
| 10007 | |
| 10008 | |
| 10009 | |
| 10010 | |
| 10011 | |
| 10012 | |
| 10013 | |
| 10014 | |
| 10015 | |
| 10016 | |
| 10017 | |
| 10018 | |
| 10019 | |
| 10020 | |
| 10021 | |
| 10022 | |
| 10023 | |
| 10024 | |
| 10025 | |
| 10026 | |
| 10027 | |
| 10028 | |
| 10029 | |
| 10030 | |
| 10031 | |
| 10032 | |
| 10033 | |
| 10034 | |
| 10035 | |
| 10036 | |
| 10037 | |
| 10038 | |
| 10039 | |
| 10040 | |
| 10041 | |
| 10042 | |
| 10043 | |
| 10044 | |
| 10045 | |
| 10046 | |
| 10047 | |
| 10048 | |
| 10049 | |
| 10050 | |
| 10051 | |
| 10052 | |
| 10053 | |
| 10054 | |
| 10055 | |
| 10056 | |
| 10057 | |
| 10058 | |
| 10059 | |
| 10060 | |
| 10061 | |
| 10062 | |
| 10063 | |
| 10064 | |
| 10065 | |
| 10066 | |
| 10067 | |
| 10068 | |
| 10069 | |
| 10070 | |
| 10071 | |
| 10072 | |
| 10073 | |
| 10074 | |
| 10075 | |
| 10076 | |
| 10077 | |
| 10078 | |
| 10079 | |
| 10080 | |
| 10081 | |
| 10082 | |
| 10083 | |
| 10084 | |
| 10085 | |
| 10086 | |
| 10087 | |
| 10088 | |
| 10089 | |
| 10090 | |
| 10091 | |
| 10092 | |
| 10093 | |
| 10094 | |
| 10095 | |
| 10096 | |
| 10097 | |
| 10098 | |
| 10099 | |
| 10100 | |
| 10101 | |
| 10102 | |
| 10103 | |
| 10104 | |
| 10105 | |
| 10106 | |
| 10107 | |
| 10108 | |
| 10109 | |
| 10110 | |
| 10111 | |
| 10112 | |
| 10113 | |
| 10114 | |
| 10115 | |
| 10116 | |
| 10117 | |
| 10118 | |
| 10119 | |
| 10120 | |
| 10121 | |
| 10122 | |
| 10123 | |
| 10124 | |
| 10125 | |
| 10126 | |
| 10127 | |
| 10128 | |
| 10129 | |
| 10130 | |
| 10131 | |
| 10132 | |
| 10133 | |
| 10134 | |
| 10135 | |
| 10136 | |
| 10137 | |
| 10138 | |
| 10139 | |
| 10140 | |
| 10141 | |
| 10142 | |
| 10143 | |
| 10144 | |
| 10145 | |
| 10146 | |
| 10147 | |
| 10148 | |
| 10149 | |
| 10150 | |
| 10151 | |
| 10152 | |
| 10153 | |
| 10154 | |
| 10155 | |
| 10156 | |
| 10157 | |
| 10158 | |
| 10159 | |
| 10160 | |
| 10161 | |
| 10162 | |
| 10163 | |
| 10164 | |
| 10165 | |
| 10166 | |
| 10167 | |
| 10168 | |
| 10169 | |
| 10170 | |
| 10171 | |
| 10172 | |
| 10173 | |
| 10174 | |
| 10175 | |
| 10176 | |
| 10177 | |
| 10178 | |
| 10179 | |
| 10180 | |
| 10181 | |
| 10182 | |
| 10183 | |
| 10184 | |
| 10185 | |
| 10186 | |
| 10187 | |
| 10188 | |
| 10189 | |
| 10190 | |
| 10191 | |
| 10192 | |
| 10193 | |
| 10194 | |
| 10195 | |
| 10196 | |
| 10197 | |
| 10198 | |
| 10199 | |
| 10200 | |
| 10201 | |
| 10202 | |
| 10203 | |
| 10204 | |
| 10205 | |
| 10206 | |
| 10207 | |
| 10208 | |
| 10209 | |
| 10210 | |
| 10211 | |
| 10212 | |
| 10213 | |
| 10214 | |
| 10215 | |
| 10216 | |
| 10217 | |
| 10218 | |
| 10219 | |
| 10220 | |
| 10221 | |
| 10222 | |
| 10223 | |
| 10224 | |
| 10225 | |
| 10226 | |
| 10227 | |
| 10228 | |
| 10229 | |
| 10230 | |
| 10231 | |
| 10232 | |
| 10233 | |
| 10234 | |
| 10235 | |
| 10236 | |
| 10237 | |
| 10238 | |
| 10239 | |
| 10240 | |
| 10241 | |
| 10242 | |
| 10243 | |
| 10244 | |
| 10245 | |
| 10246 | |
| 10247 | |
| 10248 | |
| 10249 | |
| 10250 | |
| 10251 | |
| 10252 | |
| 10253 | |
| 10254 | |
| 10255 | |
| 10256 | |
| 10257 | |
| 10258 | |
| 10259 | |
| 10260 | |
| 10261 | |
| 10262 | |
| 10263 | |
| 10264 | |
| 10265 | |
| 10266 | |
| 10267 | |
| 10268 | |
| 10269 | |
| 10270 | |
| 10271 | |
| 10272 | |
| 10273 | |
| 10274 | |
| 10275 | |
| 10276 | |
| 10277 | |
| 10278 | |
| 10279 | |
| 10280 | |
| 10281 | |
| 10282 | |
| 10283 | |
| 10284 | |
| 10285 | |
| 10286 | |
| 10287 | |
| 10288 | |
| 10289 | |
| 10290 | |
| 10291 | |
| 10292 | |
| 10293 | |
| 10294 | |
| 10295 | |
| 10296 | |
| 10297 | |
| 10298 | |
| 10299 | |
| 10300 | |
| 10301 | |
| 10302 | |
| 10303 | |
| 10304 | |
| 10305 | |
| 10306 | |
| 10307 | |
| 10308 | |
| 10309 | |
| 10310 | |
| 10311 | |
| 10312 | |
| 10313 | |
| 10314 | |
| 10315 | |
| 10316 | |
| 10317 | |
| 10318 | |
| 10319 | |
| 10320 | |
| 10321 | |
| 10322 | |
| 10323 | |
| 10324 | |
| 10325 | |
| 10326 | |
| 10327 | |
| 10328 | |
| 10329 | |
| 10330 | |
| 10331 | |
| 10332 | |
| 10333 | |
| 10334 | |
| 10335 | |
| 10336 | |
| 10337 | |
| 10338 | |
| 10339 | |
| 10340 | |
| 10341 | |
| 10342 | |
| 10343 | |
| 10344 | |
| 10345 | |
| 10346 | |
| 10347 | |
| 10348 | |
| 10349 | |
| 10350 | |
| 10351 | |
| 10352 | |
| 10353 | |
| 10354 | |
| 10355 | |
| 10356 | |
| 10357 | |
| 10358 | |
| 10359 | |
| 10360 | |
| 10361 | |
| 10362 | |
| 10363 | |
| 10364 | |
| 10365 | |
| 10366 | |
| 10367 | |
| 10368 | |
| 10369 | |
| 10370 | |
| 10371 | |
| 10372 | |
| 10373 | |
| 10374 | |
| 10375 | |
| 10376 | |
| 10377 | |
| 10378 | |
| 10379 | |
| 10380 | |
| 10381 | |
| 10382 | |
| 10383 | |
| 10384 | |
| 10385 | |
| 10386 | |
| 10387 | |
| 10388 | |
| 10389 | |
| 10390 | |
| 10391 | |
| 10392 | |
| 10393 | |
| 10394 | |
| 10395 | |
| 10396 | |
| 10397 | |
| 10398 | |
| 10399 | |
| 10400 | |
| 10401 | |
| 10402 | |
| 10403 | |
| 10404 | |
| 10405 | |
| 10406 | |
| 10407 | |
| 10408 | |
| 10409 | |
| 10410 | |
| 10411 | |
| 10412 | |
| 10413 | |
| 10414 | |
| 10415 | |
| 10416 | |
| 10417 | |
| 10418 | |
| 10419 | |
| 10420 | |
| 10421 | |
| 10422 | |
| 10423 | |
| 10424 | |
| 10425 | |
| 10426 | |
| 10427 | |
| 10428 | |
| 10429 | |
| 10430 | |
| 10431 | |
| 10432 | |
| 10433 | |
| 10434 | |
| 10435 | |
| 10436 | |
| 10437 | |
| 10438 | |
| 10439 | |
| 10440 | |
| 10441 | |
| 10442 | |
| 10443 | |
| 10444 | |
| 10445 | |
| 10446 | |
| 10447 | |
| 10448 | |
| 10449 | |
| 10450 | |
| 10451 | |
| 10452 | |
| 10453 | |
| 10454 | |
| 10455 | |
| 10456 | |
| 10457 | |
| 10458 | |
| 10459 | |
| 10460 | |
| 10461 | |
| 10462 | |
| 10463 | |
| 10464 | |
| 10465 | |
| 10466 | |
| 10467 | |
| 10468 | |
| 10469 | |
| 10470 | |
| 10471 | |
| 10472 | |
| 10473 | |
| 10474 | |
| 10475 | |
| 10476 | |
| 10477 | |
| 10478 | |
| 10479 | |
| 10480 | |
| 10481 | |
| 10482 | |
| 10483 | |
| 10484 | |
| 10485 | |
| 10486 | |
| 10487 | |
| 10488 | |
| 10489 | |
| 10490 | |
| 10491 | |
| 10492 | |
| 10493 | |
| 10494 | |
| 10495 | |
| 10496 | |
| 10497 | |
| 10498 | |
| 10499 | |
| 10500 | |
| 10501 | |
| 10502 | |
| 10503 | |
| 10504 | |
| 10505 | |
| 10506 | |
| 10507 | |
| 10508 | |
| 10509 | |
| 10510 | |
| 10511 | |
| 10512 | |
| 10513 | |
| 10514 | |
| 10515 | |
| 10516 | |
| 10517 | |
| 10518 | |
| 10519 | |
| 10520 | |
| 10521 | |
| 10522 | |
| 10523 | |
| 10524 | |
| 10525 | |
| 10526 | |
| 10527 | |
| 10528 | |
| 10529 | |
| 10530 | |
| 10531 | |
| 10532 | |
| 10533 | |
| 10534 | |
| 10535 | |
| 10536 | |
| 10537 | |
| 10538 | |
| 10539 | |
| 10540 | |
| 10541 | |
| 10542 | |
| 10543 | |
| 10544 | |
| 10545 | |
| 10546 | |
| 10547 | |
| 10548 | |
| 10549 | |
| 10550 | |
| 10551 | |
| 10552 | |
| 10553 | |
| 10554 | |
| 10555 | |
| 10556 | |
| 10557 | |
| 10558 | |
| 10559 | |
| 10560 | |
| 10561 | |
| 10562 | |
| 10563 | |
| 10564 | |
| 10565 | |
| 10566 | |
| 10567 | |
| 10568 | |
| 10569 | |
| 10570 | |
| 10571 | |
| 10572 | |
| 10573 | |
| 10574 | |
| 10575 | |
| 10576 | |
| 10577 | |
| 10578 | |
| 10579 | |
| 10580 | |
| 10581 | |
| 10582 | |
| 10583 | |
| 10584 | |
| 10585 | |
| 10586 | |
| 10587 | |
| 10588 | |
| 10589 | |
| 10590 | |
| 10591 | |
| 10592 | |
| 10593 | |
| 10594 | |
| 10595 | |
| 10596 | |
| 10597 | |
| 10598 | |
| 10599 | |
| 10600 | |
| 10601 | |
| 10602 | |
| 10603 | |
| 10604 | |
| 10605 | |
| 10606 | |
| 10607 | |
| 10608 | |
| 10609 | |
| 10610 | |
| 10611 | |
| 10612 | |
| 10613 | |
| 10614 | |
| 10615 | |
| 10616 | |
| 10617 | |
| 10618 | |
| 10619 | |
| 10620 | |
| 10621 | |
| 10622 | |
| 10623 | |
| 10624 | |
| 10625 | |
| 10626 | |
| 10627 | |
| 10628 | |
| 10629 | |
| 10630 | |
| 10631 | |
| 10632 | |
| 10633 | |
| 10634 | |
| 10635 | |
| 10636 | |
| 10637 | |
| 10638 | |
| 10639 | |
| 10640 | |
| 10641 | |
| 10642 | |
| 10643 | |
| 10644 | |
| 10645 | |
| 10646 | |
| 10647 | |
| 10648 | |
| 10649 | |
| 10650 | |
| 10651 | |
| 10652 | |
| 10653 | |
| 10654 | |
| 10655 | |
| 10656 | |
| 10657 | |
| 10658 | |
| 10659 | |
| 10660 | |
| 10661 | |
| 10662 | |
| 10663 | |
| 10664 | |
| 10665 | |
| 10666 | |
| 10667 | |
| 10668 | |
| 10669 | |
| 10670 | |
| 10671 | |
| 10672 | |
| 10673 | |
| 10674 | |
| 10675 | |
| 10676 | |
| 10677 | |
| 10678 | |
| 10679 | |
| 10680 | |
| 10681 | |
| 10682 | |
| 10683 | |
| 10684 | |
| 10685 | |
| 10686 | |
| 10687 | |
| 10688 | |
| 10689 | |
| 10690 | |
| 10691 | |
| 10692 | |
| 10693 | |
| 10694 | |
| 10695 | |
| 10696 | |
| 10697 | |
| 10698 | |
| 10699 | |
| 10700 | |
| 10701 | |
| 10702 | |
| 10703 | |
| 10704 | |
| 10705 | |
| 10706 | |
| 10707 | |
| 10708 | |
| 10709 | |
| 10710 | |
| 10711 | |
| 10712 | |
| 10713 | |
| 10714 | |
| 10715 | |
| 10716 | |
| 10717 | |
| 10718 | |
| 10719 | |
| 10720 | |
| 10721 | |
| 10722 | |
| 10723 | |
| 10724 | |
| 10725 | |
| 10726 | |
| 10727 | |
| 10728 | |
| 10729 | |
| 10730 | |
| 10731 | |
| 10732 | |
| 10733 | |
| 10734 | |
| 10735 | |
| 10736 | |
| 10737 | |
| 10738 | |
| 10739 | |
| 10740 | |
| 10741 | |
| 10742 | |
| 10743 | |
| 10744 | |
| 10745 | |
| 10746 | |
| 10747 | |
| 10748 | |
| 10749 | |
| 10750 | |
| 10751 | |
| 10752 | |
| 10753 | |
| 10754 | |
| 10755 | |
| 10756 | |
| 10757 | |
| 10758 | |
| 10759 | |
| 10760 | |
| 10761 | |
| 10762 | |
| 10763 | |
| 10764 | |
| 10765 | |
| 10766 | |
| 10767 | |
| 10768 | |
| 10769 | |
| 10770 | |
| 10771 | |
| 10772 | |
| 10773 | |
| 10774 | |
| 10775 | |
| 10776 | |
| 10777 | |
| 10778 | |
| 10779 | |
| 10780 | |
| 10781 | |
| 10782 | |
| 10783 | |
| 10784 | |
| 10785 | |
| 10786 | |
| 10787 | |
| 10788 | |
| 10789 | |
| 10790 | |
| 10791 | |
| 10792 | |
| 10793 | |
| 10794 | |
| 10795 | |
| 10796 | |
| 10797 | |
| 10798 | |
| 10799 | |
| 10800 | |
| 10801 | |
| 10802 | |
| 10803 | |
| 10804 | |
| 10805 | |
| 10806 | |
| 10807 | |
| 10808 | |
| 10809 | |
| 10810 | |
| 10811 | |
| 10812 | |
| 10813 | |
| 10814 | |
| 10815 | |
| 10816 | |
| 10817 | |
| 10818 | |
| 10819 | |
| 10820 | |
| 10821 | |
| 10822 | |
| 10823 | |
| 10824 | |
| 10825 | |
| 10826 | |
| 10827 | |
| 10828 | |
| 10829 | |
| 10830 | |
| 10831 | |
| 10832 | |
| 10833 | |
| 10834 | |
| 10835 | |
| 10836 | |
| 10837 | |
| 10838 | |
| 10839 | |
| 10840 | |
| 10841 | |
| 10842 | |
| 10843 | |
| 10844 | |
| 10845 | |
| 10846 | |
| 10847 | |
| 10848 | |
| 10849 | |
| 10850 | |
| 10851 | |
| 10852 | |
| 10853 | |
| 10854 | |
| 10855 | |
| 10856 | |
| 10857 | |
| 10858 | |
| 10859 | |
| 10860 | |
| 10861 | |
| 10862 | |
| 10863 | |
| 10864 | |
| 10865 | |
| 10866 | |
| 10867 | |
| 10868 | |
| 10869 | |
| 10870 | |
| 10871 | |
| 10872 | |
| 10873 | |
| 10874 | |
| 10875 | |
| 10876 | |
| 10877 | |
| 10878 | |
| 10879 | |
| 10880 | |
| 10881 | |
| 10882 | |
| 10883 | |
| 10884 | |
| 10885 | |
| 10886 | |
| 10887 | |
| 10888 | |
| 10889 | |
| 10890 | |
| 10891 | |
| 10892 | |
| 10893 | |
| 10894 | |
| 10895 | |
| 10896 | |
| 10897 | |
| 10898 | |
| 10899 | |
| 10900 | |
| 10901 | |
| 10902 | |
| 10903 | |
| 10904 | |
| 10905 | |
| 10906 | |
| 10907 | |
| 10908 | |
| 10909 | |
| 10910 | |
| 10911 | |
| 10912 | |
| 10913 | |
| 10914 | |
| 10915 | |
| 10916 | |
| 10917 | |
| 10918 | |
| 10919 | |
| 10920 | |
| 10921 | |
| 10922 | |
| 10923 | |
| 10924 | |
| 10925 | |
| 10926 | |
| 10927 | |
| 10928 | |
| 10929 | |
| 10930 | |
| 10931 | |
| 10932 | |
| 10933 | |
| 10934 | |
| 10935 | |
| 10936 | |
| 10937 | |
| 10938 | |
| 10939 | |
| 10940 | |
| 10941 | |
| 10942 | |
| 10943 | |
| 10944 | |
| 10945 | |
| 10946 | |
| 10947 | |
| 10948 | |
| 10949 | |
| 10950 | |
| 10951 | |
| 10952 | |
| 10953 | |
| 10954 | |
| 10955 | |
| 10956 | |
| 10957 | |
| 10958 | |
| 10959 | |
| 10960 | |
| 10961 | |
| 10962 | |
| 10963 | |
| 10964 | |
| 10965 | |
| 10966 | |
| 10967 | |
| 10968 | |
| 10969 | |
| 10970 | |
| 10971 | |
| 10972 | |
| 10973 | |
| 10974 | |
| 10975 | |
| 10976 | |
| 10977 | |
| 10978 | |
| 10979 | |
| 10980 | |
| 10981 | |
| 10982 | |
| 10983 | |
| 10984 | |
| 10985 | |
| 10986 | |
| 10987 | |
| 10988 | |
| 10989 | |
| 10990 | |
| 10991 | |
| 10992 | |
| 10993 | |
| 10994 | |
| 10995 | |
| 10996 | |
| 10997 | |
| 10998 | |
| 10999 | |
| 11000 | |
| 11001 | |
| 11002 | |
| 11003 | |
| 11004 | |
| 11005 | |
| 11006 | |
| 11007 | |
| 11008 | |
| 11009 | |
| 11010 | |
| 11011 | |
| 11012 | |
| 11013 | |
| 11014 | |
| 11015 | |
| 11016 | |
| 11017 | |
| 11018 | |
| 11019 | |
| 11020 | |
| 11021 | |
| 11022 | |
| 11023 | |
| 11024 | |
| 11025 | |
| 11026 | |
| 11027 | |
| 11028 | |
| 11029 | |
| 11030 | |
| 11031 | |
| 11032 | |
| 11033 | |
| 11034 | |
| 11035 | |
| 11036 | |
| 11037 | |
| 11038 | |
| 11039 | |
| 11040 | |
| 11041 | |
| 11042 | |
| 11043 | |
| 11044 | |
| 11045 | |
| 11046 | |
| 11047 | |
| 11048 | |
| 11049 | |
| 11050 | |
| 11051 | |
| 11052 | |
| 11053 | |
| 11054 | |
| 11055 | |
| 11056 | |
| 11057 | |
| 11058 | |
| 11059 | |
| 11060 | |
| 11061 | |
| 11062 | |
| 11063 | |
| 11064 | |
| 11065 | |
| 11066 | |
| 11067 | |
| 11068 | |
| 11069 | |
| 11070 | |
| 11071 | |
| 11072 | |
| 11073 | |
| 11074 | |
| 11075 | |
| 11076 | |
| 11077 | |
| 11078 | |
| 11079 | |
| 11080 | |
| 11081 | |
| 11082 | |
| 11083 | |
| 11084 | |
| 11085 | |
| 11086 | |
| 11087 | |
| 11088 | |
| 11089 | |
| 11090 | |
| 11091 | |
| 11092 | |
| 11093 | |
| 11094 | |
| 11095 | |
| 11096 | |
| 11097 | |
| 11098 | |
| 11099 | |
| 11100 | |
| 11101 | |
| 11102 | |
| 11103 | |
| 11104 | |
| 11105 | |
| 11106 | |
| 11107 | |
| 11108 | |
| 11109 | |
| 11110 | |
| 11111 | |
| 11112 | |
| 11113 | |
| 11114 | |
| 11115 | |
| 11116 | |
| 11117 | |
| 11118 | |
| 11119 | |
| 11120 | |
| 11121 | |
| 11122 | |
| 11123 | |
| 11124 | |
| 11125 | |
| 11126 | |
| 11127 | |
| 11128 | |
| 11129 | |
| 11130 | |
| 11131 | |
| 11132 | |
| 11133 | |
| 11134 | |
| 11135 | |
| 11136 | |
| 11137 | |
| 11138 | |
| 11139 | |
| 11140 | |
| 11141 | |
| 11142 | |
| 11143 | |
| 11144 | |
| 11145 | |
| 11146 | |
| 11147 | |
| 11148 | |
| 11149 | |
| 11150 | |
| 11151 | |
| 11152 | |
| 11153 | |
| 11154 | |
| 11155 | |
| 11156 | |
| 11157 | |
| 11158 | |
| 11159 | |
| 11160 | |
| 11161 | |
| 11162 | |
| 11163 | |
| 11164 | |
| 11165 | |
| 11166 | |
| 11167 | |
| 11168 | |
| 11169 | |
| 11170 | |
| 11171 | |
| 11172 | |
| 11173 | |
| 11174 | |
| 11175 | |
| 11176 | |
| 11177 | |
| 11178 | |
| 11179 | |
| 11180 | |
| 11181 | |
| 11182 | |
| 11183 | |
| 11184 | |
| 11185 | |
| 11186 | |
| 11187 | |
| 11188 | |
| 11189 | |
| 11190 | |
| 11191 | |
| 11192 | |
| 11193 | |
| 11194 | |
| 11195 | |
| 11196 | |
| 11197 | |
| 11198 | |
| 11199 | |
| 11200 | |
| 11201 | |
| 11202 | |
| 11203 | |
| 11204 | |
| 11205 |