edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! The streaming encoder facade — I11 of `lanes/av1-inter-plan.md`, the |
| 2 | //! surface `edith_replica`'s engine calls in place of rav1e. |
| 3 | //! |
| 4 | //! ONE FRAME OF LATENCY, everywhere: a picture handed to |
| 5 | //! [`Av1Encoder::encode`]/[`Av1Encoder::encode_frames`] is held until the |
| 6 | //! NEXT picture arrives, because an inter frame's per-superblock temporal |
| 7 | //! lambda map reads the next source picture as its lookahead (lane-av1tpl) |
| 8 | //! — exactly as [`crate::encode::encode_sequence`] does, so the facade and |
| 9 | //! the sequence path now code the same bytes for the same pictures. A |
| 10 | //! stream therefore ENDS with [`Av1Encoder::flush`], which codes whatever is |
| 11 | //! still held. [`Av1Encoder::with_pyramid`] holds a whole mini-GOP for the |
| 12 | //! same kind of reason (it reorders pictures) and is driven through |
| 13 | //! [`Av1Encoder::encode_frames`]/[`Av1Encoder::flush`] too. Internally it |
| 14 | //! is [`crate::encode::encode_key_frame_inner`] and |
| 15 | //! [`crate::encode::encode_inter_frame`] driven by a small state machine — |
| 16 | //! a key frame every `gop` pictures, an inter frame predicting from the |
| 17 | //! previous picture's own reconstruction otherwise — which is the same core |
| 18 | //! [`crate::encode::encode_sequence`] uses for its one-key-frame-then-all-inter |
| 19 | //! case; both now share it rather than each padding/cropping/refreshing the |
| 20 | //! reference on their own. |
| 21 | |
| 22 | use ; |
| 23 | use ; |
| 24 | |
| 25 | use crate |
| 26 | |
| 27 | |
| 28 | ; |
| 29 | use crateKEY_FRAME_MODES; |
| 30 | |
| 31 | /// A quantizer step round to nearest: half a step either way costs the same |
| 32 | /// rate, so this is the deadzone every facade-driven frame is coded with. |
| 33 | /// (`crate::encode`'s public entry points take a caller-chosen deadzone |
| 34 | /// instead; the facade has no field for it because nothing downstream of it |
| 35 | /// picks one.) |
| 36 | const DEADZONE: f64 = 0.5; |
| 37 | |
| 38 | /// The colour a played-back frame is transformed by, named at what a |
| 39 | /// container/player picks a colour space from (spec 5.5.2's CICP triple plus |
| 40 | /// range) rather than at the raw integers. `edith_replica`'s rav1e seat sets |
| 41 | /// limited-range BT.709 or BT.601 (`export.rs:3494-3507`); this crate's |
| 42 | /// pre-facade sequence header always wrote [`Colour::Unspecified`]. |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | /// A quality/size targeting surface for callers who would rather not pick a |
| 86 | /// `base_q_idx` themselves, oracled at CRF's own shape (a single "quality" |
| 87 | /// dial that holds a stable perceptual level across content, `ffmpeg -crf`) |
| 88 | /// since a from-scratch scheme is not this lane's charter to invent. |
| 89 | /// [`Av1Encoder::with_rate_target`] is additive: [`EncoderConfig::base_q_idx`] |
| 90 | /// keeps working exactly as before for every existing caller, this is a |
| 91 | /// second, opt-in constructor. |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | /// `quality`'s mapping to `base_q_idx`, linear across the calibration sweep's |
| 153 | /// span (`q_idx` 40 at `quality` 100 down to `q_idx` 240 at `quality` 0); |
| 154 | /// `quality` above 100 clamps to the best point measured, matching a CRF |
| 155 | /// dial's own saturating ends rather than extrapolating past calibrated |
| 156 | /// data. |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | /// What one coded frame is worth, relative to a leaf, as a function of how |
| 163 | /// much FINER than the leaf it is coded (`leaf_q_offset - own offset`, in |
| 164 | /// `q_idx` steps): `exp(WEIGHT_LEVEL_GAIN * delta)`. |
| 165 | /// |
| 166 | /// This is the level model the byte budget is split by, and it is MEASURED, |
| 167 | /// not the old flat "a hidden frame is worth two leaves" guess: the long-GOP |
| 168 | /// census (`lanes/rc.report.md`, films A and B at three quantizers each, |
| 169 | /// `lanes/census-longgop-v2.md`'s q150 row among them) reads a level's |
| 170 | /// bytes/frame as very close to log-linear in its own q offset, at |
| 171 | /// d(ln bytes)/d(q_idx) = -0.0557 -- three and a half times the SLOPE of the |
| 172 | /// controller's own `RateLoop::GAIN` (0.0154), because a deeper level is not |
| 173 | /// just quantized finer, it also carries the group's residual for every |
| 174 | /// frame that predicts off it. |
| 175 | const WEIGHT_LEVEL_GAIN: f64 = 0.0557; |
| 176 | |
| 177 | /// The key frame's own correction on top of `WEIGHT_LEVEL_GAIN`: an intra |
| 178 | /// frame at the key's offset codes this much of what the level model alone |
| 179 | /// predicts (the census's key frames are consistently smaller than the pure |
| 180 | /// exponential, since the exponential is fitted on INTER levels whose size |
| 181 | /// keeps growing with reference depth). |
| 182 | const KEY_WEIGHT: f64 = 1.08; |
| 183 | |
| 184 | /// `EC_AV1_RL_CENSUS=1` — one stderr line per frame the rate loop steers. |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | /// One level of a run, as the re-plan sees it: how much of the run's weight |
| 190 | /// it carries, how much of that is still to be coded, and -- once its |
| 191 | /// effective quantizer has hit the coder's 1..=255 bound -- the leaf- |
| 192 | /// equivalent bytes it actually spends there. |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | |
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | /// The closed-loop controller behind [`RateTarget::BytesPerFrame`] and |
| 220 | /// [`RateTarget::Bitrate`]: a proportional step on `base_q_idx`, sized from |
| 221 | /// the calibration sweep's own log-linear slope (bytes roughly halve every |
| 222 | /// ~45 `q_idx` steps there, i.e. `d(ln bytes)/d(q_idx) ≈ -0.0154`), clamped |
| 223 | /// per frame. Pure proportional — no accumulated error term — is the windup |
| 224 | /// bound itself ([[vorbis-rate-loop-windup]]'s class): the only state carried |
| 225 | /// between frames is `q`, already clamped to `0..=255`, so a quiet lead-in |
| 226 | /// cannot build a debt a later transient has to repay; each frame's step is |
| 227 | /// bounded by `STEP_CLAMP` regardless of history. |
| 228 | /// |
| 229 | /// In pyramid mode the state is kept PER LEVEL: each frame's size is |
| 230 | /// predicted from the previous frame of its own level, against that level's |
| 231 | /// own share of the budget, which is the whole "two-pass-free model" this |
| 232 | /// encoder carries. |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | |
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | |
| 294 | |
| 295 | |
| 296 | |
| 297 | |
| 298 | |
| 299 | |
| 300 | |
| 301 | |
| 302 | |
| 303 | |
| 304 | |
| 305 | |
| 306 | |
| 307 | |
| 308 | |
| 309 | |
| 310 | |
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | |
| 316 | |
| 317 | |
| 318 | |
| 319 | |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | |
| 337 | |
| 338 | |
| 339 | |
| 340 | |
| 341 | |
| 342 | |
| 343 | |
| 344 | |
| 345 | |
| 346 | |
| 347 | |
| 348 | |
| 349 | |
| 350 | |
| 351 | |
| 352 | |
| 353 | |
| 354 | |
| 355 | |
| 356 | |
| 357 | |
| 358 | |
| 359 | |
| 360 | |
| 361 | |
| 362 | |
| 363 | |
| 364 | |
| 365 | |
| 366 | |
| 367 | |
| 368 | |
| 369 | |
| 370 | |
| 371 | |
| 372 | |
| 373 | |
| 374 | |
| 375 | |
| 376 | |
| 377 | |
| 378 | |
| 379 | |
| 380 | |
| 381 | |
| 382 | |
| 383 | |
| 384 | |
| 385 | |
| 386 | |
| 387 | |
| 388 | |
| 389 | |
| 390 | |
| 391 | |
| 392 | |
| 393 | |
| 394 | |
| 395 | |
| 396 | |
| 397 | |
| 398 | |
| 399 | |
| 400 | |
| 401 | |
| 402 | |
| 403 | |
| 404 | |
| 405 | |
| 406 | |
| 407 | |
| 408 | |
| 409 | |
| 410 | |
| 411 | |
| 412 | |
| 413 | |
| 414 | |
| 415 | |
| 416 | |
| 417 | |
| 418 | |
| 419 | |
| 420 | |
| 421 | |
| 422 | |
| 423 | |
| 424 | |
| 425 | |
| 426 | |
| 427 | |
| 428 | |
| 429 | |
| 430 | |
| 431 | |
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | |
| 437 | |
| 438 | |
| 439 | |
| 440 | |
| 441 | |
| 442 | |
| 443 | |
| 444 | |
| 445 | |
| 446 | |
| 447 | |
| 448 | |
| 449 | |
| 450 | |
| 451 | |
| 452 | |
| 453 | |
| 454 | |
| 455 | |
| 456 | |
| 457 | |
| 458 | |
| 459 | |
| 460 | |
| 461 | |
| 462 | |
| 463 | |
| 464 | |
| 465 | |
| 466 | |
| 467 | |
| 468 | |
| 469 | |
| 470 | |
| 471 | |
| 472 | |
| 473 | |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | |
| 479 | |
| 480 | |
| 481 | |
| 482 | |
| 483 | |
| 484 | |
| 485 | |
| 486 | |
| 487 | |
| 488 | |
| 489 | |
| 490 | |
| 491 | |
| 492 | |
| 493 | |
| 494 | |
| 495 | |
| 496 | |
| 497 | |
| 498 | |
| 499 | |
| 500 | |
| 501 | |
| 502 | |
| 503 | |
| 504 | |
| 505 | |
| 506 | |
| 507 | |
| 508 | |
| 509 | |
| 510 | |
| 511 | |
| 512 | |
| 513 | |
| 514 | |
| 515 | |
| 516 | |
| 517 | |
| 518 | |
| 519 | |
| 520 | |
| 521 | |
| 522 | |
| 523 | |
| 524 | |
| 525 | |
| 526 | |
| 527 | |
| 528 | |
| 529 | |
| 530 | |
| 531 | |
| 532 | |
| 533 | |
| 534 | |
| 535 | |
| 536 | |
| 537 | |
| 538 | |
| 539 | |
| 540 | |
| 541 | |
| 542 | |
| 543 | |
| 544 | |
| 545 | |
| 546 | |
| 547 | |
| 548 | |
| 549 | |
| 550 | |
| 551 | |
| 552 | |
| 553 | |
| 554 | |
| 555 | |
| 556 | /// What [`Av1Encoder::new`] takes: geometry, rate, key-frame cadence and |
| 557 | /// colour. `base_q_idx` is picked directly (0..=255, `crate::encode`'s own |
| 558 | /// unit) rather than a bitrate — a bitrate control loop is not part of this |
| 559 | /// lane's charter, and a caller that wants one can still derive a |
| 560 | /// `base_q_idx` from its own target and set that field. A caller who wants |
| 561 | /// [`RateTarget`]'s quality/size dials instead of picking `base_q_idx` |
| 562 | /// itself uses [`Av1Encoder::with_rate_target`], which still starts from an |
| 563 | /// `EncoderConfig` (its `base_q_idx` is the loop's seed/fallback for |
| 564 | /// [`RateTarget::BytesPerFrame`], and is overwritten outright for the other |
| 565 | /// two variants). |
| 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 | /// One coded picture: its OBUs, in the order a demuxer that just wants bytes |
| 609 | /// on the wire can concatenate them, and the two things a muxer needs to |
| 610 | /// know without parsing them back out. |
| 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 | /// One mini-GOP of a two-level coding pyramid, and the quantizer offsets its |
| 638 | /// two levels are coded at. libaom's `gf_group` shape, cut down to the two |
| 639 | /// levels this encoder's reference set can carry: the last picture of each |
| 640 | /// mini-GOP is coded FIRST, hidden (`show_frame == 0`), as the group's |
| 641 | /// `ALTREF_FRAME`, then the pictures before it are coded as shown leaves that |
| 642 | /// may predict backward off it, and finally a `show_existing_frame` header |
| 643 | /// re-outputs the hidden frame in its own display position. |
| 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 | /// How many pictures the mini-GOP now being collected takes, given how many |
| 688 | /// are left in this run (the pictures before the next key frame) and the |
| 689 | /// [`Pyramid::mini_gop`] shape. |
| 690 | /// |
| 691 | /// A fixed `mini_gop` leaves a SHORT TAIL group whenever the run is not a |
| 692 | /// multiple of it: a 12-picture GOP under `mini_gop` 8 codes 8 + 3, and that |
| 693 | /// 3-picture tail is the expensive part -- the 12-frame gate preferred one |
| 694 | /// group of 11 by 7.0 / 20.5 BD points while the 48-frame gate picked 8 |
| 695 | /// (lane-pyr4). The rule here ABSORBS a tail shorter than half a group into |
| 696 | /// the group before it, so a run takes groups of `mini_gop` until at most |
| 697 | /// 1.5 x `mini_gop` is left and then one final group of all of it: |
| 698 | /// remaining 11 under 8 -> 11 (was 8 + 3) |
| 699 | /// remaining 47 under 8 -> 8, 8, 8, 8, 8, 7 -- what the fixed rule already |
| 700 | /// coded, so a long GOP is byte-identical |
| 701 | /// (`the_mini_gop_layout_leaves_no_short_tail`; sweep `lanes/gopad.sweep.txt`). |
| 702 | /// |
| 703 | /// `EC_AV1_GOP_LAYOUT=fixed` restores the old fixed-size rule for an A/B. |
| 704 | |
| 705 | |
| 706 | |
| 707 | |
| 708 | |
| 709 | |
| 710 | |
| 711 | /// How one GOP of `gop` pictures is actually coded, as [`Av1Encoder::encode_frames`] |
| 712 | /// and [`Av1Encoder::drain_pending`] lay it out: the HIDDEN frames as |
| 713 | /// `(q offset, count)` (the group's top `ALTREF`, the mid level and the two |
| 714 | /// quarter-point ARFs, each at its own offset) and the number of shown |
| 715 | /// leaves. The key frame is the remaining picture and is not listed. |
| 716 | /// |
| 717 | /// This is what [`RateLoop::new`] prices the run by, so the two must agree on |
| 718 | /// the gating rules -- a mid level needs three leaves and a run longer than |
| 719 | /// 1.5 mini-GOPs, quarters need seven leaves and a mid -- which |
| 720 | /// `the_rate_loop_prices_the_frames_the_pyramid_codes` pins against the real |
| 721 | /// packet stream. |
| 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 | /// Whether this run absorbs a short tail group (the default) or cuts every |
| 753 | /// mini-GOP at `mini_gop`: `EC_AV1_GOP_LAYOUT=fixed`, read once. |
| 754 | |
| 755 | |
| 756 | |
| 757 | |
| 758 | |
| 759 | |
| 760 | |
| 761 | |
| 762 | |
| 763 | |
| 764 | |
| 765 | |
| 766 | |
| 767 | |
| 768 | |
| 769 | |
| 770 | |
| 771 | |
| 772 | |
| 773 | |
| 774 | |
| 775 | |
| 776 | |
| 777 | |
| 778 | |
| 779 | |
| 780 | |
| 781 | |
| 782 | |
| 783 | |
| 784 | |
| 785 | |
| 786 | |
| 787 | |
| 788 | |
| 789 | |
| 790 | |
| 791 | |
| 792 | |
| 793 | |
| 794 | |
| 795 | |
| 796 | |
| 797 | |
| 798 | |
| 799 | |
| 800 | |
| 801 | |
| 802 | |
| 803 | |
| 804 | |
| 805 | |
| 806 | |
| 807 | |
| 808 | |
| 809 | |
| 810 | |
| 811 | |
| 812 | |
| 813 | |
| 814 | |
| 815 | |
| 816 | |
| 817 | |
| 818 | |
| 819 | |
| 820 | |
| 821 | |
| 822 | |
| 823 | |
| 824 | |
| 825 | |
| 826 | |
| 827 | |
| 828 | |
| 829 | |
| 830 | |
| 831 | |
| 832 | |
| 833 | |
| 834 | |
| 835 | |
| 836 | |
| 837 | |
| 838 | |
| 839 | |
| 840 | |
| 841 | |
| 842 | |
| 843 | |
| 844 | |
| 845 | |
| 846 | |
| 847 | |
| 848 | |
| 849 | |
| 850 | |
| 851 | |
| 852 | |
| 853 | |
| 854 | |
| 855 | |
| 856 | |
| 857 | |
| 858 | |
| 859 | |
| 860 | |
| 861 | |
| 862 | |
| 863 | |
| 864 | |
| 865 | |
| 866 | |
| 867 | |
| 868 | |
| 869 | |
| 870 | |
| 871 | |
| 872 | |
| 873 | |
| 874 | |
| 875 | |
| 876 | |
| 877 | |
| 878 | |
| 879 | |
| 880 | |
| 881 | |
| 882 | |
| 883 | |
| 884 | |
| 885 | |
| 886 | |
| 887 | |
| 888 | |
| 889 | |
| 890 | |
| 891 | |
| 892 | |
| 893 | |
| 894 | |
| 895 | |
| 896 | |
| 897 | |
| 898 | |
| 899 | |
| 900 | |
| 901 | |
| 902 | |
| 903 | |
| 904 | |
| 905 | |
| 906 | |
| 907 | |
| 908 | |
| 909 | |
| 910 | |
| 911 | |
| 912 | |
| 913 | |
| 914 | |
| 915 | |
| 916 | |
| 917 | |
| 918 | |
| 919 | |
| 920 | |
| 921 | |
| 922 | |
| 923 | |
| 924 | |
| 925 | |
| 926 | |
| 927 | |
| 928 | |
| 929 | |
| 930 | |
| 931 | |
| 932 | |
| 933 | |
| 934 | |
| 935 | |
| 936 | |
| 937 | |
| 938 | |
| 939 | |
| 940 | |
| 941 | |
| 942 | |
| 943 | |
| 944 | |
| 945 | |
| 946 | |
| 947 | |
| 948 | |
| 949 | |
| 950 | |
| 951 | |
| 952 | |
| 953 | |
| 954 | |
| 955 | |
| 956 | |
| 957 | |
| 958 | |
| 959 | |
| 960 | |
| 961 | |
| 962 | |
| 963 | |
| 964 | |
| 965 | |
| 966 | |
| 967 | |
| 968 | |
| 969 | |
| 970 | |
| 971 | |
| 972 | |
| 973 | |
| 974 | |
| 975 | |
| 976 | |
| 977 | |
| 978 | |
| 979 | |
| 980 | |
| 981 | |
| 982 | |
| 983 | |
| 984 | |
| 985 | |
| 986 | |
| 987 | |
| 988 | |
| 989 | |
| 990 | |
| 991 | |
| 992 | |
| 993 | |
| 994 | |
| 995 | |
| 996 | |
| 997 | |
| 998 | |
| 999 | |
| 1000 | |
| 1001 | |
| 1002 | |
| 1003 | |
| 1004 | |
| 1005 | |
| 1006 | |
| 1007 | |
| 1008 | |
| 1009 | |
| 1010 | |
| 1011 | |
| 1012 | |
| 1013 | |
| 1014 | |
| 1015 | |
| 1016 | |
| 1017 | |
| 1018 | |
| 1019 | |
| 1020 | |
| 1021 | |
| 1022 | |
| 1023 | |
| 1024 | |
| 1025 | |
| 1026 | |
| 1027 | |
| 1028 | |
| 1029 | |
| 1030 | |
| 1031 | |
| 1032 | |
| 1033 | |
| 1034 | |
| 1035 | |
| 1036 | |
| 1037 | |
| 1038 | |
| 1039 | |
| 1040 | |
| 1041 | |
| 1042 | |
| 1043 | |
| 1044 | |
| 1045 | |
| 1046 | |
| 1047 | |
| 1048 | |
| 1049 | |
| 1050 | |
| 1051 | |
| 1052 | |
| 1053 | |
| 1054 | |
| 1055 | |
| 1056 | |
| 1057 | |
| 1058 | |
| 1059 | |
| 1060 | |
| 1061 | |
| 1062 | |
| 1063 | |
| 1064 | |
| 1065 | |
| 1066 | |
| 1067 | |
| 1068 | |
| 1069 | |
| 1070 | |
| 1071 | |
| 1072 | |
| 1073 | |
| 1074 | |
| 1075 | |
| 1076 | |
| 1077 | |
| 1078 | |
| 1079 | |
| 1080 | |
| 1081 | |
| 1082 | |
| 1083 | |
| 1084 | |
| 1085 | |
| 1086 | |
| 1087 | |
| 1088 | |
| 1089 | |
| 1090 | |
| 1091 | |
| 1092 | |
| 1093 | |
| 1094 | |
| 1095 | |
| 1096 | |
| 1097 | |
| 1098 | |
| 1099 | |
| 1100 | |
| 1101 | |
| 1102 | |
| 1103 | |
| 1104 | |
| 1105 | /// Which level of the pyramid a coded frame sits at, reported on every |
| 1106 | /// [`Packet`] so a caller (and the BD gate's histogram) can tell them apart |
| 1107 | /// without parsing the frame headers back out. |
| 1108 | |
| 1109 | |
| 1110 | |
| 1111 | |
| 1112 | |
| 1113 | |
| 1114 | |
| 1115 | |
| 1116 | |
| 1117 | |
| 1118 | |
| 1119 | |
| 1120 | |
| 1121 | /// The DPB slot the group anchors alternate between (see |
| 1122 | /// [`Av1Encoder::encode_frames`]): the hidden frame of group `g` refreshes |
| 1123 | /// `ANCHOR_SLOTS[(g + 1) % 2]`, which is the slot the leaves of group `g` |
| 1124 | /// name as `ALTREF_FRAME` and which group `g + 1` reads as its own anchor. |
| 1125 | /// Two slots alternate because a group's leaves must still be able to read |
| 1126 | /// the previous anchor while the new one is already written. |
| 1127 | const ANCHOR_SLOTS: = ; |
| 1128 | |
| 1129 | /// The slot the leaf chain refreshes and reads as `LAST_FRAME`. |
| 1130 | const LEAF_SLOT: u8 = 0; |
| 1131 | |
| 1132 | /// lane-last2: the two slots the leaf chain alternates its refresh between |
| 1133 | /// once [`last2`] is on, so that the shown frame BEFORE `LAST_FRAME` is still |
| 1134 | /// in the DPB and can be named `LAST2_FRAME`. Slot 7 is the one the key frame |
| 1135 | /// writes and nothing has ever read back, so this costs no other level a slot; |
| 1136 | /// leaf `k` refreshes `LEAF_SLOTS[k % 2]`, which is the slot leaf `k - 2` |
| 1137 | /// wrote -- read before write, spec 7.20's decode order. |
| 1138 | const LEAF_SLOTS: = ; |
| 1139 | |
| 1140 | /// Whether the leaf chain retains that second past picture and offers it to |
| 1141 | /// the block search as `LAST2_FRAME` (`EC_AV1_LAST2=0` / `=1`). The census |
| 1142 | /// that priced the lever is `lanes/refs.report.md` §1; what it buys on the |
| 1143 | /// gate is `lanes/last2.report.md`. |
| 1144 | |
| 1145 | |
| 1146 | |
| 1147 | |
| 1148 | |
| 1149 | |
| 1150 | |
| 1151 | |
| 1152 | |
| 1153 | |
| 1154 | |
| 1155 | |
| 1156 | /// A PROCESS-GLOBAL [`last2`] override that wins over the environment |
| 1157 | /// (`u8::MAX` = unset), the shape `crate::encode::set_frame_interp` has -- |
| 1158 | /// this crate's tests never call `set_var` (`crate::envflags`), so the |
| 1159 | /// witness turns the lever on through this while holding |
| 1160 | /// [`crate::speed::knob_write`]. |
| 1161 | static LAST2_OVERRIDE: AtomicU8 = new; |
| 1162 | |
| 1163 | /// Sets [`LAST2_OVERRIDE`]; `None` clears it. |
| 1164 | // set only from the `#[cfg(test)]` witness |
| 1165 | pub |
| 1166 | |
| 1167 | |
| 1168 | |
| 1169 | |
| 1170 | |
| 1171 | |
| 1172 | /// [`last2`]'s default. |
| 1173 | const LAST2: bool = false; |
| 1174 | |
| 1175 | /// The slot the mid-level hidden frame of a three-level group refreshes |
| 1176 | /// ([`Pyramid::mid_q_offset`]): free of the two anchors (3, 4), of the leaf |
| 1177 | /// chain (0) and of `GOLDEN_SLOT` (1), so all four levels are live at once. |
| 1178 | const MID_SLOT: u8 = 2; |
| 1179 | |
| 1180 | /// The two slots the QUARTER-POINT hidden frames refresh |
| 1181 | /// ([`Pyramid::quarter_q_offset`]). THE WHOLE SLOT MAP, with all four levels |
| 1182 | /// live at once: |
| 1183 | /// |
| 1184 | /// | slot | holds | written by | read as | |
| 1185 | /// |---|---|---|---| |
| 1186 | /// | 0 (`LEAF_SLOT`) | the previous shown leaf | every leaf | `LAST_FRAME` of the next leaf | |
| 1187 | /// | 1 (`GOLDEN_SLOT`) | the key frame | the key | `GOLDEN_FRAME` everywhere | |
| 1188 | /// | 2 (`MID_SLOT`) | the mid ARF | the mid ARF | `LAST_FRAME` / `ALTREF_FRAME` of the leaves and quarters around it | |
| 1189 | /// | 3, 4 (`ANCHOR_SLOTS`) | this group's anchor and the next one (the top ARF) | the key, each top ARF | anchor = `LAST_FRAME`, next = `ALTREF_FRAME` | |
| 1190 | /// | 5, 6 (`QUARTER_SLOTS`) | the first and second quarter ARF | the quarter ARFs | `LAST_FRAME` / `ALTREF_FRAME` of the leaves beside them | |
| 1191 | /// | 7 | unused (the key's copy is never read back) | the key | -- | |
| 1192 | /// |
| 1193 | /// A frame names exactly two of them plus `GOLDEN_SLOT` |
| 1194 | /// ([`Av1Encoder::encode_pyramid_inter`] fills all seven `ref_frame_idx` |
| 1195 | /// entries from `last_slot`/`altref_slot`), and `refresh_frame_flags` is the |
| 1196 | /// single `self_slot` bit, so no level ever overwrites a slot another level |
| 1197 | /// is still reading. |
| 1198 | const QUARTER_SLOTS: = ; |
| 1199 | |
| 1200 | /// [`Pyramid::default`]'s fourth level (`None` = the three-level pyramid). |
| 1201 | /// The long-GOP sweep's winner (`lanes/pyr6.sweep.txt`). |
| 1202 | const QUARTER_DEFAULT: = None; |
| 1203 | |
| 1204 | /// [`Pyramid::default`]'s third level (`None` = the two-level pyramid), the |
| 1205 | /// long-GOP sweep's winner (`lanes/pyr5.sweep.txt`): every one of the four |
| 1206 | /// long-GOP columns improves against the two-level shape, film B (the wider |
| 1207 | /// gap) by 6.0 / 2.4 BD points. |
| 1208 | const MID_DEFAULT: = Some; |
| 1209 | |
| 1210 | /// [`Pyramid::default`]'s key-frame offset: the long-GOP sweep's winner |
| 1211 | /// (`lanes/keyq.sweep.txt`, 48 pictures, gop 48, BD-rate vs libaom cpu-used 6 |
| 1212 | /// / vs rav1e speed 6), which the 12-frame gate agrees with, so it is NOT |
| 1213 | /// gated on GOP length the way the third level is: |
| 1214 | /// |
| 1215 | /// | key offset | film A (48) | film B (48) | film A (12) | film B (12) | |
| 1216 | /// |---|---|---|---|---| |
| 1217 | /// | 0 (base q) | +52.0 / +11.7 | +144.5 / +44.3 | +43.3 / +15.0 | +66.9 / +35.1 | |
| 1218 | /// | -16 | +48.8 / +9.4 | +138.0 / +40.2 | | | |
| 1219 | /// | -32 | +45.3 / +6.7 | +132.8 / +36.8 | | | |
| 1220 | /// | -48 | +43.5 / +4.6 | +131.3 / +35.0 | +38.5 / +8.2 | +58.2 / +26.5 | |
| 1221 | /// | -64 | +44.9 / +3.8 | +140.7 / +37.5 | | | |
| 1222 | /// |
| 1223 | /// `-64` overshoots on film B, and a deeper ARF (`-40`) under the same key |
| 1224 | /// gives bytes back on both films (+44.4 / +5.1, +137.4 / +38.6), so what the |
| 1225 | /// group was short of is the ANCHOR, not more ARF. The bars rows move by |
| 1226 | /// 0.3 / 0.6 BD points and the screen capture is byte-identical (its pyramid |
| 1227 | /// is gated off). |
| 1228 | const KEY_DEFAULT: i16 = -48; |
| 1229 | |
| 1230 | /// Whether the pyramid path hands each frame a lookahead window, i.e. |
| 1231 | /// whether the temporal lambda map (`encode::tpl_lambda_factors`) runs on |
| 1232 | /// the DEFAULT stream at all. It did not until lane-arfcen: the pyramid |
| 1233 | /// reorders pictures, so this path passed `&[]` and the map -- measured and |
| 1234 | /// shipped on the flat path -- was inert on every frame of every pyramid |
| 1235 | /// stream, including the ARFs that carry 54% of a long-GOP stream's bytes |
| 1236 | /// (class `tool disabled in every gate recipe`). |
| 1237 | /// lane-arfpred: the top ARF source temporal filter's strength |
| 1238 | /// ([`crate::speed::ARF_TF`]), `EC_AV1_ARF_TF=<strength>` overriding it; |
| 1239 | /// `0` is off. |
| 1240 | |
| 1241 | |
| 1242 | |
| 1243 | |
| 1244 | |
| 1245 | |
| 1246 | |
| 1247 | /// lane-arftf: the same filter's strength on the MID ARF, whose own window |
| 1248 | /// is the display-FUTURE leaves of its group (`tpl_window(at, false)`). |
| 1249 | /// `EC_AV1_ARF_TF_MID=<strength>` overrides [`crate::speed::ARF_TF_MID`]; |
| 1250 | /// `0` is off. |
| 1251 | |
| 1252 | |
| 1253 | |
| 1254 | |
| 1255 | |
| 1256 | |
| 1257 | |
| 1258 | /// lane-arftf: how many of the window's pictures the filter averages in |
| 1259 | /// ([`crate::speed::ARF_TF_WIN`], `EC_AV1_ARF_TF_WIN=<n>`). The top ARF's |
| 1260 | /// window holds only DISPLAY-PAST neighbours -- it is the group's last |
| 1261 | /// picture and the next group's sources are not buffered when it is coded -- |
| 1262 | /// so this widens the filter backwards only. |
| 1263 | pub |
| 1264 | |
| 1265 | |
| 1266 | |
| 1267 | |
| 1268 | |
| 1269 | |
| 1270 | /// lane-lookahead: how many DISPLAY-FUTURE neighbours the top ARF's filter |
| 1271 | /// takes out of the buffered next group ([`crate::speed::ARF_TF_WIN_FUT`], |
| 1272 | /// `EC_AV1_ARF_TF_WIN_FUT=<n>`). Inert without [`lookahead`]. |
| 1273 | pub |
| 1274 | |
| 1275 | |
| 1276 | |
| 1277 | |
| 1278 | |
| 1279 | |
| 1280 | |
| 1281 | |
| 1282 | |
| 1283 | |
| 1284 | /// PROCESS-GLOBAL overrides of the two lane-lookahead knobs, the shape |
| 1285 | /// [`set_last2`] has (this crate's tests never call `set_var`); `u8::MAX` / |
| 1286 | /// `usize::MAX` is unset, and a witness holds [`crate::speed::knob_write`] |
| 1287 | /// while it uses them. |
| 1288 | static LOOKAHEAD_OVERRIDE: AtomicU8 = new; |
| 1289 | static ARF_TF_FUT_OVERRIDE: AtomicUsize = |
| 1290 | new; |
| 1291 | static TPL_FUT_OVERRIDE: AtomicUsize = |
| 1292 | new; |
| 1293 | |
| 1294 | /// Sets [`LOOKAHEAD_OVERRIDE`]; `None` clears it. |
| 1295 | // set only from the `#[cfg(test)]` witness |
| 1296 | pub |
| 1297 | |
| 1298 | |
| 1299 | |
| 1300 | |
| 1301 | |
| 1302 | |
| 1303 | /// Sets [`ARF_TF_FUT_OVERRIDE`]; `None` clears it. |
| 1304 | // set only from the `#[cfg(test)]` witness |
| 1305 | pub |
| 1306 | |
| 1307 | |
| 1308 | |
| 1309 | |
| 1310 | |
| 1311 | |
| 1312 | /// Sets [`TPL_FUT_OVERRIDE`]; `None` clears it. |
| 1313 | // set only from the `#[cfg(test)]` witness |
| 1314 | pub |
| 1315 | |
| 1316 | |
| 1317 | |
| 1318 | |
| 1319 | |
| 1320 | |
| 1321 | /// lane-tplfut: which window the TOP ARF's temporal lambda map propagates |
| 1322 | /// back through ([`crate::speed::TPL_FUT`], `EC_AV1_TPL_FUT=<n>`). Inert |
| 1323 | /// without [`lookahead`] -- mode 0 is the shipped past window. |
| 1324 | pub |
| 1325 | |
| 1326 | |
| 1327 | |
| 1328 | |
| 1329 | |
| 1330 | |
| 1331 | |
| 1332 | |
| 1333 | |
| 1334 | |
| 1335 | /// lane-tplhalf: mode 2's split -- how many display-PAST neighbours the top |
| 1336 | /// ARF's window opens with, the rest of the budget coming from the buffered |
| 1337 | /// future ([`crate::speed::TPL_FUT_HALF`], `EC_AV1_TPL_FUT_HALF=<n>`). |
| 1338 | pub |
| 1339 | |
| 1340 | |
| 1341 | |
| 1342 | |
| 1343 | |
| 1344 | |
| 1345 | /// lane-tplhalf: how many entries mode 2's window holds in total, `0` meaning |
| 1346 | /// `tpl_depth() - 1` -- the ARF window's budget alone, so raising it does not |
| 1347 | /// deepen every other frame's lambda pass the way `EC_AV1_TPL_D` does |
| 1348 | /// ([`crate::speed::TPL_FUT_WIN`], `EC_AV1_TPL_FUT_WIN=<n>`). |
| 1349 | pub |
| 1350 | |
| 1351 | |
| 1352 | |
| 1353 | |
| 1354 | |
| 1355 | |
| 1356 | |
| 1357 | |
| 1358 | |
| 1359 | |
| 1360 | /// lane-lookahead: whether the pyramid path holds one group of lookahead |
| 1361 | /// ([`crate::speed::LOOKAHEAD`], `EC_AV1_LOOKAHEAD=0|1`). |
| 1362 | |
| 1363 | |
| 1364 | |
| 1365 | |
| 1366 | |
| 1367 | |
| 1368 | |
| 1369 | |
| 1370 | |
| 1371 | |
| 1372 | |
| 1373 | |
| 1374 | |
| 1375 | |
| 1376 | |
| 1377 | |
| 1378 | |
| 1379 | |
| 1380 | |
| 1381 | /// [`tpl_pyramid`]'s default. |
| 1382 | const TPL_PYRAMID: bool = true; |
| 1383 | |
| 1384 | /// Whether a group's TOP ARF names the ARF from TWO groups back as its own |
| 1385 | /// `ALTREF_FRAME` (lane-arfcen). It has always named `GOLDEN_SLOT` there, |
| 1386 | /// which for a top ARF is the key frame it already reads as `GOLDEN`, i.e. |
| 1387 | /// its second reference is the same picture as its first for the first group |
| 1388 | /// and adds nothing after: the ARF-vs-ARF census reads |
| 1389 | /// `LAST@-8 GOLDEN@-8` on our first ARF where rav1e's reads two DISTINCT |
| 1390 | /// anchors. The slot the ARF is about to refresh still holds that older |
| 1391 | /// anchor while this frame is coded, so naming it costs no extra DPB slot. |
| 1392 | |
| 1393 | |
| 1394 | |
| 1395 | |
| 1396 | |
| 1397 | |
| 1398 | |
| 1399 | /// [`arf_altref`]'s default. ON since its long-GOP arm: film A |
| 1400 | /// +42.8%/+4.5% -> +40.9%/+3.1% and film B +127.3%/+32.9% -> +125.6%/+32.0% |
| 1401 | /// (BD vs libaom cpu-used 6 / vs rav1e speed 6), i.e. both films down on both |
| 1402 | /// columns. |
| 1403 | const ARF_ALTREF: bool = true; |
| 1404 | |
| 1405 | /// The AV1 software encoder: [`EncoderConfig`] in, one [`Packet`] out per |
| 1406 | /// [`Av1Encoder::encode`] call — or, with a [`Pyramid`] configured, a |
| 1407 | /// coding-order burst of them per [`Av1Encoder::encode_frames`] call plus a |
| 1408 | /// [`Av1Encoder::flush`] at the end of the stream. |
| 1409 | |
| 1410 | |
| 1411 | |
| 1412 | |
| 1413 | |
| 1414 | |
| 1415 | |
| 1416 | |
| 1417 | |
| 1418 | |
| 1419 | |
| 1420 | |
| 1421 | |
| 1422 | |
| 1423 | |
| 1424 | |
| 1425 | |
| 1426 | |
| 1427 | |
| 1428 | |
| 1429 | |
| 1430 | |
| 1431 | |
| 1432 | |
| 1433 | |
| 1434 | |
| 1435 | |
| 1436 | |
| 1437 | |
| 1438 | |
| 1439 | |
| 1440 | |
| 1441 | |
| 1442 | |
| 1443 | |
| 1444 | |
| 1445 | |
| 1446 | |
| 1447 | |
| 1448 | |
| 1449 | |
| 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 | /// One decoded-picture-buffer slot: what a `refresh_frame_flags` bit stores |
| 1479 | /// and what a `ref_frame_idx` entry reads back. |
| 1480 | /// |
| 1481 | /// lane-av1enchang: the `CdfSnapshot` is BOXED, not held by value. Eight |
| 1482 | /// inline copies made [`Av1Encoder`] 139960 bytes, and that struct is |
| 1483 | /// returned by value through three nested `Result<Self>` constructors |
| 1484 | /// ([`Av1Encoder::with_pyramid_and_rate_target`] -> |
| 1485 | /// [`Av1Encoder::with_pyramid`] -> [`Av1Encoder::new`]), so an unoptimized |
| 1486 | /// build put several of those on the stack at once: the pyramid path |
| 1487 | /// overflowed libtest's 2 MiB test thread and aborted the whole crate suite |
| 1488 | /// with `fatal runtime error: stack overflow`. One heap box per DPB slot |
| 1489 | /// brings the struct from 139960 bytes down to 18168 (measured). The tables' |
| 1490 | /// VALUES are untouched. |
| 1491 | |
| 1492 | |
| 1493 | |
| 1494 | |
| 1495 | |
| 1496 | |
| 1497 | |
| 1498 | /// The encoder stays `Send` now that it owns a `FrameCtx` (whose cells are |
| 1499 | /// `Send` but `!Sync`): it can move to another thread, it just cannot be |
| 1500 | /// shared by reference across threads. |
| 1501 | const _: fn = |
| 1502 | |
| 1503 | |
| 1504 | ; |
| 1505 | |
| 1506 | |
| 1507 | |
| 1508 | |
| 1509 | |
| 1510 | |
| 1511 | |
| 1512 | |
| 1513 | |
| 1514 | |
| 1515 | |
| 1516 | |
| 1517 | |
| 1518 | |
| 1519 | |
| 1520 | |
| 1521 | |
| 1522 | |
| 1523 | |
| 1524 | |
| 1525 | |
| 1526 | |
| 1527 | |
| 1528 | |
| 1529 | |
| 1530 | |
| 1531 | |
| 1532 | |
| 1533 | |
| 1534 | |
| 1535 | |
| 1536 | |
| 1537 | |
| 1538 | |
| 1539 | |
| 1540 | |
| 1541 | |
| 1542 | |
| 1543 | |
| 1544 | |
| 1545 | |
| 1546 | |
| 1547 | |
| 1548 | |
| 1549 | |
| 1550 | |
| 1551 | |
| 1552 | |
| 1553 | |
| 1554 | |
| 1555 | |
| 1556 | |
| 1557 | |
| 1558 | |
| 1559 | |
| 1560 | |
| 1561 | |
| 1562 | |
| 1563 | |
| 1564 | |
| 1565 | |
| 1566 | |
| 1567 | |
| 1568 | |
| 1569 | |
| 1570 | |
| 1571 | |
| 1572 | |
| 1573 | |
| 1574 | |
| 1575 | |
| 1576 | |
| 1577 | |
| 1578 | |
| 1579 | |
| 1580 | |
| 1581 | |
| 1582 | |
| 1583 | |
| 1584 | |
| 1585 | |
| 1586 | |
| 1587 | |
| 1588 | |
| 1589 | |
| 1590 | |
| 1591 | |
| 1592 | |
| 1593 | |
| 1594 | |
| 1595 | |
| 1596 | |
| 1597 | |
| 1598 | |
| 1599 | |
| 1600 | |
| 1601 | |
| 1602 | |
| 1603 | |
| 1604 | |
| 1605 | |
| 1606 | |
| 1607 | |
| 1608 | |
| 1609 | |
| 1610 | |
| 1611 | |
| 1612 | |
| 1613 | |
| 1614 | |
| 1615 | |
| 1616 | |
| 1617 | |
| 1618 | |
| 1619 | |
| 1620 | |
| 1621 | |
| 1622 | |
| 1623 | |
| 1624 | |
| 1625 | |
| 1626 | |
| 1627 | |
| 1628 | |
| 1629 | |
| 1630 | |
| 1631 | |
| 1632 | |
| 1633 | |
| 1634 | |
| 1635 | |
| 1636 | |
| 1637 | |
| 1638 | |
| 1639 | |
| 1640 | |
| 1641 | |
| 1642 | |
| 1643 | |
| 1644 | |
| 1645 | |
| 1646 | |
| 1647 | |
| 1648 | |
| 1649 | |
| 1650 | |
| 1651 | |
| 1652 | |
| 1653 | |
| 1654 | |
| 1655 | |
| 1656 | |
| 1657 | |
| 1658 | |
| 1659 | |
| 1660 | |
| 1661 | |
| 1662 | |
| 1663 | |
| 1664 | |
| 1665 | |
| 1666 | |
| 1667 | |
| 1668 | |
| 1669 | |
| 1670 | |
| 1671 | |
| 1672 | |
| 1673 | |
| 1674 | |
| 1675 | |
| 1676 | |
| 1677 | |
| 1678 | |
| 1679 | |
| 1680 | |
| 1681 | |
| 1682 | |
| 1683 | |
| 1684 | |
| 1685 | |
| 1686 | |
| 1687 | |
| 1688 | |
| 1689 | |
| 1690 | |
| 1691 | |
| 1692 | |
| 1693 | |
| 1694 | |
| 1695 | |
| 1696 | |
| 1697 | |
| 1698 | |
| 1699 | |
| 1700 | |
| 1701 | |
| 1702 | |
| 1703 | |
| 1704 | |
| 1705 | |
| 1706 | |
| 1707 | |
| 1708 | |
| 1709 | |
| 1710 | |
| 1711 | |
| 1712 | |
| 1713 | |
| 1714 | |
| 1715 | |
| 1716 | |
| 1717 | |
| 1718 | |
| 1719 | |
| 1720 | |
| 1721 | |
| 1722 | |
| 1723 | |
| 1724 | |
| 1725 | |
| 1726 | |
| 1727 | |
| 1728 | |
| 1729 | |
| 1730 | |
| 1731 | |
| 1732 | |
| 1733 | |
| 1734 | |
| 1735 | |
| 1736 | |
| 1737 | |
| 1738 | |
| 1739 | |
| 1740 | |
| 1741 | |
| 1742 | |
| 1743 | |
| 1744 | |
| 1745 | |
| 1746 | |
| 1747 | |
| 1748 | |
| 1749 | |
| 1750 | |
| 1751 | |
| 1752 | |
| 1753 | |
| 1754 | |
| 1755 | |
| 1756 | |
| 1757 | |
| 1758 | |
| 1759 | |
| 1760 | |
| 1761 | |
| 1762 | |
| 1763 | |
| 1764 | |
| 1765 | |
| 1766 | |
| 1767 | |
| 1768 | |
| 1769 | |
| 1770 | |
| 1771 | |
| 1772 | |
| 1773 | |
| 1774 | |
| 1775 | |
| 1776 | |
| 1777 | |
| 1778 | |
| 1779 | |
| 1780 | |
| 1781 | |
| 1782 | |
| 1783 | |
| 1784 | |
| 1785 | |
| 1786 | |
| 1787 | |
| 1788 | |
| 1789 | |
| 1790 | |
| 1791 | |
| 1792 | |
| 1793 | |
| 1794 | |
| 1795 | |
| 1796 | |
| 1797 | |
| 1798 | |
| 1799 | |
| 1800 | |
| 1801 | |
| 1802 | |
| 1803 | |
| 1804 | |
| 1805 | |
| 1806 | |
| 1807 | |
| 1808 | |
| 1809 | |
| 1810 | |
| 1811 | |
| 1812 | |
| 1813 | |
| 1814 | |
| 1815 | |
| 1816 | |
| 1817 | |
| 1818 | |
| 1819 | |
| 1820 | |
| 1821 | |
| 1822 | |
| 1823 | |
| 1824 | |
| 1825 | |
| 1826 | |
| 1827 | |
| 1828 | |
| 1829 | |
| 1830 | |
| 1831 | |
| 1832 | |
| 1833 | |
| 1834 | |
| 1835 | |
| 1836 | |
| 1837 | |
| 1838 | |
| 1839 | |
| 1840 | |
| 1841 | |
| 1842 | |
| 1843 | |
| 1844 | |
| 1845 | |
| 1846 | |
| 1847 | |
| 1848 | |
| 1849 | |
| 1850 | |
| 1851 | |
| 1852 | |
| 1853 | |
| 1854 | |
| 1855 | |
| 1856 | |
| 1857 | |
| 1858 | |
| 1859 | |
| 1860 | |
| 1861 | |
| 1862 | |
| 1863 | |
| 1864 | |
| 1865 | |
| 1866 | |
| 1867 | |
| 1868 | |
| 1869 | |
| 1870 | |
| 1871 | |
| 1872 | |
| 1873 | |
| 1874 | |
| 1875 | |
| 1876 | |
| 1877 | |
| 1878 | |
| 1879 | |
| 1880 | |
| 1881 | |
| 1882 | |
| 1883 | |
| 1884 | |
| 1885 | |
| 1886 | |
| 1887 | |
| 1888 | |
| 1889 | |
| 1890 | |
| 1891 | |
| 1892 | |
| 1893 | |
| 1894 | |
| 1895 | |
| 1896 | |
| 1897 | |
| 1898 | |
| 1899 | |
| 1900 | |
| 1901 | |
| 1902 | |
| 1903 | |
| 1904 | |
| 1905 | |
| 1906 | |
| 1907 | |
| 1908 | |
| 1909 | |
| 1910 | |
| 1911 | |
| 1912 | |
| 1913 | |
| 1914 | |
| 1915 | |
| 1916 | |
| 1917 | |
| 1918 | |
| 1919 | |
| 1920 | |
| 1921 | |
| 1922 | |
| 1923 | |
| 1924 | |
| 1925 | |
| 1926 | |
| 1927 | |
| 1928 | |
| 1929 | |
| 1930 | |
| 1931 | |
| 1932 | |
| 1933 | |
| 1934 | |
| 1935 | |
| 1936 | |
| 1937 | |
| 1938 | |
| 1939 | |
| 1940 | |
| 1941 | |
| 1942 | |
| 1943 | |
| 1944 | |
| 1945 | |
| 1946 | |
| 1947 | |
| 1948 | |
| 1949 | |
| 1950 | |
| 1951 | |
| 1952 | |
| 1953 | |
| 1954 | |
| 1955 | |
| 1956 | |
| 1957 | |
| 1958 | |
| 1959 | |
| 1960 | |
| 1961 | |
| 1962 | |
| 1963 | |
| 1964 | |
| 1965 | |
| 1966 | |
| 1967 | |
| 1968 | |
| 1969 | |
| 1970 | |
| 1971 | |
| 1972 | |
| 1973 | |
| 1974 | |
| 1975 | |
| 1976 | |
| 1977 | |
| 1978 | |
| 1979 | |
| 1980 | |
| 1981 | |
| 1982 | |
| 1983 | |
| 1984 | |
| 1985 | |
| 1986 | |
| 1987 | |
| 1988 | |
| 1989 | |
| 1990 | |
| 1991 | |
| 1992 | |
| 1993 | |
| 1994 | |
| 1995 | |
| 1996 | |
| 1997 | |
| 1998 | |
| 1999 | |
| 2000 | |
| 2001 | |
| 2002 | |
| 2003 | |
| 2004 | |
| 2005 | |
| 2006 | |
| 2007 | |
| 2008 | |
| 2009 | |
| 2010 | |
| 2011 | |
| 2012 | |
| 2013 | |
| 2014 | |
| 2015 | |
| 2016 | |
| 2017 | |
| 2018 | |
| 2019 | |
| 2020 | |
| 2021 | |
| 2022 | |
| 2023 | |
| 2024 | |
| 2025 | |
| 2026 | |
| 2027 | |
| 2028 | |
| 2029 | |
| 2030 | |
| 2031 | |
| 2032 | |
| 2033 | |
| 2034 | |
| 2035 | |
| 2036 | |
| 2037 | |
| 2038 | |
| 2039 | |
| 2040 | |
| 2041 | |
| 2042 | |
| 2043 | |
| 2044 | |
| 2045 | |
| 2046 | |
| 2047 | |
| 2048 | |
| 2049 | |
| 2050 | |
| 2051 | |
| 2052 | |
| 2053 | |
| 2054 | |
| 2055 | |
| 2056 | |
| 2057 | |
| 2058 | |
| 2059 | |
| 2060 | |
| 2061 | |
| 2062 | |
| 2063 | |
| 2064 | |
| 2065 | |
| 2066 | |
| 2067 | |
| 2068 | |
| 2069 | |
| 2070 | |
| 2071 | |
| 2072 | |
| 2073 | |
| 2074 | |
| 2075 | |
| 2076 | |
| 2077 | |
| 2078 | |
| 2079 | |
| 2080 | |
| 2081 | |
| 2082 | |
| 2083 | |
| 2084 | |
| 2085 | |
| 2086 | |
| 2087 | |
| 2088 | |
| 2089 | |
| 2090 | |
| 2091 | |
| 2092 | |
| 2093 | |
| 2094 | |
| 2095 | |
| 2096 | |
| 2097 | |
| 2098 | |
| 2099 | |
| 2100 | |
| 2101 | |
| 2102 | |
| 2103 | |
| 2104 | |
| 2105 | |
| 2106 | |
| 2107 | |
| 2108 | |
| 2109 | |
| 2110 | |
| 2111 | |
| 2112 | |
| 2113 | |
| 2114 | |
| 2115 | |
| 2116 | |
| 2117 | |
| 2118 | |
| 2119 | |
| 2120 | |
| 2121 | |
| 2122 | |
| 2123 | |
| 2124 | |
| 2125 | |
| 2126 | |
| 2127 | |
| 2128 | |
| 2129 | |
| 2130 | |
| 2131 | |
| 2132 | |
| 2133 | |
| 2134 | |
| 2135 | |
| 2136 | |
| 2137 | |
| 2138 | |
| 2139 | |
| 2140 | |
| 2141 | |
| 2142 | |
| 2143 | |
| 2144 | |
| 2145 | |
| 2146 | |
| 2147 | |
| 2148 | |
| 2149 | |
| 2150 | |
| 2151 | |
| 2152 | |
| 2153 | |
| 2154 | |
| 2155 | |
| 2156 | |
| 2157 | |
| 2158 | |
| 2159 | |
| 2160 | |
| 2161 | |
| 2162 | |
| 2163 | |
| 2164 | |
| 2165 | |
| 2166 | |
| 2167 | |
| 2168 | |
| 2169 | |
| 2170 | |
| 2171 | |
| 2172 | |
| 2173 | |
| 2174 | |
| 2175 | |
| 2176 | |
| 2177 | |
| 2178 | |
| 2179 | |
| 2180 | |
| 2181 | |
| 2182 | |
| 2183 | |
| 2184 | |
| 2185 | |
| 2186 | |
| 2187 | |
| 2188 | |
| 2189 | |
| 2190 | |
| 2191 | |
| 2192 | |
| 2193 | |
| 2194 | |
| 2195 | |
| 2196 | |
| 2197 | |
| 2198 | |
| 2199 | |
| 2200 | |
| 2201 | |
| 2202 | |
| 2203 | |
| 2204 | |
| 2205 | |
| 2206 | |
| 2207 | |
| 2208 | |
| 2209 | |
| 2210 | |
| 2211 | |
| 2212 | |
| 2213 | |
| 2214 | |
| 2215 | |
| 2216 | |
| 2217 | |
| 2218 | |
| 2219 | |
| 2220 | |
| 2221 | |
| 2222 | |
| 2223 | |
| 2224 | |
| 2225 | |
| 2226 | |
| 2227 | |
| 2228 | |
| 2229 | |
| 2230 | |
| 2231 | |
| 2232 | |
| 2233 | |
| 2234 | |
| 2235 | |
| 2236 | |
| 2237 | |
| 2238 | |
| 2239 | |
| 2240 | |
| 2241 | |
| 2242 | |
| 2243 | |
| 2244 | |
| 2245 | |
| 2246 | |
| 2247 | |
| 2248 | |
| 2249 | |
| 2250 | |
| 2251 | |
| 2252 | |
| 2253 | |
| 2254 | |
| 2255 | |
| 2256 | |
| 2257 | |
| 2258 | |
| 2259 | |
| 2260 | |
| 2261 | |
| 2262 | |
| 2263 | |
| 2264 | |
| 2265 | |
| 2266 | |
| 2267 | |
| 2268 | |
| 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 | |
| 2345 | |
| 2346 | |
| 2347 | |
| 2348 | |
| 2349 | |
| 2350 | |
| 2351 | |
| 2352 | |
| 2353 | |
| 2354 | |
| 2355 | |
| 2356 | |
| 2357 | |
| 2358 | |
| 2359 | |
| 2360 | |
| 2361 | |
| 2362 | |
| 2363 | |
| 2364 | |
| 2365 | |
| 2366 | |
| 2367 | |
| 2368 | |
| 2369 | |
| 2370 | |
| 2371 | |
| 2372 | |
| 2373 | |
| 2374 | |
| 2375 | |
| 2376 | |
| 2377 | |
| 2378 | |
| 2379 | |
| 2380 | |
| 2381 | |
| 2382 | |
| 2383 | |
| 2384 | |
| 2385 | |
| 2386 | |
| 2387 | |
| 2388 | |
| 2389 | |
| 2390 | |
| 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 | |
| 2440 | |
| 2441 | |
| 2442 | |
| 2443 | |
| 2444 | |
| 2445 | |
| 2446 | |
| 2447 | |
| 2448 | |
| 2449 | |
| 2450 | |
| 2451 | |
| 2452 | |
| 2453 | |
| 2454 | |
| 2455 | |
| 2456 | |
| 2457 | |
| 2458 | |
| 2459 | |
| 2460 | |
| 2461 | |
| 2462 | |
| 2463 | |
| 2464 | |
| 2465 | |
| 2466 | |
| 2467 | |
| 2468 | |
| 2469 | |
| 2470 | |
| 2471 | |
| 2472 | |
| 2473 | |
| 2474 | |
| 2475 | |
| 2476 | |
| 2477 | |
| 2478 | |
| 2479 | |
| 2480 | |
| 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 | |
| 2554 | |
| 2555 | |
| 2556 | |
| 2557 | |
| 2558 | |
| 2559 | |
| 2560 | |
| 2561 | |
| 2562 | |
| 2563 | |
| 2564 | |
| 2565 | |
| 2566 | |
| 2567 | |
| 2568 | pub |