edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! Hit and census counters of the decode path: thread-local tallies bumped by the |
| 2 | //! `hit!` instrumentation and read back by the gate tests. Moved out of `decode/mod.rs` |
| 3 | //! by name (av1split D3); the items are unchanged except for `pub(super)` visibility. |
| 4 | |
| 5 | use *; |
| 6 | |
| 7 | // How many real 128-level partition symbols this decoder has read, and how |
| 8 | // many superblocks resolved to `PARTITION_SPLIT` (coded or forced) -- the |
| 9 | // gate's proof a `--sb-size=128` stream exercised the 128 partition root. |
| 10 | thread_local! |
| 11 | |
| 12 | |
| 13 | |
| 14 | /// Current value of [`PART128_SPLIT_HITS`]. |
| 15 | // read only from the `#[cfg(test)]` gates |
| 16 | pub |
| 17 | |
| 18 | |
| 19 | |
| 20 | // How many `use_filter_intra` symbols this decoder has read as `1`, across |
| 21 | // every call on the current thread -- the cheap counter [`filter_intra_hits`] gate |
| 22 | // tests read (before/after, not the absolute value) to prove a stream |
| 23 | // actually exercised the filter-intra predictor rather than silently |
| 24 | // skipping it. |
| 25 | thread_local! |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | /// Current value of [`FILTER_INTRA_HITS`]. |
| 31 | // read only from the `#[cfg(test)]` gates |
| 32 | pub |
| 33 | |
| 34 | |
| 35 | |
| 36 | // lane-fiinter r1: how many of those `use_filter_intra == 1` symbols belonged |
| 37 | // to an INTRA block inside an INTER frame (`read_intra_block_mode_info`'s own |
| 38 | // `read_filter_intra_mode_info` call), which no gate exercised before this |
| 39 | // round -- every inter gate recipe passed `--enable-filter-intra=0`. |
| 40 | thread_local! |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | /// Current value of [`INTRA_IN_INTER_FILTER_INTRA_HITS`]. |
| 46 | // read only from the `#[cfg(test)]` gates |
| 47 | pub |
| 48 | |
| 49 | |
| 50 | |
| 51 | // lane-angleinter r1: how many INTRA blocks inside an INTER frame carried a |
| 52 | // nonzero `angle_delta_y` / `angle_delta_uv` (`read_intra_angle_info`). Both |
| 53 | // arms refused a nonzero luma delta before this round, and no inter gate |
| 54 | // enabled `--enable-angle-delta` (aomenc's own default is 1). |
| 55 | thread_local! |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | /// Current value of [`INTRA_IN_INTER_ANGLE_DELTA_Y_HITS`]. |
| 63 | // read only from the `#[cfg(test)]` gates |
| 64 | pub |
| 65 | |
| 66 | |
| 67 | |
| 68 | /// Current value of [`INTRA_IN_INTER_ANGLE_DELTA_UV_HITS`]. |
| 69 | // read only from the `#[cfg(test)]` gates |
| 70 | pub |
| 71 | |
| 72 | |
| 73 | |
| 74 | // lane-uv8 r1: the three non-DC chroma mode classes an INTRA 8x8 leaf inside |
| 75 | // an INTER frame ([`decode_inter_block8`]'s intra arm) can carry -- the arm |
| 76 | // read `uv_mode` and then refused everything but `DC_PRED`. Counted here and |
| 77 | // nowhere else so the gate's assert cannot be satisfied by a >=16x16 block. |
| 78 | thread_local! |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | thread_local! |
| 85 | |
| 86 | |
| 87 | |
| 88 | /// Nonzero luma angle deltas coded by an intra 8x8 leaf inside an inter frame |
| 89 | /// (lane-leaf8tx r1) -- counted only in [`decode_inter_block8`]'s intra arm. |
| 90 | // read only from the `#[cfg(test)]` gates |
| 91 | pub |
| 92 | |
| 93 | |
| 94 | |
| 95 | /// `(directional, smooth/paeth, CfL)` chroma modes coded by an intra 8x8 leaf |
| 96 | /// inside an inter frame -- see [`INTRA_IN_INTER8_UV_DIR_HITS`]. |
| 97 | // read only from the `#[cfg(test)]` gates |
| 98 | pub |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | // Whether this superblock's single CDEF unit (this decoder has no 128x128 |
| 107 | // SB, so the SB IS the CDEF unit) has already had its `cdef_idx` literal |
| 108 | // read -- reset to `false` at the top of each superblock in the two tile |
| 109 | // loops, spec `read_cdef`'s `cdef_transmitted[index]`. |
| 110 | // Number of superblock columns in the current tile's grid, so |
| 111 | // [`maybe_read_cdef_idx`] can turn an `(mi_r, mi_c)` into a flat index into |
| 112 | // [`CDEF_IDX_GRID`]. |
| 113 | // One resolved `cdef_idx` per superblock, read by [`apply_cdef`] to select |
| 114 | // which of the header's `1 << cdef.bits` strength pairs applies to that |
| 115 | // superblock's samples. |
| 116 | // How many real (`cdef.bits > 0`) `cdef_idx` literals [`maybe_read_cdef_idx`] |
| 117 | // has read, across every call on the current thread -- the gate's proof that a |
| 118 | // `cdef_bits > 0` stream actually reached the new reader rather than every |
| 119 | // superblock coincidentally being all-skip. |
| 120 | thread_local! |
| 121 | |
| 122 | |
| 123 | |
| 124 | // How many times a warp was suppressed for one PLANE because that plane's own |
| 125 | // block is narrower or shorter than 8 (`av1_init_warp_params`'s own bail-out, |
| 126 | // reconinter.c) -- the gate's proof that a stream really carries the shape, |
| 127 | // since the square `side`/`chroma_side` can be 8 or more while the plane's |
| 128 | // true block is 4 wide (an 8x16 luma block's 4x8 chroma). |
| 129 | thread_local! |
| 130 | |
| 131 | |
| 132 | |
| 133 | /// Current value of [`WARP_PLANE_SUPPRESS_HITS`]. |
| 134 | // read only from the `#[cfg(test)]` gates |
| 135 | pub |
| 136 | |
| 137 | |
| 138 | |
| 139 | /// Current value of [`CDEF_IDX_HITS`]. |
| 140 | // read only from the `#[cfg(test)]` gates |
| 141 | pub |
| 142 | |
| 143 | |
| 144 | |
| 145 | // lane-t900 r6: gate proof for the three r2-r4 root causes that shipped with no |
| 146 | // counter -- the in-inter tx-depth context (`tx_size_context_txfm_rect`), the |
| 147 | // non-chroma-reference block that must LEAVE its neighbours' chroma coefficient |
| 148 | // contexts alone, and the intra-edge filter neighbour pair taken mi-exact |
| 149 | // instead of from the coarse 16x16 cell. |
| 150 | thread_local! |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | /// Current value of [`INTRA_IN_INTER_TXCTX_HITS`]. |
| 157 | // read only from the `#[cfg(test)]` gates |
| 158 | pub |
| 159 | |
| 160 | |
| 161 | |
| 162 | /// Current value of [`NON_CHROMA_REF_CTX_SKIP_HITS`]. |
| 163 | // read only from the `#[cfg(test)]` gates |
| 164 | pub |
| 165 | |
| 166 | |
| 167 | |
| 168 | /// Current value of [`EDGE_FILTER_MI_FIX_HITS`]. |
| 169 | // read only from the `#[cfg(test)]` gates |
| 170 | pub |
| 171 | |
| 172 | |
| 173 | |
| 174 | // lane-realworld r4: this frame's `delta.q_present` (spec 5.9.17) and its |
| 175 | // actual step (`1 << delta.q_res`, already the real multiplier, not the raw |
| 176 | // 2-bit field). `false`/`1` (the defaults) make [`maybe_read_delta_q`] a |
| 177 | // true no-op, matching every existing gate stream's `delta_q_present == 0` |
| 178 | // behaviour exactly, the same corner-cut [`CDEF_BITS`] takes above. |
| 179 | // The running quantizer index (spec `CurrentQIndex`, libaom |
| 180 | // `xd->current_base_qindex`) -- reset to the frame's own `base_q_idx` at the |
| 181 | // top of every tile (spec `decode_tile`), carried across superblocks within |
| 182 | // that tile, and mutated only by [`maybe_read_delta_q`]. Read back at the |
| 183 | // dequantization call sites instead of the frame-constant `base_q_idx`. |
| 184 | // This frame's own per-plane DC/AC quantizer-index deltas (lane-sbpart r11, |
| 185 | // spec 5.9.12/7.12.2, [`crate::quant::QuantDeltas`]) -- frame-constant (not |
| 186 | // per-superblock like [`CURRENT_Q_IDX`]), set once per frame decode and read |
| 187 | // back at every dequantization call site keyed on which plane it is doing. |
| 188 | // How many real `delta_q_present` symbol groups [`maybe_read_delta_q`] has |
| 189 | // read, across every call on the current thread -- the gate's proof that a |
| 190 | // `delta_q_present` stream actually reached the new reader. |
| 191 | thread_local! |
| 192 | |
| 193 | |
| 194 | |
| 195 | /// Current value of [`DELTA_Q_HITS`]. |
| 196 | // read only from the `#[cfg(test)]` gates |
| 197 | pub |
| 198 | |
| 199 | |
| 200 | |
| 201 | // lane-realworld r5: this frame's `delta.lf_present`/`lf_res`/`lf_multi` |
| 202 | // (spec 5.9.18) -- same no-op-by-default corner-cut as `DELTA_Q_PRESENT`. |
| 203 | // The running per-plane/direction loop-filter delta (spec `DeltaLF[i]`, |
| 204 | // `i` in `0..FRAME_LF_COUNT`) -- reset to `[0; 4]` at the top of every tile, |
| 205 | // mutated only by [`maybe_read_delta_lf`]. `!delta_lf_multi` mode only ever |
| 206 | // updates index 0 and every reader treats that as the value for all 4 |
| 207 | // indices (spec `read_delta_lf_params`'s own single-cdf branch). |
| 208 | // How many real `delta_lf_present` symbol groups [`maybe_read_delta_lf`] has |
| 209 | // read -- the gate's proof the reader fired, mirroring [`DELTA_Q_HITS`]. |
| 210 | thread_local! |
| 211 | |
| 212 | |
| 213 | |
| 214 | /// Current value of [`DELTA_LF_HITS`]. |
| 215 | // read only from the `#[cfg(test)]` gates |
| 216 | pub |
| 217 | |
| 218 | |
| 219 | |
| 220 | // --------------------------------------------------------------------------- |
| 221 | // lane-seg: segmentation. Header (spec 5.9.14) is parsed by `ec-av1-syntax`; |
| 222 | // this block is the per-block `segment_id` reader (spec 5.11.7-5.11.9) plus |
| 223 | // the two consumers a real stream exercises: the per-segment quantizer index |
| 224 | // (spec 7.12.2 `get_qindex`) and the per-segment loop-filter level |
| 225 | // (spec 7.14.4). Shapes follow libaom `decodemv.c:read_segment_id`/ |
| 226 | // `read_intra_segment_id`/`read_inter_segment_id` and |
| 227 | // `pred_common.h:av1_get_spatial_seg_pred` -- note libaom returns the SPATIAL |
| 228 | // PREDICTION (not 0) from `read_segment_id` when the block is `skip`, which |
| 229 | // is what the oracle every gate here compares against actually does. |
| 230 | thread_local! |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | |
| 247 | |
| 248 | /// How many `segment_id` symbols have been read (never reset per frame). |
| 249 | // read only from the `#[cfg(test)]` gates |
| 250 | pub |
| 251 | |
| 252 | |
| 253 | |
| 254 | /// How many `seg_id_predicted` symbols have been read (temporal update). |
| 255 | // read only from the `#[cfg(test)]` gates |
| 256 | pub |
| 257 | |
| 258 | |
| 259 | |
| 260 | /// Resets the segmentation hit counters (gate setup). |
| 261 | // read only from the `#[cfg(test)]` gates |
| 262 | pub |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | // How many key-frame luma blocks resolved `smooth_neighbor` (spec |
| 270 | // `get_intra_edge_filter_type`) to `true` -- lane-chroma r2's own before/after |
| 271 | // counter, proving a stream actually put a directional block next to a |
| 272 | // smooth-predicted neighbour rather than every block reading the (previously |
| 273 | // hardcoded `false`) edge-filter strength bucket unchanged. |
| 274 | thread_local! |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | /// Current value of [`SMOOTH_LUMA_HITS`]. |
| 280 | // read only from the `#[cfg(test)]` gates |
| 281 | pub |
| 282 | |
| 283 | |
| 284 | |
| 285 | thread_local! |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | |
| 294 | |
| 295 | |
| 296 | /// Current value of [`SPLIT_TU_REACH_FIX_HITS`]. |
| 297 | // read only from the `#[cfg(test)]` gates |
| 298 | pub |
| 299 | |
| 300 | |
| 301 | |
| 302 | // How many `uv_mode` reads resolved to `SMOOTH_PRED..=PAETH_PRED` (9..=12), |
| 303 | // across every call on the current thread -- lane-chroma r3's own before/after |
| 304 | // counter, proving a stream actually exercised chroma's smooth/paeth |
| 305 | // predictor (the previously-refused round-2 gap) rather than every block |
| 306 | // landing on DC/CFL/directional. |
| 307 | thread_local! |
| 308 | |
| 309 | |
| 310 | |
| 311 | |
| 312 | /// Current value of [`SMOOTH_UV_HITS`]. |
| 313 | // read only from the `#[cfg(test)]` gates |
| 314 | pub |
| 315 | |
| 316 | |
| 317 | |
| 318 | // How many tiles [`decode_key_frame_tile_with_cdfs`] has actually decoded a |
| 319 | // full superblock walk over, across every call on the current thread -- |
| 320 | // lane-tiles r2's own gate-blind-to-feature guard: a gate over a |
| 321 | // multi-tile stream must prove more than one tile actually fired, not just |
| 322 | // that the stream carried tile_info.cols > 1. |
| 323 | thread_local! |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | /// Current value of [`TILE_HITS`]. |
| 329 | // read only from the `#[cfg(test)]` gates |
| 330 | pub |
| 331 | |
| 332 | |
| 333 | |
| 334 | // How many 4-pixel deblocking edge groups [`edge_params`] has actually |
| 335 | // selected for filtering, across every call on the current thread -- the same |
| 336 | // before/after counter pattern as [`FILTER_INTRA_HITS`], proving a stream |
| 337 | // exercised `apply_deblock` rather than every edge landing on level 0. |
| 338 | thread_local! |
| 339 | |
| 340 | |
| 341 | |
| 342 | |
| 343 | /// Current value of [`DEBLOCK_HITS`]. |
| 344 | // read only from the `#[cfg(test)]` gates |
| 345 | pub |
| 346 | |
| 347 | |
| 348 | |
| 349 | // lane-defon r1: how many COMPOUND_REFERENCE blocks read a |
| 350 | // `UNIDIR_COMP_REFERENCE` pair (both references on the same temporal side, |
| 351 | // spec 5.11.25 `comp_reference_type == 0`) -- the gate's proof that a |
| 352 | // stream built with `--enable-onesided-comp=1` really exercised the |
| 353 | // `uni_comp_ref` alphabet rather than only bidirectional pairs. |
| 354 | thread_local! |
| 355 | |
| 356 | |
| 357 | |
| 358 | |
| 359 | /// Current value of [`UNI_COMP_HITS`]. |
| 360 | // read only from the `#[cfg(test)]` gates |
| 361 | pub |
| 362 | |
| 363 | |
| 364 | |
| 365 | // lane-defon r1: how many blocks blended through a `COMPOUND_DIFFWTD` mask |
| 366 | // (`mc::diffwtd_mask`) -- the narrower half of `MASKED_COMPOUND_HITS`, the |
| 367 | // gate's proof that `--enable-diff-wtd-comp=1` reached the difference-weighted |
| 368 | // blend and not only the wedge arm. |
| 369 | thread_local! |
| 370 | |
| 371 | |
| 372 | |
| 373 | |
| 374 | /// Current value of [`DIFFWTD_HITS`]. |
| 375 | // read only from the `#[cfg(test)]` gates |
| 376 | pub |
| 377 | |
| 378 | |
| 379 | |
| 380 | // lane-mcomp64 r1: how many blocks took the INFERRED `COMPOUND_DIFFWTD` arm -- |
| 381 | // a block size where `av1_is_wedge_used` is false (64x64 is the only such size |
| 382 | // this decoder's square inter path reaches), so no `compound_type` symbol is |
| 383 | // coded at all. Strictly narrower than `DIFFWTD_HITS`, which also counts the |
| 384 | // coded-symbol DIFFWTD blocks at 8x8/16x16/32x32. |
| 385 | thread_local! |
| 386 | |
| 387 | |
| 388 | |
| 389 | |
| 390 | /// Current value of [`DIFFWTD_INFERRED_HITS`]. |
| 391 | // read only from the `#[cfg(test)]` gates |
| 392 | pub |
| 393 | |
| 394 | |
| 395 | |
| 396 | // lane-defon r1: how many FORWARD KEYFRAMES were decoded -- a KEY frame coded |
| 397 | // with `show_frame == 0`, output later by a `show_existing_frame` header |
| 398 | // (aomenc `--enable-fwd-kf=1 --fwd-kf-dist=N`). Counted from |
| 399 | // `stream::decode_stream`, which is where the frame header is consumed; the |
| 400 | // gate's proof that the on-value really reached the bitstream rather than |
| 401 | // being dropped by the rate control. |
| 402 | thread_local! |
| 403 | |
| 404 | |
| 405 | |
| 406 | |
| 407 | /// Current value of [`FWD_KF_HITS`]. |
| 408 | // read only from the `#[cfg(test)]` gates |
| 409 | pub |
| 410 | |
| 411 | |
| 412 | |
| 413 | // How many [`read_tx_size`] reads resolved a `tx_depth` strictly less than |
| 414 | // the block's own side, across every call on the current thread -- the same |
| 415 | // before/after counter pattern as [`FILTER_INTRA_HITS`], proving a stream |
| 416 | // actually exercised a *split* transform under `TxMode::Select` rather than |
| 417 | // every block coincidentally resolving `depth=0` (indistinguishable from |
| 418 | // `TxMode::Largest` pixel-wise). |
| 419 | thread_local! |
| 420 | |
| 421 | |
| 422 | |
| 423 | |
| 424 | // How many plain SQUARE intra blocks (lane-sqchroma r1) resolved a luma |
| 425 | // transform smaller than their own side (`tx_depth != 0`) while coding a |
| 426 | // chroma prediction other than `DC_PRED` -- the pair the square path's chroma |
| 427 | // only exercises with aomenc's tx-size search left ON (its default), which |
| 428 | // every older recipe in this file pins off. Counted at the block, so a stream |
| 429 | // where RD happened to give every split-transform block a DC chroma mode |
| 430 | // reads as zero rather than silently passing for free. |
| 431 | thread_local! |
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | /// Current value of [`SQ_CHROMA_TX_HITS`]. |
| 437 | // read only from the `#[cfg(test)]` gates |
| 438 | pub |
| 439 | |
| 440 | |
| 441 | |
| 442 | /// Current value of [`TX_DEPTH_HITS`]. |
| 443 | // read only from the `#[cfg(test)]` gates |
| 444 | pub |
| 445 | |
| 446 | |
| 447 | |
| 448 | // lane-txselect: how many `txfm_split` symbols an inter frame's var-tx tree |
| 449 | // read, and how many of those actually took the split, on the current thread |
| 450 | // -- the same before/after counter pattern as [`TX_DEPTH_HITS`], proving a |
| 451 | // stream exercised spec 5.11.17's `read_var_tx_size` rather than every block |
| 452 | // coincidentally coding one whole-block transform. |
| 453 | thread_local! |
| 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 | /// Current value of [`TXFM_SPLIT_HITS`]. |
| 486 | // read only from the `#[cfg(test)]` gates |
| 487 | pub |
| 488 | |
| 489 | |
| 490 | |
| 491 | /// Current value of [`INTER_LEAF16_HORZ_HITS`] (lane-inter4 r3). |
| 492 | // read only from the `#[cfg(test)]` gates |
| 493 | pub |
| 494 | |
| 495 | |
| 496 | |
| 497 | /// Current value of [`INTER_LEAF16_VERT_HITS`] (lane-inter4 r3). |
| 498 | // read only from the `#[cfg(test)]` gates |
| 499 | pub |
| 500 | |
| 501 | |
| 502 | |
| 503 | /// Current value of [`RECT_INTER_TU_HITS`] (lane-inter4 r2). |
| 504 | pub |
| 505 | |
| 506 | |
| 507 | |
| 508 | /// Current value of [`RECT_INTER_TXSPLIT_HITS`] (lane-inter4 r2). |
| 509 | pub |
| 510 | |
| 511 | |
| 512 | |
| 513 | /// Current value of [`RECT64_INTER_TU_HITS`] (lane-r14 r2). |
| 514 | pub |
| 515 | |
| 516 | |
| 517 | |
| 518 | /// Current value of [`RECT32X8_INTER_TU_HITS`] (lane-rectres r1): `[32x8, 8x32]` |
| 519 | /// whole-block luma units of a 32x32-level 1:4 inter strip. |
| 520 | pub |
| 521 | |
| 522 | |
| 523 | |
| 524 | /// Current value of [`VARTX_RECT_LEAF_HITS`] (lane-r14 r3): how many |
| 525 | /// rectangular var-tx leaf transform units were coded, `[32x16, 16x32]`. |
| 526 | pub |
| 527 | |
| 528 | |
| 529 | |
| 530 | /// Current value of [`VARTX_RECT_LEAF4_HITS`] (lane-inter16ab r4): 8x4/4x8 |
| 531 | /// split leaves of a 16x4/4x16 strip, `[8x4, 4x8]`. |
| 532 | pub |
| 533 | |
| 534 | |
| 535 | |
| 536 | /// Records one rectangular var-tx leaf. |
| 537 | pub |
| 538 | |
| 539 | |
| 540 | |
| 541 | |
| 542 | |
| 543 | |
| 544 | |
| 545 | |
| 546 | |
| 547 | |
| 548 | |
| 549 | |
| 550 | |
| 551 | |
| 552 | |
| 553 | // How many `partition_w16` reads (a 16x16 block's own partition symbol, key |
| 554 | // intra-frame path) resolved to `PARTITION_VERT_B` -- lane-rect16 r1: a |
| 555 | // plain default-settings aomenc run over lavfi mandelbrot hits this arm on |
| 556 | // frame 0's very first non-NONE/SPLIT `partition_w16` symbol (mi=(3,2)), not |
| 557 | // the plain HORZ/VERT this lane's charter assumed. Left rect (8x16, real |
| 558 | // `decode_block_rect`) + two 8x8 leaves stacked on the right (`decode_leaf8`, |
| 559 | // chained via `prev_leaf` exactly like the existing 16x16-SPLIT-into-4x8x8 |
| 560 | // path above). |
| 561 | thread_local! |
| 562 | |
| 563 | |
| 564 | |
| 565 | |
| 566 | /// Current value of [`VERT_B_INTRA_HITS`]. |
| 567 | // read only from the `#[cfg(test)]` gates |
| 568 | pub |
| 569 | |
| 570 | |
| 571 | |
| 572 | // lane-ab16 r1: how many 16x16-level AB partitions fired, per arm, in |
| 573 | // `PARTITION_HORZ_A`, `_HORZ_B`, `_VERT_A`, `_VERT_B` order. Each arm is two |
| 574 | // 8x8 squares (`decode_leaf8`) plus one 16x8/8x16 strip (`decode_leaf_rect`, |
| 575 | // the non-skip coefficient path lane-rectx proved); the gate hard-asserts |
| 576 | // every arm separately so a run where aomenc's RD only picked one cannot |
| 577 | // pass as proof of four. |
| 578 | thread_local! |
| 579 | |
| 580 | |
| 581 | |
| 582 | // [`AB16_HITS`] per arm (HORZ_A, HORZ_B, VERT_A, VERT_B at 16x16). |
| 583 | thread_local! |
| 584 | |
| 585 | |
| 586 | |
| 587 | |
| 588 | |
| 589 | |
| 590 | |
| 591 | // read only from the `#[cfg(test)]` gates |
| 592 | pub |
| 593 | |
| 594 | |
| 595 | |
| 596 | // read only from the `#[cfg(test)]` gates |
| 597 | pub |
| 598 | |
| 599 | |
| 600 | |
| 601 | // How many `partition_w16` reads resolved to a plain `PARTITION_HORZ`/ |
| 602 | // `PARTITION_VERT` (lane-rect16 r2): re-measuring after the VERT_B fix above |
| 603 | // showed mandelbrot's real first-hit blocker is this plain arm at mi=(0,7), |
| 604 | // not VERT_B (`refusal-names-a-correlate`; the VERT_B write-up's "frame 0's |
| 605 | // very first non-NONE/SPLIT symbol" claim was about decode ORDER within one |
| 606 | // superblock's z-order recursion, not raster mi position). |
| 607 | thread_local! |
| 608 | |
| 609 | |
| 610 | |
| 611 | |
| 612 | /// Current value of [`HORZ_VERT_INTRA_HITS`]. |
| 613 | // read only from the `#[cfg(test)]` gates |
| 614 | pub |
| 615 | |
| 616 | |
| 617 | |
| 618 | // How many blocks were decoded as a frame-edge rect strip -- the single |
| 619 | // coded half of a `PARTITION_HORZ`/`PARTITION_VERT` at the true frame edge |
| 620 | // (lane-oddh r1), i.e. a block living inside the 8px band of a frame whose |
| 621 | // height or width is 8 mod 16 (the user's 3840x1608 film). Intra and inter |
| 622 | // paths share the counter. |
| 623 | thread_local! |
| 624 | |
| 625 | |
| 626 | |
| 627 | |
| 628 | /// Current value of [`EDGE_RECT_STRIP_HITS`]. |
| 629 | // gate counter accessor with no reader yet; the counter itself is live |
| 630 | pub |
| 631 | |
| 632 | |
| 633 | |
| 634 | // lane-interedge r1: frame-edge half strips on the INTER path, per partition |
| 635 | // level (64/32/16) x axis (HORZ at a bottom edge, VERT at a right edge). The |
| 636 | // index is `level_idx * 2 + axis` with `level_idx` 0=64, 1=32, 2=16 and |
| 637 | // `axis` 0=HORZ (`!has_rows`), 1=VERT (`!has_cols`). Both of the user's films |
| 638 | // are height mod 16 == 8, so every inter frame crosses these nodes. |
| 639 | thread_local! |
| 640 | |
| 641 | |
| 642 | |
| 643 | |
| 644 | // lane-edgeboth r1: how many partition nodes were coded as the BOTH-AXES-CUT |
| 645 | // forced split -- libaom `decode_partition` (decodeframe.c): |
| 646 | // `else if (!has_rows && !has_cols) partition = PARTITION_SPLIT;`, the one |
| 647 | // straddle case that reads NO symbol at all. Indexed by level: |
| 648 | // 0 = 16x16, 1 = 32x32, 2 = 64x64, 3 = 128x128; intra and inter share it. |
| 649 | thread_local! |
| 650 | |
| 651 | |
| 652 | |
| 653 | |
| 654 | /// Current value of [`INTER_EDGE_STRIP_HITS`] (`[h64, v64, h32, v32, h16, v16]`). |
| 655 | |
| 656 | |
| 657 | |
| 658 | |
| 659 | /// Resets [`INTER_EDGE_STRIP_HITS`] -- a refused attempt must not carry hits |
| 660 | /// into the next one (class `counter-from-refused-stream`). |
| 661 | |
| 662 | |
| 663 | |
| 664 | |
| 665 | /// Current value of [`EDGE_BOTH_CUT_HITS`] (`[16, 32, 64, 128]` levels). |
| 666 | // read only from the `#[cfg(test)]` gates |
| 667 | pub |
| 668 | |
| 669 | |
| 670 | |
| 671 | /// Zeroes [`EDGE_BOTH_CUT_HITS`] so a gate can measure a per-attempt delta. |
| 672 | // read only from the `#[cfg(test)]` gates |
| 673 | pub |
| 674 | |
| 675 | |
| 676 | |
| 677 | // How many HORZ/VERT intra strips resolved a SPLIT luma transform |
| 678 | // (`tx_depth != 0`) and decoded it per transform unit (lane-rectsplit r1) -- |
| 679 | // the case every rect path here refused by name before, and the first |
| 680 | // refusal the user's ReelB extract (600s in) stops at. |
| 681 | thread_local! |
| 682 | |
| 683 | |
| 684 | |
| 685 | |
| 686 | /// Current value of [`RECT_SPLIT_TX_HITS`]. |
| 687 | // read only from the `#[cfg(test)]` gates |
| 688 | pub |
| 689 | |
| 690 | |
| 691 | |
| 692 | // The subset of [`RECT_SPLIT_TX_HITS`] that is BOTH superblock-level (one |
| 693 | // side 64) AND split past the first depth, i.e. tiled more than one unit in |
| 694 | // each axis -- the only shape with a transform unit that has neighbours on |
| 695 | // two sides inside its own strip (`row_off > 0 && col_off > 0`), and the one |
| 696 | // no gate fired before lane-rectsplit r2 (the shared counter above also |
| 697 | // counts 32x32-level and depth-1 strips, so it cannot prove this case). |
| 698 | thread_local! |
| 699 | |
| 700 | |
| 701 | |
| 702 | |
| 703 | /// Current value of [`RECT_SPLIT_SB_INTERIOR_TU_HITS`]. |
| 704 | // read only from the `#[cfg(test)]` gates |
| 705 | pub |
| 706 | |
| 707 | |
| 708 | |
| 709 | // Per-shape hit counts for the rect chroma transforms lane-rectchroma r1 |
| 710 | // wired into [`decode_rect_split`] -- the shapes a split-transform strip's |
| 711 | // chroma half takes that had no coefficient tables before (index order: |
| 712 | // 32x8, 8x32, 8x4, 4x8). One counter per shape because a gate that only |
| 713 | // proves the pair it happens to hit cannot catch a transposed scan/context |
| 714 | // table (class scan-weights-cross-axis). |
| 715 | thread_local! |
| 716 | |
| 717 | |
| 718 | |
| 719 | |
| 720 | /// Current value of [`RECT_SPLIT_CHROMA_SHAPE_HITS`] (32x8, 8x32, 8x4, 4x8). |
| 721 | // read only from the `#[cfg(test)]` gates |
| 722 | pub |
| 723 | |
| 724 | |
| 725 | |
| 726 | // lane-av1-422: how many SQUARE chroma coefficient units the strip path read |
| 727 | // on a 4:2:2 frame (ss 1,0) -- the half-width, unhalved-height shape whose |
| 728 | // tables only exist because of the square rows in the chroma_tiled arm. A |
| 729 | // 4:2:0 or 4:4:4 frame can never increment it (their rect strips' chroma is |
| 730 | // itself rect), and a restored `/2 chroma height` diverts 4:2:2 squares onto |
| 731 | // the rect rows, so the witness gate reads 0 there and fails. |
| 732 | thread_local! |
| 733 | |
| 734 | |
| 735 | |
| 736 | |
| 737 | /// Current value of [`CHROMA422_SQUARE_HITS`]. |
| 738 | // lane-av1-422b: `pub` so `examples/decode_probe.rs` can census it the way |
| 739 | // it does every other capability counter. |
| 740 | |
| 741 | |
| 742 | |
| 743 | |
| 744 | // lane-av1422tailskip: how many 4:2:2 (ss 1,0) intra-in-inter chroma TRANSFORM |
| 745 | // UNITS took their own window on the block-sized chroma palette prediction -- |
| 746 | // `decode_inter_block`'s `side == 64` TX_32X32 walk, where the plane block is |
| 747 | // 32x64 but codes two stacked square units per plane. Zero on a 4:2:0 or 4:4:4 |
| 748 | // frame (their chroma unit is the whole plane block, one window), and zero on |
| 749 | // a 4:2:2 block with no palette, so a witness gate reading 0 proves the arm |
| 750 | // never ran. |
| 751 | thread_local! |
| 752 | |
| 753 | |
| 754 | |
| 755 | |
| 756 | /// Current value of [`PALETTE_422_UNIT_WINDOW_HITS`]. |
| 757 | // lane-av1422tailskip: `pub` so `examples/decode_probe.rs` can census it the |
| 758 | // way it does every other capability counter. |
| 759 | |
| 760 | |
| 761 | |
| 762 | |
| 763 | // lane-av1-422f: how many RECT chroma coefficient units the square-block |
| 764 | // path read on a 4:2:2 frame (ss 1,0) -- TX_4X8 / TX_8X16 / TX_16X32, the |
| 765 | // plane block's own half-width, unhalved-height shape. A 4:2:0 or 4:4:4 |
| 766 | // frame never takes the rect branch (their units are square |
| 767 | // `chroma_tx == chroma_tx_h`), so a witness gate reading 0 here proves the |
| 768 | // model reverted to squares. |
| 769 | thread_local! |
| 770 | |
| 771 | |
| 772 | |
| 773 | |
| 774 | /// Current value of [`CHROMA422_RECT_HITS`]. |
| 775 | |
| 776 | |
| 777 | |
| 778 | |
| 779 | // lane-av1-422g: how many PER-LEAF TX_4X4 chroma coefficient units the |
| 780 | // sub-8x8 split4 path read on a 4:2:2 frame (ss 1,0) -- one per even-column |
| 781 | // leaf per plane (`is_chroma_reference`'s `!(mi_col & ss_x)`). A 4:2:0 frame |
| 782 | // codes no sub-8 chroma at all and 4:4:4 goes through `sub8_leaf_chroma444`, |
| 783 | // so a witness gate reading 0 here proves the per-leaf 4:2:2 arm never ran. |
| 784 | thread_local! |
| 785 | |
| 786 | |
| 787 | |
| 788 | |
| 789 | /// Current value of [`CHROMA422_SUB8_HITS`]. |
| 790 | |
| 791 | |
| 792 | |
| 793 | |
| 794 | // lane-av1422llintra: how many 4:2:2 LOSSLESS chroma plane blocks |
| 795 | // (`decode_leaf8`) were walked as 4x4 units rather than as the one |
| 796 | // `av1_get_max_uv_txsize` rect that rule only reaches OUTSIDE a lossless |
| 797 | // frame. A 4:2:0 or 4:4:4 frame never takes the arm (its own lossless walk |
| 798 | // was already there), so a witness gate reading 0 here proves the model |
| 799 | // reverted to the rect unit. |
| 800 | thread_local! |
| 801 | |
| 802 | |
| 803 | |
| 804 | |
| 805 | /// Current value of [`CHROMA422_LOSSLESS_4X4_HITS`]. |
| 806 | |
| 807 | |
| 808 | |
| 809 | |
| 810 | // lane-av1-422sub8rect: how many PER-PIECE TX_4X4 chroma coefficient units |
| 811 | // the INTER sub-8x8 split4 path read on a 4:2:2 frame (ss 1,0) -- one per |
| 812 | // non-skipped odd-column piece per plane (`is_chroma_reference`'s |
| 813 | // `mi_col & 0x01` at ss_x 1). 4:2:0 goes through the shared group unit and |
| 814 | // 4:4:4 through [`sub8_leaf_chroma444`]'s own per-piece twin, so a witness |
| 815 | // gate reading 0 here proves the inter 4:2:2 per-piece arm never ran. |
| 816 | thread_local! |
| 817 | |
| 818 | |
| 819 | |
| 820 | |
| 821 | /// Current value of [`CHROMA422_INTER_SUB8_HITS`]. |
| 822 | |
| 823 | |
| 824 | |
| 825 | |
| 826 | // lane-av1-422m: how many TX_4X4 chunk units the invalid-ss-size chroma arm |
| 827 | // read (the 8x32 luma block whose 4:2:2 plane has no `ss_size_lookup` block). |
| 828 | // A 4:2:0 or 4:4:4 frame cannot increment it, so a non-zero read proves the |
| 829 | // chunked 4:2:2 chroma really decoded. |
| 830 | thread_local! |
| 831 | |
| 832 | |
| 833 | |
| 834 | |
| 835 | /// Current value of [`CHROMA422_CHUNK_HITS`]. |
| 836 | |
| 837 | |
| 838 | |
| 839 | |
| 840 | // lane-av1-422stripanchor: how many 4-wide-strip PAIR chroma units |
| 841 | // ([`decode_rect_split`]'s ported floored-pair anchor) decoded. A 4:2:0 or |
| 842 | // 4:4:4 frame cannot increment it (the arm is keyed to a 2-px-wide chroma |
| 843 | // block, which only a 1-mi-wide strip at ss (1, 0) produces), so a non-zero |
| 844 | // read proves a stream routed a 4-wide strip through the split path. |
| 845 | thread_local! |
| 846 | |
| 847 | |
| 848 | |
| 849 | |
| 850 | /// Current value of [`CHROMA422_PAIR_WIDE_HITS`]. |
| 851 | |
| 852 | |
| 853 | |
| 854 | |
| 855 | // How many HORZ/VERT intra strips actually predicted with filter intra |
| 856 | // (lane-rectsplit r1) -- the case `decode_block_rect` refused by name |
| 857 | // ("this decoder predicts square-only") until `predict_filter_intra` took |
| 858 | // `bw`x`bh`. |
| 859 | thread_local! |
| 860 | |
| 861 | |
| 862 | |
| 863 | |
| 864 | /// Current value of [`FILTER_INTRA_RECT_HITS`]. |
| 865 | // read only from the `#[cfg(test)]` gates |
| 866 | pub |
| 867 | |
| 868 | |
| 869 | |
| 870 | // As [`FILTER_INTRA_RECT_HITS`], counting only the 32x32-level 1:4 strips |
| 871 | // (32x8/8x32, lane-fi32x8 r1) -- the shapes whose `use_filter_intra` symbol |
| 872 | // was never read at all before that round, so a gate needs to prove the flag |
| 873 | // fired at THAT shape and not at a 16x8 one somewhere else in the frame. |
| 874 | // Split by ORIENTATION: rows 8 (32x8) and 9 (8x32) of `cdf::FILTER_INTRA` |
| 875 | // carry different probabilities (18101 vs 20229), so a transposed pair is |
| 876 | // only caught by a gate that sees the flag fire on BOTH shapes (class |
| 877 | // scan-weights-cross-axis). |
| 878 | thread_local! |
| 879 | |
| 880 | |
| 881 | |
| 882 | |
| 883 | |
| 884 | |
| 885 | /// Current value of [`FILTER_INTRA_RECT4_HORZ_HITS`] (32x8 strips). |
| 886 | // read only from the `#[cfg(test)]` gates |
| 887 | pub |
| 888 | |
| 889 | |
| 890 | |
| 891 | /// Current value of [`FILTER_INTRA_RECT4_VERT_HITS`] (8x32 strips). |
| 892 | // read only from the `#[cfg(test)]` gates |
| 893 | pub |
| 894 | |
| 895 | |
| 896 | |
| 897 | // How many rectangular transform units actually coded coefficients through |
| 898 | // [`read_coeffs_rect`] (`all_zero == 0`) -- lane-rect1d's measure that a gate |
| 899 | // exercised the rect coefficient reader at all rather than passing on |
| 900 | // all-skip blocks. |
| 901 | thread_local! |
| 902 | |
| 903 | |
| 904 | |
| 905 | |
| 906 | /// Current value of [`RECT_COEFF_TU_HITS`]. |
| 907 | // read only from the `#[cfg(test)]` gates |
| 908 | pub |
| 909 | |
| 910 | |
| 911 | |
| 912 | /// Rectangular transform units whose resolved `tx_type` is a 1D class |
| 913 | /// (`V_DCT`/`H_DCT`) -- [`TX_CLASS1_HITS`]'s rect-only half, so a gate can |
| 914 | /// pin that the 1D-class-on-a-RECT-transform path fired rather than settling |
| 915 | /// for the square reader's own 1D types. |
| 916 | // read only from the `#[cfg(test)]` gates |
| 917 | pub |
| 918 | |
| 919 | |
| 920 | |
| 921 | // lane-av1readcensus: the PER-UNIT coefficient census -- one unit counted |
| 922 | // per `read_coeffs`/`read_coeffs_rect` call, i.e. per object this decoder |
| 923 | // actually walks, which is the unit the round-4 `av1444rect` count measured |
| 924 | // (636 square chroma reads against the oracle's 1086). |
| 925 | // |
| 926 | // lane-av1422census422 widened the arming. The counters used to be |
| 927 | // 4:4:4-ONLY (`CENSUS_444`), so at 4:2:2 -- a chroma format an AV1 |
| 928 | // `color_config` can carry and libaom's writer emits -- every |
| 929 | // `census_444_units()` / `census_444_coded()` read zero BY CONSTRUCTION: a |
| 930 | // byte-exact 4:2:2 gate asserting those counters would be asserting a |
| 931 | // literal, and would be green while proving nothing about that stream. The |
| 932 | // census is now armed for every chroma format that leaves at least one luma |
| 933 | // axis unsubsampled -- (0,0) 4:4:4 and (1,0) 4:2:2 -- and 4:2:0 (1,1) stays |
| 934 | // off, so the existing 4:4:4 exact counts and the 4:2:0 zero control are |
| 935 | // unmoved by the widening. The counters are per-PLANE, not per-format, so a |
| 936 | // 4:2:2 cell's `[luma, u, v]` split is directly comparable with a 4:4:4 |
| 937 | // cell's on the same walk shape. |
| 938 | thread_local! |
| 939 | |
| 940 | |
| 941 | |
| 942 | |
| 943 | |
| 944 | |
| 945 | |
| 946 | |
| 947 | |
| 948 | |
| 949 | |
| 950 | |
| 951 | |
| 952 | |
| 953 | |
| 954 | |
| 955 | |
| 956 | |
| 957 | |
| 958 | |
| 959 | |
| 960 | |
| 961 | /// Current `[luma, u, v]` coefficient-unit counts, per plane. Zero at 4:2:0 |
| 962 | /// by design ([`set_census_nonsub`] arms nothing there). |
| 963 | |
| 964 | |
| 965 | |
| 966 | |
| 967 | /// Current `[luma, u, v]` counts of units that coded coefficients. |
| 968 | |
| 969 | |
| 970 | |
| 971 | |
| 972 | /// lane-av1readcensus: arms the coefficient-unit census for the frame about |
| 973 | /// to decode, called once per frame from [`crate::stream`]'s decode loop |
| 974 | /// beside [`set_subsampling`]. Armed for every chroma format with an |
| 975 | /// unsubsampled luma axis -- 4:4:4 (0,0) and 4:2:2 (1,0) -- and NOT for |
| 976 | /// 4:2:0 (1,1), where the walk-shape question this census answers does not |
| 977 | /// arise, so a 4:2:0 control can still assert exactly zero. |
| 978 | /// |
| 979 | /// lane-av1422census422 widened this from `(ss_x == 0 && ss_y == 0)`. The |
| 980 | /// old condition made 4:2:2 silently UNCUNTABLE rather than uncounted. The |
| 981 | /// two format pairs keep disjoint conditions, so neither the 4:4:4 exact |
| 982 | /// counts nor the 4:2:0 zero control can move because of this. |
| 983 | pub |
| 984 | |
| 985 | |
| 986 | |
| 987 | /// lane-av1readcensus: the plane the units read from here on belong to, |
| 988 | /// stamped by the plane-owning readers ([`read_plane`], [`read_inter_plane`], |
| 989 | /// [`read_inter_plane_rect`]) on entry. |
| 990 | pub |
| 991 | |
| 992 | |
| 993 | |
| 994 | /// lane-av1readcensus: is the per-unit census trace on? Shares |
| 995 | /// [`coeff_trace_on`]'s per-frame narrowing so one frame's walk can be |
| 996 | /// dumped without the rest of the stream. |
| 997 | |
| 998 | |
| 999 | |
| 1000 | |
| 1001 | |
| 1002 | |
| 1003 | |
| 1004 | |
| 1005 | |
| 1006 | |
| 1007 | |
| 1008 | /// lane-av1readcensus: one line per coefficient unit this decoder walks, the |
| 1009 | /// twin of the oracle's `EC_COEFF` / `EC_COEFF_VAL` bracket around each |
| 1010 | /// `av1_read_coeffs_txb` call. Pair the two sides by `post_rng` (or by `n`), |
| 1011 | /// never by plane label or by walk position -- the walk order is exactly what |
| 1012 | /// the census is measuring. |
| 1013 | pub |
| 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 | /// How many transform units this thread has read since the last |
| 1053 | /// [`reset_census_unit_n`] (lane-av1offtile). The per-unit oracle twin is |
| 1054 | /// `EC_ECDUMP_IN`, one line per `read_coeffs_txb` call, so this count IS |
| 1055 | /// directly comparable with an oracle `EC_ECDUMP_IN` census -- which is what |
| 1056 | /// makes "we walk N units where libaom walks M" a gated claim rather than an |
| 1057 | /// inference from the desync's position. |
| 1058 | |
| 1059 | |
| 1060 | |
| 1061 | |
| 1062 | /// Reset [`census_unit_n`] to zero (lane-av1offtile). |
| 1063 | |
| 1064 | |
| 1065 | |
| 1066 | |
| 1067 | // As [`FILTER_INTRA_RECT_HITS`], counting only the strips BELOW 16x16 |
| 1068 | // (8x16/16x8 leaves of a 16x16 HORZ/VERT partition, lane-fistrip r1) -- the |
| 1069 | // shapes whose `use_filter_intra` symbol had no CDF class before this round. |
| 1070 | // A gate asserting the wider counter would be satisfied by a 32x16 strip and |
| 1071 | // prove nothing about the new shapes. |
| 1072 | thread_local! |
| 1073 | |
| 1074 | |
| 1075 | |
| 1076 | |
| 1077 | /// Current value of [`FILTER_INTRA_RECT_SUB16_HITS`]. |
| 1078 | // read only from the `#[cfg(test)]` gates |
| 1079 | pub |
| 1080 | |
| 1081 | |
| 1082 | |
| 1083 | // As [`FILTER_INTRA_RECT_SUB16_HITS`], one partition level further down: |
| 1084 | // 4x8/8x4 leaves of an 8x8 HORZ/VERT (lane-fi8 r1). A gate on the sub16 |
| 1085 | // counter would be satisfied by a 16x8 strip and prove nothing here. |
| 1086 | thread_local! |
| 1087 | |
| 1088 | |
| 1089 | |
| 1090 | |
| 1091 | /// Current value of [`FILTER_INTRA_RECT_SUB8_HITS`]. |
| 1092 | // read only from the `#[cfg(test)]` gates |
| 1093 | pub |
| 1094 | |
| 1095 | |
| 1096 | |
| 1097 | // How many [`read_coeffs`] reads resolved a `tx_type` outside `TX_CLASS_2D` |
| 1098 | // (`V_DCT`/`H_DCT`, spec 5.11.39's `TxClass::Horiz`/`Vert`), across every |
| 1099 | // call on the current thread -- the same before/after counter pattern as |
| 1100 | // [`TX_DEPTH_HITS`], proving a stream actually exercised the class-split |
| 1101 | // `eob_pt`/1D-neighbour context path rather than every block coincidentally |
| 1102 | // landing on `DCT_DCT`. |
| 1103 | thread_local! |
| 1104 | |
| 1105 | |
| 1106 | |
| 1107 | |
| 1108 | // How many `uv_mode` reads resolved to a directional chroma mode (neither |
| 1109 | // `DC_PRED` nor `UV_CFL_PRED`), across every call on the current thread -- the same |
| 1110 | // before/after counter pattern as [`FILTER_INTRA_HITS`], proving a stream |
| 1111 | // actually exercised chroma's own directional predictor. |
| 1112 | thread_local! |
| 1113 | |
| 1114 | |
| 1115 | |
| 1116 | |
| 1117 | /// Current value of [`DIRECTIONAL_UV_HITS`]. |
| 1118 | // read only from the `#[cfg(test)]` gates |
| 1119 | pub |
| 1120 | |
| 1121 | |
| 1122 | |
| 1123 | // How many `angle_delta`/`angle_delta_uv` symbols this decoder has read as |
| 1124 | // something other than [`ANGLE_DELTA_ZERO`], across every call in the |
| 1125 | // process -- the same before/after counter pattern as [`FILTER_INTRA_HITS`], |
| 1126 | // proving a stream actually exercised a nonzero angle delta. |
| 1127 | thread_local! |
| 1128 | |
| 1129 | |
| 1130 | |
| 1131 | |
| 1132 | // How many [`read_single_ref`] reads resolved to a reference other than |
| 1133 | // `LAST_FRAME`, across every call on the current thread -- the same before/after |
| 1134 | // counter pattern as [`FILTER_INTRA_HITS`], proving a stream actually |
| 1135 | // exercised a non-`LAST_FRAME` reference (`GOLDEN_FRAME`, this decoder's |
| 1136 | // only other supported one so far) rather than every block coincidentally |
| 1137 | // resolving `LAST_FRAME`. |
| 1138 | thread_local! |
| 1139 | |
| 1140 | |
| 1141 | |
| 1142 | |
| 1143 | /// Current value of [`NON_LAST_REF_HITS`]. |
| 1144 | // read only from the `#[cfg(test)]` gates |
| 1145 | pub |
| 1146 | |
| 1147 | |
| 1148 | |
| 1149 | // Per-reference [`NON_LAST_REF_HITS`] breakdown (lane-av1refs): one counter |
| 1150 | // per `MV_REFERENCE_FRAME` past `LAST_FRAME`, so a gate targeting one |
| 1151 | // specific reference (`LAST2`/`LAST3`/`GOLDEN`/`BWDREF`/`ALTREF2`/`ALTREF`) |
| 1152 | // can prove THAT reference fired rather than any non-`LAST_FRAME` one -- |
| 1153 | // `NON_LAST_REF_HITS` alone cannot tell a `LAST2_FRAME` gate from a |
| 1154 | // `GOLDEN_FRAME` draw it did not ask for. |
| 1155 | thread_local! |
| 1156 | |
| 1157 | |
| 1158 | |
| 1159 | |
| 1160 | thread_local! |
| 1161 | |
| 1162 | |
| 1163 | |
| 1164 | |
| 1165 | thread_local! |
| 1166 | |
| 1167 | |
| 1168 | |
| 1169 | |
| 1170 | thread_local! |
| 1171 | |
| 1172 | |
| 1173 | |
| 1174 | |
| 1175 | thread_local! |
| 1176 | |
| 1177 | |
| 1178 | |
| 1179 | |
| 1180 | thread_local! |
| 1181 | |
| 1182 | |
| 1183 | |
| 1184 | |
| 1185 | // How many [`read_comp_mode`] reads resolved `COMPOUND_REFERENCE` (lane-av1comp) |
| 1186 | // -- proves a `reference_select` stream actually reached a block that picked |
| 1187 | // compound, not just that the header bit was set. Every such block is |
| 1188 | // refused after this fires ([`decode_inter_block`]/[`decode_inter_block8`]), |
| 1189 | // so this only ever counts attempted reads, never a completed decode. |
| 1190 | thread_local! |
| 1191 | |
| 1192 | |
| 1193 | |
| 1194 | |
| 1195 | /// Current value of [`COMP_MODE_HITS`]. |
| 1196 | // read only from the `#[cfg(test)]` gates |
| 1197 | pub |
| 1198 | |
| 1199 | |
| 1200 | |
| 1201 | // How many blocks [`read_intra_mode`] decoded a real (nonzero-size) palette-Y |
| 1202 | // use for, across every call on the current thread -- the same before/after |
| 1203 | // counter pattern as [`FILTER_INTRA_HITS`], proving a stream actually |
| 1204 | // exercised palette reconstruction rather than only reading and refusing the |
| 1205 | // `palette_y_mode` symbol. |
| 1206 | thread_local! |
| 1207 | |
| 1208 | |
| 1209 | |
| 1210 | /// Current value of [`PALETTE_HITS`]. |
| 1211 | // read only from the `#[cfg(test)]` gates |
| 1212 | pub |
| 1213 | |
| 1214 | |
| 1215 | |
| 1216 | // lane-tiles r12: of those, how many sat at their own TILE's left column -- |
| 1217 | // exactly the blocks whose palette cache/ctx must NOT see the previous tile's |
| 1218 | // colours (`av1_get_palette_cache`'s `xd->left_mbmi == NULL`). A multi-tile |
| 1219 | // palette gate that never hits one proves nothing about the tile guard. |
| 1220 | thread_local! |
| 1221 | |
| 1222 | |
| 1223 | |
| 1224 | /// Current value of [`PALETTE_TILE_LEFT_HITS`]. |
| 1225 | // read only from the `#[cfg(test)]` gates |
| 1226 | pub |
| 1227 | |
| 1228 | |
| 1229 | |
| 1230 | // lane-palette2 r1: as [`PALETTE_HITS`], for a real (nonzero-size) chroma |
| 1231 | // palette use -- proves a stream actually reconstructed UV palette pixels, |
| 1232 | // not just read and refused the `palette_uv_mode` symbol. |
| 1233 | thread_local! |
| 1234 | |
| 1235 | |
| 1236 | |
| 1237 | /// Current value of [`PALETTE_UV_HITS`]. |
| 1238 | // read only from the `#[cfg(test)]` gates |
| 1239 | pub |
| 1240 | |
| 1241 | |
| 1242 | |
| 1243 | // lane-palette2 r1: how many HORZ/VERT rect intra strips ([`read_intra_mode_rect`]) |
| 1244 | // decoded a real palette-Y use -- proves the rect strip's own palette syntax |
| 1245 | // (not just the square path's) actually fired. |
| 1246 | thread_local! |
| 1247 | |
| 1248 | |
| 1249 | |
| 1250 | /// Current value of [`PALETTE_RECT_HITS`]. |
| 1251 | // read only from the `#[cfg(test)]` gates |
| 1252 | pub |
| 1253 | |
| 1254 | |
| 1255 | |
| 1256 | // lane-palette2 r6: how many HORZ/VERT rect intra strips ran the |
| 1257 | // [`palette_bsize_ctx_wh`]-gated code path in [`read_intra_mode_rect`] -- |
| 1258 | // i.e. `allow_screen_content_tools` was set and the strip's `bw`x`bh` was in |
| 1259 | // range, so `palette_y_mode`/`palette_uv_mode` were actually read (and, per |
| 1260 | // RD, almost always refused-on-use because the block doesn't end up USING a |
| 1261 | // palette -- see r5's report). This is the site the removed refusal |
| 1262 | // ("a HORZ/VERT intra strip in a screen-content frame") used to guard: it |
| 1263 | // fired here whether or not the block picked a palette, so this is the |
| 1264 | // counter that proves the case r5's narrower [`PALETTE_RECT_HITS`] almost |
| 1265 | // never observes. |
| 1266 | thread_local! |
| 1267 | |
| 1268 | |
| 1269 | |
| 1270 | /// Current value of [`RECT_SCREEN_CONTENT_HITS`]. |
| 1271 | // read only from the `#[cfg(test)]` gates |
| 1272 | pub |
| 1273 | |
| 1274 | |
| 1275 | |
| 1276 | // lane-palette2 r1: how many palette-Y luma transform UNITS decoded under a |
| 1277 | // split luma transform (`logical_tx != side`) -- proves the per-TU index-map |
| 1278 | // windowing actually ran, not just that the whole-block path stayed exact. |
| 1279 | // Counts units, not blocks (a 64x64 palette block split to 16x16 TUs adds 16); |
| 1280 | // first actually incremented in r7, when the refusal it guarded was lifted. |
| 1281 | thread_local! |
| 1282 | |
| 1283 | |
| 1284 | |
| 1285 | thread_local! |
| 1286 | |
| 1287 | |
| 1288 | |
| 1289 | |
| 1290 | |
| 1291 | |
| 1292 | /// Current value of [`RECT4_PALETTE_HITS`]. |
| 1293 | // read only from the `#[cfg(test)]` gates |
| 1294 | pub |
| 1295 | |
| 1296 | |
| 1297 | |
| 1298 | /// Current value of [`PALETTE_SPLIT_TX_HITS`]. |
| 1299 | // read only from the `#[cfg(test)]` gates |
| 1300 | pub |
| 1301 | |
| 1302 | |
| 1303 | |
| 1304 | thread_local! |
| 1305 | |
| 1306 | |
| 1307 | |
| 1308 | |
| 1309 | |
| 1310 | |
| 1311 | |
| 1312 | |
| 1313 | |
| 1314 | |
| 1315 | |
| 1316 | |
| 1317 | |
| 1318 | |
| 1319 | |
| 1320 | |
| 1321 | |
| 1322 | |
| 1323 | |
| 1324 | |
| 1325 | |
| 1326 | |
| 1327 | |
| 1328 | |
| 1329 | |
| 1330 | |
| 1331 | |
| 1332 | |
| 1333 | /// Current value of [`CHROMA_PALETTE_WINDOW_HITS`]. |
| 1334 | // read only from the `#[cfg(test)]` gates |
| 1335 | pub |
| 1336 | |
| 1337 | |
| 1338 | |
| 1339 | /// Zeroes [`CHROMA_PALETTE_WINDOW_HITS`] so a gate can read it as a DELTA |
| 1340 | /// (it is process-wide, like every counter here). |
| 1341 | // read only from the `#[cfg(test)]` gates |
| 1342 | pub |
| 1343 | |
| 1344 | |
| 1345 | |
| 1346 | thread_local! |
| 1347 | |
| 1348 | |
| 1349 | |
| 1350 | |
| 1351 | |
| 1352 | |
| 1353 | |
| 1354 | /// Current value of [`PALETTE_LEAF8_HITS`]. |
| 1355 | // read only from the `#[cfg(test)]` gates |
| 1356 | pub |
| 1357 | |
| 1358 | |
| 1359 | |
| 1360 | /// Zeroes [`PALETTE_LEAF8_HITS`] (per-attempt gate counting). |
| 1361 | // read only from the `#[cfg(test)]` gates |
| 1362 | pub |
| 1363 | |
| 1364 | |
| 1365 | |
| 1366 | thread_local! |
| 1367 | |
| 1368 | |
| 1369 | |
| 1370 | |
| 1371 | |
| 1372 | |
| 1373 | /// Current value of [`PALETTE_SB_STRIP_HITS`]. |
| 1374 | // read only from the `#[cfg(test)]` gates |
| 1375 | pub |
| 1376 | |
| 1377 | |
| 1378 | |
| 1379 | /// Zeroes [`PALETTE_SB_STRIP_HITS`] (per-attempt gate counting). |
| 1380 | // read only from the `#[cfg(test)]` gates |
| 1381 | pub |
| 1382 | |
| 1383 | |
| 1384 | |
| 1385 | thread_local! |
| 1386 | |
| 1387 | |
| 1388 | |
| 1389 | |
| 1390 | |
| 1391 | |
| 1392 | |
| 1393 | |
| 1394 | |
| 1395 | |
| 1396 | |
| 1397 | |
| 1398 | |
| 1399 | |
| 1400 | |
| 1401 | |
| 1402 | |
| 1403 | |
| 1404 | |
| 1405 | |
| 1406 | |
| 1407 | |
| 1408 | |
| 1409 | |
| 1410 | |
| 1411 | |
| 1412 | |
| 1413 | |
| 1414 | |
| 1415 | |
| 1416 | |
| 1417 | |
| 1418 | |
| 1419 | |
| 1420 | |
| 1421 | /// Current values of the four `RECT_TILED_CHROMA_*` counters, in the order |
| 1422 | /// `(unit_reach_differs, 2x1, 1x2, other multi-unit)`. |
| 1423 | // read only from the `#[cfg(test)]` gates |
| 1424 | pub |
| 1425 | |
| 1426 | |
| 1427 | |
| 1428 | |
| 1429 | |
| 1430 | |
| 1431 | |
| 1432 | |
| 1433 | /// Zeroes the four `RECT_TILED_CHROMA_*` counters (gate tests call this |
| 1434 | /// before their own decode). |
| 1435 | // read only from the `#[cfg(test)]` gates |
| 1436 | pub |
| 1437 | |
| 1438 | |
| 1439 | |
| 1440 | |
| 1441 | |
| 1442 | |
| 1443 | // lane-t900 r22: palette blocks reconstructed inside an INTER frame (the |
| 1444 | // intra-in-inter path, `decode_inter_block`/`decode_inter_block8`) -- counted |
| 1445 | // apart from [`PALETTE_HITS`] so a witness gate can prove the INTER-frame |
| 1446 | // capability rather than the key frame's, which every screen stream also |
| 1447 | // carries. |
| 1448 | thread_local! |
| 1449 | |
| 1450 | |
| 1451 | |
| 1452 | |
| 1453 | // lane-t900 r23: as [`INTRA_IN_INTER_PALETTE_Y_HITS`], narrowed to the 8x8 |
| 1454 | // LEAF site ([`decode_inter_block8`]'s intra arm) -- the >=16 site fires the |
| 1455 | // shared counter too, so only this one proves a gate really reached the leaf |
| 1456 | // where the refusal used to sit. |
| 1457 | thread_local! |
| 1458 | |
| 1459 | |
| 1460 | |
| 1461 | |
| 1462 | /// Current values of the 8x8-leaf intra-in-inter palette counters, `(y, uv)`. |
| 1463 | pub |
| 1464 | |
| 1465 | |
| 1466 | |
| 1467 | /// Current values of the two intra-in-inter palette counters, `(y, uv)`. |
| 1468 | pub |
| 1469 | |
| 1470 | |
| 1471 | |
| 1472 | |
| 1473 | |
| 1474 | |
| 1475 | // lane-hgkf r2: SKIPPED intra blocks whose `tx_depth` split the luma transform |
| 1476 | // and which are therefore predicted one transform unit at a time (a skipped |
| 1477 | // block codes no coefficients, so nothing else in the stream witnesses this |
| 1478 | // path -- only the pixels do). |
| 1479 | thread_local! |
| 1480 | |
| 1481 | |
| 1482 | |
| 1483 | /// Current value of [`SKIP_SPLIT_TX_HITS`] (blocks, not units). |
| 1484 | |
| 1485 | |
| 1486 | |
| 1487 | |
| 1488 | // lane-svt1: SKIPPED square blocks carrying a palette/intrabc prediction whose |
| 1489 | // `tx_depth` split the luma transform -- the arm that predicted DC off the |
| 1490 | // block edges before the fix. Like [`SKIP_SPLIT_TX_HITS`] only the pixels |
| 1491 | // witness this path, so a gate that wants it needs the counter. |
| 1492 | thread_local! |
| 1493 | |
| 1494 | |
| 1495 | |
| 1496 | |
| 1497 | |
| 1498 | |
| 1499 | |
| 1500 | |
| 1501 | |
| 1502 | |
| 1503 | |
| 1504 | |
| 1505 | /// Current value of [`SKIP_SPLIT_TX_OVERRIDE_HITS`] (blocks). |
| 1506 | |
| 1507 | |
| 1508 | |
| 1509 | |
| 1510 | /// lane-av1chromadc: [`SKIP_CHROMA_OVERRIDE_WINDOW_HITS`]. |
| 1511 | // read only from the `#[cfg(test)]` gates |
| 1512 | |
| 1513 | |
| 1514 | |
| 1515 | |
| 1516 | /// Zeroes [`SKIP_CHROMA_OVERRIDE_WINDOW_HITS`] before a gate's own decode. |
| 1517 | // read only from the `#[cfg(test)]` gates |
| 1518 | |
| 1519 | |
| 1520 | |
| 1521 | |
| 1522 | /// Zeroes [`SKIP_SPLIT_TX_OVERRIDE_HITS`] before a gate's own decode attempt. |
| 1523 | |
| 1524 | |
| 1525 | |
| 1526 | |
| 1527 | // lane-svtinter: palette colour-index maps whose block is cut by the frame's |
| 1528 | // bottom/right mi edge, so spec 5.11.50's `onscreenWidth`/`onscreenHeight` |
| 1529 | // really are smaller than the block and FEWER symbols are read than the |
| 1530 | // block has cells (class map-read-past-frame-edge). |
| 1531 | thread_local! |
| 1532 | |
| 1533 | |
| 1534 | |
| 1535 | /// Current value of [`PALETTE_ONSCREEN_CUT_HITS`] (colour-index maps). |
| 1536 | |
| 1537 | |
| 1538 | |
| 1539 | |
| 1540 | /// Zeroes [`PALETTE_ONSCREEN_CUT_HITS`] before a gate's own decode attempt. |
| 1541 | |
| 1542 | |
| 1543 | |
| 1544 | |
| 1545 | /// Zeroes [`SKIP_SPLIT_TX_HITS`] before a gate's own decode attempt. |
| 1546 | |
| 1547 | |
| 1548 | |
| 1549 | |
| 1550 | // lane-intrainter r1: intra blocks inside an INTER frame whose `tx_depth` |
| 1551 | // symbol split their luma transform, bucketed by block side (8, 16, 32, 64) -- |
| 1552 | // the gate's proof that the lifted path actually ran, per size. |
| 1553 | thread_local! |
| 1554 | |
| 1555 | |
| 1556 | |
| 1557 | |
| 1558 | /// Current value of [`INTRA_IN_INTER_SPLIT_TX_HITS`], indexed 8/16/32/64. |
| 1559 | // read only from the `#[cfg(test)]` gates |
| 1560 | pub |
| 1561 | |
| 1562 | |
| 1563 | |
| 1564 | thread_local! |
| 1565 | |
| 1566 | |
| 1567 | |
| 1568 | |
| 1569 | |
| 1570 | |
| 1571 | |
| 1572 | |
| 1573 | |
| 1574 | |
| 1575 | |
| 1576 | |
| 1577 | |
| 1578 | |
| 1579 | |
| 1580 | |
| 1581 | |
| 1582 | |
| 1583 | |
| 1584 | |
| 1585 | |
| 1586 | |
| 1587 | /// Zeroes [`RECT_INTRABC_READS`] (gate tests call this before a decode). |
| 1588 | // read only from the `#[cfg(test)]` gates |
| 1589 | pub |
| 1590 | |
| 1591 | |
| 1592 | |
| 1593 | thread_local! |
| 1594 | |
| 1595 | |
| 1596 | |
| 1597 | |
| 1598 | |
| 1599 | thread_local! |
| 1600 | |
| 1601 | |
| 1602 | |
| 1603 | |
| 1604 | |
| 1605 | |
| 1606 | |
| 1607 | |
| 1608 | /// Current value of [`INTRABC_TX4_CHROMA_COPY_HITS`]. |
| 1609 | // read only from the `#[cfg(test)]` gates |
| 1610 | pub |
| 1611 | |
| 1612 | |
| 1613 | |
| 1614 | /// Zeroes [`INTRABC_TX4_CHROMA_COPY_HITS`] (gate tests call this before a decode). |
| 1615 | // read only from the `#[cfg(test)]` gates |
| 1616 | pub |
| 1617 | |
| 1618 | |
| 1619 | |
| 1620 | /// Current value of [`LEAF8_INTRABC_HITS`]. |
| 1621 | pub |
| 1622 | |
| 1623 | |
| 1624 | |
| 1625 | /// Zeroes [`LEAF8_INTRABC_HITS`] (gate tests call this before a decode). |
| 1626 | // read only from the `#[cfg(test)]` gates |
| 1627 | pub |
| 1628 | |
| 1629 | |
| 1630 | |
| 1631 | /// Current value of [`INTRABC_HITS`]. |
| 1632 | // read only from the `#[cfg(test)]` gates |
| 1633 | pub |
| 1634 | |
| 1635 | |
| 1636 | |
| 1637 | thread_local! |
| 1638 | |
| 1639 | |
| 1640 | |
| 1641 | |
| 1642 | |
| 1643 | |
| 1644 | |
| 1645 | |
| 1646 | |
| 1647 | /// Current value of [`SKIPPED_INTRABC_CHROMA_ARM_HITS`]. |
| 1648 | // read only from the `#[cfg(test)]` gates and the probe |
| 1649 | pub |
| 1650 | |
| 1651 | |
| 1652 | |
| 1653 | /// Zeroes [`SKIPPED_INTRABC_CHROMA_ARM_HITS`] (gate tests call this before a |
| 1654 | /// decode). |
| 1655 | // read only from the `#[cfg(test)]` gates |
| 1656 | pub |
| 1657 | |
| 1658 | |
| 1659 | |
| 1660 | thread_local! |
| 1661 | |
| 1662 | |
| 1663 | |
| 1664 | |
| 1665 | |
| 1666 | |
| 1667 | |
| 1668 | |
| 1669 | |
| 1670 | |
| 1671 | /// Current value of [`SKIPPED_INTRABC_DV_COPY_HITS`]. |
| 1672 | // read only from the `#[cfg(test)]` gates |
| 1673 | pub |
| 1674 | |
| 1675 | |
| 1676 | |
| 1677 | /// Zeroes [`SKIPPED_INTRABC_DV_COPY_HITS`] (gate tests call this before a |
| 1678 | /// decode). |
| 1679 | // read only from the `#[cfg(test)]` gates |
| 1680 | pub |
| 1681 | |
| 1682 | |
| 1683 | |
| 1684 | /// Zeroes [`INTRABC_HITS`] (gate tests call this before a decode). |
| 1685 | // read only from the `#[cfg(test)]` gates |
| 1686 | pub |
| 1687 | |
| 1688 | |
| 1689 | |
| 1690 | thread_local! |
| 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 | /// lane-av1-intrabc r4: coded (`skip == 0`) rect intrabc blocks reconstructed, |
| 1769 | /// as `[horz, vert]` -- see [`INTRABC_RECT_CODED_HITS`]. |
| 1770 | // read only from the `#[cfg(test)]` gates |
| 1771 | |
| 1772 | |
| 1773 | |
| 1774 | |
| 1775 | /// lane-av1-intrabc r5: skipped (`skip == 1`) rect intrabc blocks |
| 1776 | /// reconstructed, as `[horz, vert]` -- see [`INTRABC_RECT_SKIPPED_HITS`]. |
| 1777 | // read only from the `#[cfg(test)]` gates |
| 1778 | |
| 1779 | |
| 1780 | |
| 1781 | |
| 1782 | /// Current value of [`INTRABC_RECT_HITS`]. |
| 1783 | // read only from the `#[cfg(test)]` gates |
| 1784 | |
| 1785 | |
| 1786 | |
| 1787 | |
| 1788 | /// Zeroes [`INTRABC_RECT_HITS`]/[`INTRABC_RECT_VARTX_HITS`]. |
| 1789 | // read only from the `#[cfg(test)]` gates |
| 1790 | pub |
| 1791 | |
| 1792 | |
| 1793 | |
| 1794 | |
| 1795 | |
| 1796 | |
| 1797 | /// lane-ibc444c: [`IBC_RECT_CHROMA_FOOTPRINT_444_HITS`]. |
| 1798 | // read only from the `#[cfg(test)]` gates |
| 1799 | |
| 1800 | |
| 1801 | |
| 1802 | |
| 1803 | /// lane-ibc444c: zeroes [`IBC_RECT_CHROMA_FOOTPRINT_444_HITS`]. |
| 1804 | // read only from the `#[cfg(test)]` gates |
| 1805 | pub |
| 1806 | |
| 1807 | |
| 1808 | |
| 1809 | /// lane-av1chromarect: [`IBC_OWNED_RECT_CHROMA_FOOTPRINT_444_HITS`]. |
| 1810 | // read only from the `#[cfg(test)]` gates |
| 1811 | |
| 1812 | |
| 1813 | |
| 1814 | |
| 1815 | /// lane-av1chromarect: zeroes [`IBC_OWNED_RECT_CHROMA_FOOTPRINT_444_HITS`]. |
| 1816 | // read only from the `#[cfg(test)]` gates |
| 1817 | pub |
| 1818 | |
| 1819 | |
| 1820 | |
| 1821 | /// lane-av1422ibctxsel: [`IBC_OWNED_RECT_422_PAIR_HITS`]. |
| 1822 | // read only from the `#[cfg(test)]` gates |
| 1823 | |
| 1824 | |
| 1825 | |
| 1826 | |
| 1827 | /// lane-av1422ibctxsel: zeroes [`IBC_OWNED_RECT_422_PAIR_HITS`]. |
| 1828 | // read only from the `#[cfg(test)]` gates |
| 1829 | pub |
| 1830 | |
| 1831 | |
| 1832 | |
| 1833 | /// lane-whtshape: [`INTRABC_RECT_LOSSLESS_CHROMA4_HITS`]. |
| 1834 | // read only from the `#[cfg(test)]` gates |
| 1835 | |
| 1836 | |
| 1837 | |
| 1838 | |
| 1839 | /// lane-whtshape: zeroes [`INTRABC_RECT_LOSSLESS_CHROMA4_HITS`]. |
| 1840 | // read only from the `#[cfg(test)]` gates |
| 1841 | pub |
| 1842 | |
| 1843 | |
| 1844 | |
| 1845 | /// Current value of [`INTRABC_RECT_VARTX_HITS`]. |
| 1846 | // read only from the `#[cfg(test)]` gates |
| 1847 | |
| 1848 | |
| 1849 | |
| 1850 | |
| 1851 | thread_local! |
| 1852 | |
| 1853 | |
| 1854 | |
| 1855 | |
| 1856 | |
| 1857 | |
| 1858 | |
| 1859 | |
| 1860 | |
| 1861 | |
| 1862 | |
| 1863 | |
| 1864 | |
| 1865 | |
| 1866 | |
| 1867 | |
| 1868 | |
| 1869 | /// Current value of [`INTRABC_128RECT_HITS`]. |
| 1870 | // read only from the `#[cfg(test)]` gates |
| 1871 | |
| 1872 | |
| 1873 | |
| 1874 | |
| 1875 | /// Zeroes [`INTRABC_128RECT_HITS`]. |
| 1876 | // read only from the `#[cfg(test)]` gates |
| 1877 | pub |
| 1878 | |
| 1879 | |
| 1880 | |
| 1881 | /// Current value of [`INTRABC_128RECT_CHROMA_CHUNK_HITS`]. |
| 1882 | // read only from the `#[cfg(test)]` gates |
| 1883 | |
| 1884 | |
| 1885 | |
| 1886 | |
| 1887 | /// Zeroes [`INTRABC_128RECT_CHROMA_CHUNK_HITS`] and |
| 1888 | /// [`INTRABC_128RECT_CHUNK_SHAPE`]. |
| 1889 | // read only from the `#[cfg(test)]` gates |
| 1890 | pub |
| 1891 | |
| 1892 | |
| 1893 | |
| 1894 | |
| 1895 | /// Current value of [`INTRABC_VARTX_HITS`]. |
| 1896 | |
| 1897 | |
| 1898 | |
| 1899 | |
| 1900 | /// Current value of [`INTRABC_VARTX_MIXED_LEAVES_HITS`]. |
| 1901 | |
| 1902 | |
| 1903 | |
| 1904 | |
| 1905 | /// Zeroes [`INTRABC_VARTX_HITS`] (gate tests call this before a decode). |
| 1906 | // read only from the `#[cfg(test)]` gates |
| 1907 | pub |
| 1908 | |
| 1909 | |
| 1910 | |
| 1911 | /// Zeroes [`INTRABC_VARTX_MIXED_LEAVES_HITS`] (gate tests call this before a |
| 1912 | /// decode). |
| 1913 | // read only from the `#[cfg(test)]` gates |
| 1914 | pub |
| 1915 | |
| 1916 | |
| 1917 | |
| 1918 | /// Current value of [`RECT_INTRABC_VARTX_HITS`]. |
| 1919 | // read only from the `#[cfg(test)]` gates |
| 1920 | |
| 1921 | |
| 1922 | |
| 1923 | |
| 1924 | // How many blocks decoded `skip_mode == 1` (lane-av1comp round 14) -- |
| 1925 | // proves a real `skip_mode_present` stream actually reached a block that |
| 1926 | // picked it, not just that the frame header bit was set. |
| 1927 | thread_local! |
| 1928 | |
| 1929 | |
| 1930 | |
| 1931 | |
| 1932 | /// Current value of [`SKIP_MODE_HITS`]. |
| 1933 | // read only from the `#[cfg(test)]` gates |
| 1934 | pub |
| 1935 | |
| 1936 | |
| 1937 | |
| 1938 | // lane-motionmode: how many blocks actually decoded `obmc_selected == true` |
| 1939 | // (as opposed to just reaching an eligible `read_motion_mode` symbol read) |
| 1940 | // -- the gate's own proof that a real aomenc `--enable-obmc=1` stream |
| 1941 | // reached [`obmc_blend`], not just the header bit. |
| 1942 | thread_local! |
| 1943 | |
| 1944 | |
| 1945 | |
| 1946 | |
| 1947 | // lane-fimv r1 (class wrong-alphabet-same-value): how many blocks took the |
| 1948 | // 2-symbol `obmc_cdf` alphabet *because* `force_integer_mv` (or a scaled |
| 1949 | // reference) vetoed `WARPED_CAUSAL` in libaom `motion_mode_allowed`, while |
| 1950 | // `allow_warped_motion == 1` and `num_proj_ref >= 1` would otherwise have |
| 1951 | // picked the 3-symbol `motion_mode_cdf`. These are exactly the blocks this |
| 1952 | // decoder used to read with the wrong alphabet, so a gate that asserts this |
| 1953 | // counter advanced proves the fixed path fired (class |
| 1954 | // `gate-blind-to-feature`). |
| 1955 | thread_local! |
| 1956 | |
| 1957 | |
| 1958 | |
| 1959 | /// Current value of [`FIMV_ALPHABET_HITS`]. |
| 1960 | |
| 1961 | |
| 1962 | |
| 1963 | |
| 1964 | // lane-fimv r1: how many frame headers this decoder has decoded with |
| 1965 | // `force_integer_mv == 1` (bumped by `stream.rs` per frame). Lets a gate |
| 1966 | // prove the encoder really produced the header state under test rather than |
| 1967 | // assume it. |
| 1968 | thread_local! |
| 1969 | |
| 1970 | |
| 1971 | |
| 1972 | /// Current value of [`FIMV_FRAME_HITS`]. |
| 1973 | |
| 1974 | |
| 1975 | |
| 1976 | |
| 1977 | /// Current value of [`OBMC_HITS`]. |
| 1978 | // read only from the `#[cfg(test)]` gates |
| 1979 | pub |
| 1980 | |
| 1981 | |
| 1982 | |
| 1983 | // lane-scaledref r1: per-case firing counts for the scaled-reference gate |
| 1984 | // (class `gate-blind-to-feature`) -- a pixel match under an UNSCALED |
| 1985 | // reference would pass just as well and prove nothing, so the gate |
| 1986 | // hard-asserts each combination this round lifts actually occurred: |
| 1987 | // a compound block with a scaled tap, a warp block whose warp libaom |
| 1988 | // suppresses because the reference is scaled, an OBMC block, an interintra |
| 1989 | // block, and an 8x8 leaf. |
| 1990 | thread_local! |
| 1991 | |
| 1992 | |
| 1993 | |
| 1994 | |
| 1995 | |
| 1996 | |
| 1997 | |
| 1998 | |
| 1999 | |
| 2000 | /// Current value of [`MIXED_SCALE_COMPOUND_HITS`]: compound blocks with one |
| 2001 | /// scaled and one unscaled tap. |
| 2002 | // read only from the `#[cfg(test)]` gates |
| 2003 | pub |
| 2004 | |
| 2005 | |
| 2006 | |
| 2007 | /// Current value of [`SCALED_WARP_SUPPRESSED_HITS`]: blocks that would have |
| 2008 | /// read the 3-symbol `motion_mode_cdf` but read the 2-symbol `obmc_cdf` |
| 2009 | /// instead because their reference is scaled (libaom `motion_mode_allowed`, |
| 2010 | /// `blockd.h:1484`). |
| 2011 | // read only from the `#[cfg(test)]` gates |
| 2012 | pub |
| 2013 | |
| 2014 | |
| 2015 | |
| 2016 | /// Current value of [`SCALED_COMPOUND_HITS`]. |
| 2017 | // read only from the `#[cfg(test)]` gates |
| 2018 | pub |
| 2019 | |
| 2020 | |
| 2021 | |
| 2022 | /// Current value of [`SCALED_WARP_FALLBACK_HITS`]. |
| 2023 | |
| 2024 | |
| 2025 | |
| 2026 | |
| 2027 | /// Current value of [`SCALED_OBMC_HITS`]. |
| 2028 | // read only from the `#[cfg(test)]` gates |
| 2029 | pub |
| 2030 | |
| 2031 | |
| 2032 | |
| 2033 | /// Current value of [`SCALED_INTERINTRA_HITS`]. |
| 2034 | // read only from the `#[cfg(test)]` gates |
| 2035 | pub |
| 2036 | |
| 2037 | |
| 2038 | |
| 2039 | /// Current value of [`SCALED_BLOCK8_HITS`]. |
| 2040 | // read only from the `#[cfg(test)]` gates |
| 2041 | pub |
| 2042 | |
| 2043 | |
| 2044 | |
| 2045 | // lane-motionmode round 3: same proof as [`OBMC_HITS`], narrowed to |
| 2046 | // `decode_inter_block8`'s own 8x8-leaf `read_motion_mode` -- a subset of |
| 2047 | // [`OBMC_HITS`] (both fire together on an 8x8 hit), lets the gate tell an |
| 2048 | // 8x8-leaf OBMC block apart from a 16x16+ one. |
| 2049 | thread_local! |
| 2050 | |
| 2051 | |
| 2052 | |
| 2053 | // lane-interp3 r1: how many inter blocks read a SWITCHABLE `interp_filter` |
| 2054 | // pair whose two directions differ (`enable_dual_filter` only -- with dual |
| 2055 | // filter off both directions take the single symbol, so this can never fire). |
| 2056 | // A gate asserting it proves the stream really carries dual-filter blocks. |
| 2057 | thread_local! |
| 2058 | |
| 2059 | |
| 2060 | |
| 2061 | // lane-interp3 r1: how many COMPOUND 8x8 leaves read their own |
| 2062 | // `read_mb_interp_filter` symbol(s) -- the read this round added (the leaf |
| 2063 | // used to skip it entirely, losing a symbol and stamping the `[3, 3]` |
| 2064 | // no-filter sentinel that made a neighbouring OBMC block panic). |
| 2065 | thread_local! |
| 2066 | |
| 2067 | |
| 2068 | |
| 2069 | /// Current value of [`DUAL_FILTER_DIFF_HITS`]. |
| 2070 | // read only from the `#[cfg(test)]` gates |
| 2071 | pub |
| 2072 | |
| 2073 | |
| 2074 | |
| 2075 | /// Current value of [`COMPOUND8_FILTER_HITS`]. |
| 2076 | // read only from the `#[cfg(test)]` gates |
| 2077 | pub |
| 2078 | |
| 2079 | |
| 2080 | |
| 2081 | // lane-warp round 1: how many blocks resolved `motion_mode_allowed` to |
| 2082 | // `WARPED_CAUSAL`-eligible (3-symbol read, `num_proj_ref >= 1` under |
| 2083 | // `allow_warped_motion`) AND the symbol actually decoded to `WARPED_CAUSAL` |
| 2084 | // -- the gate's proof that a fixture really exercises the alphabet this |
| 2085 | // round changed, even though the block itself still refuses (warp |
| 2086 | // estimation/filter not ported). |
| 2087 | thread_local! |
| 2088 | |
| 2089 | |
| 2090 | |
| 2091 | |
| 2092 | /// Current value of [`WARP_SELECTED_HITS`]. |
| 2093 | // read only from the `#[cfg(test)]` gates |
| 2094 | pub |
| 2095 | |
| 2096 | |
| 2097 | |
| 2098 | // lane-cwarp r1: how many COMPOUND_REFERENCE blocks had at least one |
| 2099 | // reference predicted through the per-ref GLOBAL warp (`av1_warp_plane` |
| 2100 | // into the compound intermediate) rather than translationally -- the |
| 2101 | // gate's proof that a `GLOBAL_GLOBALMV` block under a ROTZOOM/AFFINE model |
| 2102 | // really reached [`crate::warp::warp_affine_compound`]. |
| 2103 | // lane-av1422warp: the 4:2:2 coverage witness has to show compound and warped |
| 2104 | // motion firing ABOVE the vertical midpoint, and every pre-existing warp |
| 2105 | // counter is frame-global. These two are the same arms restricted to blocks |
| 2106 | // whose top mode-info row is in the frame's upper half, which is the half |
| 2107 | // this lane's evidence covers. |
| 2108 | thread_local! |
| 2109 | |
| 2110 | |
| 2111 | |
| 2112 | |
| 2113 | /// How many `GLOBAL_GLOBALMV` (compound) inter blocks decoded in the frame's |
| 2114 | /// upper half -- the block's top mode-info row is under `mi_rows / 2`. |
| 2115 | /// |
| 2116 | /// NO COMMITTED TEST READS THIS, and none can while the 4:2:2 header refusal |
| 2117 | /// stands: the pinned 4:2:2 coverage gate asserts the byte pin and the |
| 2118 | /// refusal by name, so nothing in the suite ever decodes a 4:2:2 stream. |
| 2119 | /// The figure quoted for that fixture comes from a patch-run-restore build |
| 2120 | /// with the `EC_AV1_ALLOW_422_PROBE` bypass applied and then reverted, which |
| 2121 | /// is the same discipline every 4:2:2 lane in this family uses. |
| 2122 | |
| 2123 | pub |
| 2124 | |
| 2125 | |
| 2126 | |
| 2127 | /// How many inter blocks in the frame's upper half satisfy libaom's |
| 2128 | /// `is_global_mv_block` on at least one reference slot -- mode |
| 2129 | /// `GLOBAL_GLOBALMV` AND block >= 8x8 AND that slot's own global-motion |
| 2130 | /// model > `TRANSLATION`. This is the block set whose prediction goes |
| 2131 | /// through `crate::warp`, and it is exactly `is_global_mv0 || is_global_mv1` |
| 2132 | /// as computed at the increment site; it is NOT merely "some slot has a |
| 2133 | /// non-TRANSLATION model", which also counts blocks that are not global-mv |
| 2134 | /// blocks. |
| 2135 | /// |
| 2136 | /// Like [`top_half_compound_hits`], no committed test reads it: with the |
| 2137 | /// 4:2:2 header refusal in force nothing in the suite decodes the stream |
| 2138 | /// these numbers describe. |
| 2139 | |
| 2140 | pub |
| 2141 | |
| 2142 | |
| 2143 | |
| 2144 | thread_local! |
| 2145 | |
| 2146 | |
| 2147 | |
| 2148 | |
| 2149 | /// Current value of [`COMPOUND_WARP_HITS`]. |
| 2150 | // read only from the `#[cfg(test)]` gates |
| 2151 | pub |
| 2152 | |
| 2153 | |
| 2154 | |
| 2155 | // lane-interp3 r3: the same proof narrowed to the 8x8 LEAF's own compound |
| 2156 | // arm ([`decode_inter_block8`]) -- that arm predicted both taps |
| 2157 | // translationally until r3, so a gate needs to tell a warped 8x8 compound |
| 2158 | // leaf apart from a warped 16x16+ one (both bump [`COMPOUND_WARP_HITS`]). |
| 2159 | thread_local! |
| 2160 | |
| 2161 | |
| 2162 | |
| 2163 | |
| 2164 | /// Current value of [`COMPOUND_WARP_HITS_8`]. |
| 2165 | // read only from the `#[cfg(test)]` gates |
| 2166 | pub |
| 2167 | |
| 2168 | |
| 2169 | |
| 2170 | // lane-gmaffine r1: how many blocks built their prediction from a |
| 2171 | // SIX-parameter (`AFFINE`) global-motion model through |
| 2172 | // `crate::warp::global_warp_params` -- the gate's proof that a stream really |
| 2173 | // carried an AFFINE `global_motion_params` AND that a block was predicted |
| 2174 | // with it, not merely that the header parsed one. |
| 2175 | thread_local! |
| 2176 | |
| 2177 | |
| 2178 | |
| 2179 | |
| 2180 | /// Current value of [`AFFINE_GM_HITS`]. |
| 2181 | // read only from the `#[cfg(test)]` gates |
| 2182 | pub |
| 2183 | |
| 2184 | |
| 2185 | |
| 2186 | // lane-av1distwtd: how many blocks took the DISTANCE-WEIGHTED compound |
| 2187 | // combine rather than the simple average -- `compound_idx == 0` under |
| 2188 | // `enable_jnt_comp`, whose weights come from |
| 2189 | // [`crate::compound::dist_wtd_comp_weight_assign`] instead of the constant |
| 2190 | // `(8, 8)` split. Counting the `idx == 0` arm (not merely the |
| 2191 | // `compound_idx` symbol read) is what makes this a witness of the TOOL: a |
| 2192 | // stream that carries `enable_jnt_comp = true` in its sequence header but |
| 2193 | // codes every compound block with `compound_idx == 1` leaves this at 0 and |
| 2194 | // decoded identically without the whole distance-weight path. |
| 2195 | thread_local! |
| 2196 | |
| 2197 | |
| 2198 | |
| 2199 | |
| 2200 | /// Current value of [`DIST_WTD_COMP_HITS`]. |
| 2201 | // read only from the `#[cfg(test)]` gates |
| 2202 | pub |
| 2203 | |
| 2204 | |
| 2205 | |
| 2206 | /// Resets [`DIST_WTD_COMP_HITS`] to 0. |
| 2207 | // test-only |
| 2208 | pub |
| 2209 | |
| 2210 | |
| 2211 | |
| 2212 | // lane-av1gwarp12: how many 16x16+ blocks built their SINGLE-reference |
| 2213 | // prediction through `crate::warp::global_warp_params` with a FOUR-parameter |
| 2214 | // (`ROTZOOM`) model. Vanilla aomenc pins its global-motion search to ROTZOOM |
| 2215 | // (`global_motion_facade.c:24`), so this is the only >TRANSLATION single-ref |
| 2216 | // global-warp arm a real aomenc stream can reach (AFFINE needs the widened |
| 2217 | // side build and its own counter, [`AFFINE_GM_HITS`]). |
| 2218 | thread_local! |
| 2219 | |
| 2220 | |
| 2221 | |
| 2222 | |
| 2223 | /// Current value of [`ROTZOOM_GM_WARP_HITS`]. |
| 2224 | // read only from the `#[cfg(test)]` gates |
| 2225 | pub |
| 2226 | |
| 2227 | |
| 2228 | |
| 2229 | // lane-t900 r9: rect blocks whose warp-sample top-right probe answers |
| 2230 | // differently at the block's WIDTH than at libaom's |
| 2231 | // `AOMMAX(xd->width, xd->height)` -- each one is a `num_proj_ref` that could |
| 2232 | // pick the wrong motion_mode alphabet. |
| 2233 | thread_local! |
| 2234 | |
| 2235 | |
| 2236 | |
| 2237 | /// Current value of [`TR_REACH_LONGER_SIDE_HITS`]. |
| 2238 | |
| 2239 | |
| 2240 | |
| 2241 | |
| 2242 | // lane-t900 r9: libaom `is_nontrans_global_motion` (mvref_common.h) returns 0 |
| 2243 | // for `AOMMIN(mi_size_wide[bsize], mi_size_high[bsize]) < 2`, i.e. any block |
| 2244 | // with a 4-px side is NEVER "non-translational global" and therefore ALWAYS |
| 2245 | // reads its interp-filter symbol. Counts the blocks where that guard flips |
| 2246 | // our answer -- a GLOBALMV/GLOBAL_GLOBALMV block with a non-TRANSLATION model |
| 2247 | // and a 4-px side, which we used to suppress the interp read on (a pre-mode |
| 2248 | // entropy desync one symbol wide). |
| 2249 | thread_local! |
| 2250 | |
| 2251 | |
| 2252 | |
| 2253 | /// Current value of [`GM_NONTRANS_SMALL_SIDE_HITS`]. |
| 2254 | |
| 2255 | |
| 2256 | |
| 2257 | |
| 2258 | // lane-gmaffine r1: 8x8-leaf-only counters -- how many `BLOCK_8X8` leaves |
| 2259 | // coded `GLOBALMV` (`GLOBALMV_HITS_8`) and how many built a real |
| 2260 | // `WARPED_CAUSAL` local-warp prediction there (`WARP_HITS_8`, incremented |
| 2261 | // only once `find_projection` returned a usable model, unlike |
| 2262 | // `WARP_SELECTED_HITS` which counts the symbol). Both are the 8x8 gates' |
| 2263 | // proof that the leaf path itself fired, not the 16x16+ one. |
| 2264 | thread_local! |
| 2265 | |
| 2266 | |
| 2267 | |
| 2268 | |
| 2269 | /// Current value of [`GLOBALMV_HITS_8`]. |
| 2270 | // read only from the `#[cfg(test)]` gates |
| 2271 | pub |
| 2272 | |
| 2273 | |
| 2274 | |
| 2275 | /// Current value of [`WARP_HITS_8`]. |
| 2276 | // read only from the `#[cfg(test)]` gates |
| 2277 | pub |
| 2278 | |
| 2279 | |
| 2280 | |
| 2281 | // How many blocks decoded `interintra == 1` with the non-wedge blended |
| 2282 | // prediction applied (lane-interintra r1) -- the gate's proof that a |
| 2283 | // stream actually exercised interintra. |
| 2284 | thread_local! |
| 2285 | |
| 2286 | |
| 2287 | |
| 2288 | |
| 2289 | /// Current value of [`INTERINTRA_HITS`]. |
| 2290 | // read only from the `#[cfg(test)]` gates |
| 2291 | pub |
| 2292 | |
| 2293 | |
| 2294 | |
| 2295 | // lane-midcut r1: of those, how many were RECTANGULAR (`write_w != write_h`) |
| 2296 | // -- the shape `interintra_blend` used to build a square `side x side` intra |
| 2297 | // predictor for, with `ii_size_scales`/`edges` taken at the square. Every |
| 2298 | // pre-existing interintra gate passed with that bug, so the rect arm needs |
| 2299 | // its own counter to stop being vacuous. |
| 2300 | thread_local! |
| 2301 | |
| 2302 | |
| 2303 | |
| 2304 | /// Current value of [`INTERINTRA_RECT_HITS`]. |
| 2305 | |
| 2306 | |
| 2307 | |
| 2308 | |
| 2309 | // How many blocks decoded `comp_group_idx == 1` (masked COMPOUND_REFERENCE, |
| 2310 | // wedge or diffwtd) and had `compound_type`/`wedge_idx`/`wedge_sign`/ |
| 2311 | // `mask_type` consumed entropy-exact -- lane-maskcomp r1's proof that a |
| 2312 | // gate fixture actually exercises this alphabet, even though the block |
| 2313 | // still refuses (the mask blend itself is unported). |
| 2314 | thread_local! |
| 2315 | |
| 2316 | |
| 2317 | |
| 2318 | |
| 2319 | /// Current value of [`MASKED_COMPOUND_HITS`]. |
| 2320 | // read only from the `#[cfg(test)]` gates |
| 2321 | pub |
| 2322 | |
| 2323 | |
| 2324 | |
| 2325 | // lane-intersub8 r4/r5: the NON-SQUARE half of `MASKED_COMPOUND_HITS` -- a |
| 2326 | // masked-compound block whose true footprint is rectangular, i.e. the case |
| 2327 | // whose `compound_type`/`wedge_idx` CDF row r4 fixed (it used to read the |
| 2328 | // square envelope's `BLOCK_SIZES_ALL` index). Square blocks cannot show that |
| 2329 | // defect, so a gate asserting `masked_compound_hits` alone stays vacuous for it. |
| 2330 | thread_local! |
| 2331 | |
| 2332 | |
| 2333 | |
| 2334 | |
| 2335 | /// Current value of [`RECT_MASKED_COMPOUND_HITS`]. |
| 2336 | // read only from the `#[cfg(test)]` gates |
| 2337 | pub |
| 2338 | |
| 2339 | |
| 2340 | |
| 2341 | // How many blocks decoded a real `COMPOUND_WEDGE` block (`comp_group_idx == |
| 2342 | // 1`, `compound_type == 0`) -- lane-wedge r3's proof a gate fixture |
| 2343 | // actually exercised the wedge blend, not just the DIFFWTD half of |
| 2344 | // `MASKED_COMPOUND_HITS`. |
| 2345 | thread_local! |
| 2346 | |
| 2347 | |
| 2348 | |
| 2349 | |
| 2350 | /// Current value of [`WEDGE_HITS`]. |
| 2351 | // read only from the `#[cfg(test)]` gates |
| 2352 | pub |
| 2353 | |
| 2354 | |
| 2355 | |
| 2356 | // How many blocks decoded a real wedge-INTERINTRA block |
| 2357 | // (`interintra == 1 && use_wedge_interintra == 1`) -- lane-wii r2's proof |
| 2358 | // a gate fixture exercised the wedge blend (fixed sign 0), not just the |
| 2359 | // smooth arm counted by `INTERINTRA_HITS`. |
| 2360 | thread_local! |
| 2361 | |
| 2362 | |
| 2363 | |
| 2364 | |
| 2365 | /// Current value of [`WII_HITS`]. |
| 2366 | // read only from the `#[cfg(test)]` gates |
| 2367 | pub |
| 2368 | |
| 2369 | |
| 2370 | |
| 2371 | // lane-sbrect10 r1: how many INTRA blocks read `uv_mode` off the 13-symbol |
| 2372 | // NO-CFL alphabet *because their size excludes CFL* (libaom `is_cfl_allowed`: |
| 2373 | // wide <= 32 && high <= 32). The witness that a gate stream really carries a |
| 2374 | // 64-axis intra block -- the shape whose 14-symbol read desynced every inter |
| 2375 | // frame carrying one. |
| 2376 | thread_local! |
| 2377 | |
| 2378 | |
| 2379 | |
| 2380 | /// Current value of [`NOCFL_UV_MODE_HITS`]. |
| 2381 | // read only from the `#[cfg(test)]` gates |
| 2382 | pub |
| 2383 | |
| 2384 | |
| 2385 | |
| 2386 | // lane-inter16ab r5: how many COMPOUND_WEDGE / wedge-INTERINTRA blocks used a |
| 2387 | // RECTANGULAR codebook row (hgtw/hltw), per shape -- the gate's proof that |
| 2388 | // the rect wedge masks lifted this round actually fired, not just the square |
| 2389 | // ones already counted by `WEDGE_HITS`/`WII_HITS`. |
| 2390 | thread_local! |
| 2391 | |
| 2392 | |
| 2393 | |
| 2394 | |
| 2395 | /// Current value of [`RECT_WEDGE_HITS`], indexed by [`RECT_WEDGE_SHAPES`]. |
| 2396 | pub |
| 2397 | |
| 2398 | |
| 2399 | |
| 2400 | /// Current value of [`RECT_WII_HITS`], indexed by [`RECT_WEDGE_SHAPES`]. |
| 2401 | pub |
| 2402 | |
| 2403 | |
| 2404 | |
| 2405 | // lane-inter4 r4: how many 16x8/8x16 INTER LEAVES actually ran the OBMC |
| 2406 | // blend -- the gate's proof that `--enable-obmc=1` reached this shape (the |
| 2407 | // r3 refusal's replacement: prefilt frames are bit-exact vs an instrumented |
| 2408 | // aomdec, neighbour list included). |
| 2409 | thread_local! |
| 2410 | |
| 2411 | |
| 2412 | |
| 2413 | /// Current value of [`OBMC_RECT_LEAF_HITS`]. |
| 2414 | pub |
| 2415 | |
| 2416 | |
| 2417 | |
| 2418 | // lane-obmcrec r1: how many OBMC neighbours were taken from the SECOND half of |
| 2419 | // a 4-wide/4-tall (1:4 strip) chroma pair -- the case whose interp filter used |
| 2420 | // to be read from the pair's FIRST mi, which is a different block and, when |
| 2421 | // that half is intra, carries the `[3, 3]` "no filter" sentinel (the three |
| 2422 | // 1080p 10-bit film cuts refused there). The gate's proof the shape fired. |
| 2423 | thread_local! |
| 2424 | |
| 2425 | |
| 2426 | |
| 2427 | /// Current value of [`OBMC_PAIR_FILTER_HITS`]. |
| 2428 | pub |
| 2429 | |
| 2430 | |
| 2431 | |
| 2432 | // lane-t900 r14: how many OBMC neighbour predictions run PAST the frame edge |
| 2433 | // -- libaom's `op_mi_size` is `AOMMIN(xd->width|height, mi_step)`, the block's |
| 2434 | // own side, so a block overhanging the bottom/right still predicts the full |
| 2435 | // neighbour strip (the destination write is what clips). We used to shrink the |
| 2436 | // prediction to the visible part, which at 4 chroma rows/cols also swaps the |
| 2437 | // vertical/horizontal kernel to the 4-tap one. The gate's proof the shape fired. |
| 2438 | thread_local! |
| 2439 | |
| 2440 | |
| 2441 | |
| 2442 | /// Current value of [`OBMC_EDGE_SPAN_HITS`]. |
| 2443 | // read only from the `#[cfg(test)]` gates |
| 2444 | pub |
| 2445 | |
| 2446 | |
| 2447 | |
| 2448 | /// Current value of [`OBMC_HITS_8`]. |
| 2449 | // read only from the `#[cfg(test)]` gates |
| 2450 | pub |
| 2451 | |
| 2452 | |
| 2453 | |
| 2454 | // lane-rectgate r1: how many 32x32 quadrants actually decoded a |
| 2455 | // `PARTITION_HORZ_B` split (the one extended/ab partition this decoder's |
| 2456 | // inter-frame tile loop decodes -- `PARTITION_HORZ`/`VERT`/`HORZ_A`/`VERT_A`/ |
| 2457 | // `VERT_B` all still fall into the generic "a partition type this encoder |
| 2458 | // never writes" refusal below) -- the gate's proof that a free-partition |
| 2459 | // aomenc stream actually exercised a non-`NONE`/`SPLIT` partition rather than |
| 2460 | // coincidentally never selecting one. |
| 2461 | thread_local! |
| 2462 | |
| 2463 | |
| 2464 | |
| 2465 | |
| 2466 | /// Current value of [`EXTENDED_PARTITION_HITS`]. |
| 2467 | // read only from the `#[cfg(test)]` gates |
| 2468 | pub |
| 2469 | |
| 2470 | |
| 2471 | |
| 2472 | // lane-partitions r1: how many 32x32 quadrants decoded a real |
| 2473 | // `PARTITION_HORZ`/`PARTITION_VERT` (two true rectangular strips, unlike |
| 2474 | // `PARTITION_HORZ_B`'s square-context stand-in) -- the free-partition |
| 2475 | // gate's proof this round's arms actually fired. |
| 2476 | thread_local! |
| 2477 | |
| 2478 | |
| 2479 | |
| 2480 | |
| 2481 | /// Current value of [`RECT_PARTITION_HITS`]. |
| 2482 | // read only from the `#[cfg(test)]` gates |
| 2483 | pub |
| 2484 | |
| 2485 | |
| 2486 | |
| 2487 | // lane-inter8 r1: how many superblocks an inter tile coded as a single |
| 2488 | // whole-SB `PARTITION_NONE` 64x64 inter block (the case aomenc picks for |
| 2489 | // static content, previously a named refusal). |
| 2490 | thread_local! |
| 2491 | |
| 2492 | |
| 2493 | |
| 2494 | |
| 2495 | |
| 2496 | |
| 2497 | |
| 2498 | |
| 2499 | /// Current value of [`INTER_SB128_HORZ_HITS`], for a gate's before/after delta. |
| 2500 | pub |
| 2501 | |
| 2502 | |
| 2503 | |
| 2504 | /// Current value of [`INTER_SB128_VERT_HITS`], for a gate's before/after delta. |
| 2505 | pub |
| 2506 | |
| 2507 | |
| 2508 | |
| 2509 | /// Current value of [`INTER_SB128_NONE_HITS`], for a gate's before/after delta. |
| 2510 | |
| 2511 | |
| 2512 | |
| 2513 | |
| 2514 | thread_local! |
| 2515 | |
| 2516 | |
| 2517 | |
| 2518 | |
| 2519 | |
| 2520 | |
| 2521 | /// Current value of [`INTRA_128_IN_INTER_HITS`], for a gate's before/after delta. |
| 2522 | |
| 2523 | |
| 2524 | |
| 2525 | |
| 2526 | thread_local! |
| 2527 | |
| 2528 | |
| 2529 | |
| 2530 | |
| 2531 | |
| 2532 | |
| 2533 | |
| 2534 | |
| 2535 | |
| 2536 | |
| 2537 | /// Current value of [`INTRA_128_IN_INTER_MU_CHROMA_HITS`], for a gate's |
| 2538 | /// before/after delta. |
| 2539 | |
| 2540 | |
| 2541 | |
| 2542 | |
| 2543 | thread_local! |
| 2544 | |
| 2545 | |
| 2546 | |
| 2547 | |
| 2548 | /// Current value of [`INTER_SB_NONE_HITS`]. |
| 2549 | // read only from the `#[cfg(test)]` gates |
| 2550 | pub |
| 2551 | |
| 2552 | |
| 2553 | |
| 2554 | // lane-inter8 r1: how many INTERIOR (not frame-edge-straddling) 16x16 inter |
| 2555 | // blocks coded a real `PARTITION_SPLIT` into four 8x8 leaves -- the straddle |
| 2556 | // path has always run that loop, so only this counter proves the newly-lifted |
| 2557 | // alphabet value fired. |
| 2558 | thread_local! |
| 2559 | |
| 2560 | |
| 2561 | |
| 2562 | |
| 2563 | /// Current value of [`INTER_SUB16_SPLIT_HITS`]. |
| 2564 | // read only from the `#[cfg(test)]` gates |
| 2565 | pub |
| 2566 | |
| 2567 | |
| 2568 | |
| 2569 | // lane-t900 r28: how many 16x16 inter splits reached their four 8x8 leaves |
| 2570 | // while at least one reference picture was SCALED (superres) -- the counter |
| 2571 | // behind the lifted "8x8 partition leaf under a scaled reference" refusal. |
| 2572 | thread_local! |
| 2573 | |
| 2574 | |
| 2575 | |
| 2576 | |
| 2577 | /// Current value of [`SCALED_LEAF8_HITS`]. |
| 2578 | |
| 2579 | |
| 2580 | |
| 2581 | |
| 2582 | // lane-t900 r28: how many sub-8x8 inter blocks (the 4x4 split and the 8x4/4x8 |
| 2583 | // rect pair) were predicted from a SCALED reference -- the counter behind the |
| 2584 | // lifted "sub-8x8 inter block under a scaled reference" refusal. |
| 2585 | thread_local! |
| 2586 | |
| 2587 | |
| 2588 | |
| 2589 | |
| 2590 | /// Current value of [`SCALED_SUB8_HITS`]. |
| 2591 | |
| 2592 | |
| 2593 | |
| 2594 | |
| 2595 | // lane-rectwire r2: how many `PARTITION_HORZ`/`VERT` strips actually decoded |
| 2596 | // real (non-skip) coefficients through [`read_coeffs_rect`] -- proves the |
| 2597 | // rect coefficient reader itself fired, not just the strip-level partition |
| 2598 | // symbol [`RECT_PARTITION_HITS`] already counts. |
| 2599 | thread_local! |
| 2600 | |
| 2601 | |
| 2602 | |
| 2603 | |
| 2604 | /// Current value of [`RECT_COEFF_HITS`]. |
| 2605 | // read only from the `#[cfg(test)]` gates |
| 2606 | pub |
| 2607 | |
| 2608 | |
| 2609 | |
| 2610 | // lane-rectx r1: how many below-16x16 HORZ/VERT leaves ([`decode_leaf_rect`]) |
| 2611 | // decoded real (non-skip) TX_16X8/TX_8X16 coefficients -- the counter the |
| 2612 | // charter's real-aomenc gate hard-asserts. |
| 2613 | thread_local! |
| 2614 | |
| 2615 | |
| 2616 | |
| 2617 | |
| 2618 | /// Current value of [`RECT_LEAF_COEFF_HITS`]. |
| 2619 | // read only from the `#[cfg(test)]` gates |
| 2620 | pub |
| 2621 | |
| 2622 | |
| 2623 | |
| 2624 | // lane-intrarect r1: how many intra-coded HORZ/VERT strips decoded on the |
| 2625 | // INTER block path ([`decode_intra_rect_in_inter`]), per shape class -- |
| 2626 | // [0] the superblock-level 64x32/32x64, [1] 32x16/16x32, [2] 16x8/8x16. |
| 2627 | // Every one of them was the named refusal "an intra-coded HORZ/VERT strip |
| 2628 | // needs rectangular intra prediction" before this round. |
| 2629 | thread_local! |
| 2630 | |
| 2631 | |
| 2632 | |
| 2633 | |
| 2634 | /// Current value of [`INTRA_RECT_IN_INTER_HITS`] for one shape class |
| 2635 | /// (0 = 64x32/32x64, 1 = 32x16/16x32, 2 = 16x8/8x16). |
| 2636 | // read only from the `#[cfg(test)]` gates |
| 2637 | pub |
| 2638 | |
| 2639 | |
| 2640 | |
| 2641 | // lane-rect64port r1 (ported by hand from lane-intra64split 5ffbaf3): coded |
| 2642 | // (non-skip) 64-level HORZ/VERT intra strips whose luma transform is the |
| 2643 | // un-split TX_64X32/TX_32X64 -- the corner-cropped 32x32 coefficient read of |
| 2644 | // [`decode_rect_split`], the shape both 10-bit 3840x1608 film cuts stop on. |
| 2645 | // Split by ORIENTATION (index 0 = 64x32 wide / HORZ, 1 = 32x64 tall / VERT): |
| 2646 | // a single counter cannot tell an axis swap from a working arm |
| 2647 | // (class [[scan-weights-cross-axis]]), so the gate asserts both cells. |
| 2648 | thread_local! |
| 2649 | |
| 2650 | |
| 2651 | |
| 2652 | |
| 2653 | /// Current value of [`RECT64_CORNER_TU_HITS`] for one orientation |
| 2654 | /// (0 = 64x32, 1 = 32x64). |
| 2655 | pub |
| 2656 | |
| 2657 | |
| 2658 | |
| 2659 | // lane-intrasplit r1: intra HORZ/VERT strips inside an INTER frame whose luma |
| 2660 | // transform is SPLIT, bucketed by the read `tx_depth` (index 1 and 2; index 0 |
| 2661 | // is never incremented) -- the gate's proof that the lifted path ran per depth. |
| 2662 | thread_local! |
| 2663 | |
| 2664 | |
| 2665 | |
| 2666 | |
| 2667 | // lane-t900 r21: rect intra strips inside an inter frame that read the |
| 2668 | // screen-content palette syntax (`allow_screen_content_tools` set and the |
| 2669 | // strip's own shape admitted by `palette_bsize_ctx_wh`) -- the site a blanket |
| 2670 | // refusal used to guard, so this counter is what keeps its witness gate |
| 2671 | // non-vacuous. |
| 2672 | thread_local! |
| 2673 | |
| 2674 | |
| 2675 | |
| 2676 | /// Current value of [`INTRA_RECT_IN_INTER_SCREEN_HITS`]. |
| 2677 | // read only from the `#[cfg(test)]` gates |
| 2678 | pub |
| 2679 | |
| 2680 | |
| 2681 | |
| 2682 | /// Resets [`INTRA_RECT_IN_INTER_SCREEN_HITS`] before a decode. |
| 2683 | // read only from the `#[cfg(test)]` gates |
| 2684 | pub |
| 2685 | |
| 2686 | |
| 2687 | |
| 2688 | /// Current value of [`INTRA_RECT_IN_INTER_SPLIT_TX_HITS`], indexed by tx depth. |
| 2689 | // read only from the `#[cfg(test)]` gates |
| 2690 | pub |
| 2691 | |
| 2692 | |
| 2693 | |
| 2694 | // lane-av1txbands: how many `tx_depth`/`txfm_split` reads the deblock-grid |
| 2695 | // approximation would have resolved off a DIFFERENT CDF row than the real |
| 2696 | // `TXFM_CONTEXT` bands do -- the exact blocks this band read fixes, on ANY |
| 2697 | // frame (lane-midcut r2 had it inter-frame-only). A plain "rect/intra block" |
| 2698 | // tally is green on the old code too (class gate-blind-to-feature). |
| 2699 | thread_local! |
| 2700 | |
| 2701 | |
| 2702 | |
| 2703 | |
| 2704 | /// Current value of [`TXCTX_DEBLOCK_DIVERGENCE_HITS`]. |
| 2705 | // gate counter accessor with no reader yet; the counter itself is live |
| 2706 | pub |
| 2707 | |
| 2708 | |
| 2709 | |
| 2710 | // lane-av1txctxband: how many `get_tx_size_context` reads the per-CELL |
| 2711 | // `is_inter_block` cover and the per-COLUMN `above_inter`/`left_inter` bands |
| 2712 | // DISAGREE about -- i.e. exactly the reads whose CDF row the old code chose |
| 2713 | // wrongly. Green on the old code too (a plain "some block was inter" tally |
| 2714 | // would be), so this is the non-vacuity arm of the witness gate: it is 0 on |
| 2715 | // every stream where the bands happened to be right and non-zero on the |
| 2716 | // 4:4:4 lossy `--sb-size=128` cq-62 stream whose entropy forked at read 32813 |
| 2717 | // on the 8x4 intra leaf at mi(57,52). |
| 2718 | thread_local! |
| 2719 | |
| 2720 | |
| 2721 | |
| 2722 | |
| 2723 | /// Current value of [`TXCTX_INTER_CELL_BAND_DIVERGENCE_HITS`]. |
| 2724 | // read only from the `#[cfg(test)]` gate |
| 2725 | pub |
| 2726 | |
| 2727 | |
| 2728 | |
| 2729 | /// Zeroes [`TXCTX_INTER_CELL_BAND_DIVERGENCE_HITS`]. |
| 2730 | // read only from the `#[cfg(test)]` gate |
| 2731 | pub |
| 2732 | |
| 2733 | |
| 2734 | |
| 2735 | // lane-intra14 r1: how many intra-coded 1:4 strips decoded on the INTER |
| 2736 | // block path, per shape -- [0] 64x16, [1] 16x64, [2] 32x8, [3] 8x32. Every |
| 2737 | // one of them was the named refusal "an intra-coded 1:4 (or other non-2:1) |
| 2738 | // rect strip on the inter block path" before this round. |
| 2739 | thread_local! |
| 2740 | |
| 2741 | |
| 2742 | |
| 2743 | |
| 2744 | /// Current value of [`INTRA_RECT4_IN_INTER_HITS`] for one shape |
| 2745 | /// (0 = 64x16, 1 = 16x64, 2 = 32x8, 3 = 8x32). |
| 2746 | pub |
| 2747 | |
| 2748 | |
| 2749 | |
| 2750 | // lane-av1444rect: how many 1:4 inter strips at `ss_x == 0` read their chroma |
| 2751 | // coefficient context over the STRIP'S OWN extent instead of the 4:2:0 pair's |
| 2752 | // (see [`decode_inter_block`]'s `around_c`). `is_chroma_reference` |
| 2753 | // (av1_common_int.h:1454) is unconditionally true at ss (0,0), so no pair |
| 2754 | // exists there; the counter keeps a 4:4:4 1:4-strip gate from passing |
| 2755 | // vacuously (a 4:2:0 stream of the same content leaves it at 0). It proves |
| 2756 | // REACH only, never that the fix bites -- that is the gate's byte compare and |
| 2757 | // its mutation, not this count (skill://ec-av1-pipeline-gate-counters). |
| 2758 | thread_local! |
| 2759 | |
| 2760 | |
| 2761 | |
| 2762 | /// Current value of [`RECT4_INTER_OWN_CHROMA444_HITS`]. |
| 2763 | // read only from the `#[cfg(test)]` gates |
| 2764 | pub |
| 2765 | |
| 2766 | |
| 2767 | |
| 2768 | /// Resets [`RECT4_INTER_OWN_CHROMA444_HITS`] before a decode. |
| 2769 | // read only from the `#[cfg(test)]` gates |
| 2770 | pub |
| 2771 | |
| 2772 | |
| 2773 | |
| 2774 | // lane-av1444rect r2: how many intra-BC 1:4 strips at `ss (0,0)` took the |
| 2775 | // own-chroma arm of [`decode_rect4_16_intrabc`]'s `own444`. A 4:2:0 / 4:2:2 |
| 2776 | // stream of the same recipe leaves it at 0, which is what makes it the |
| 2777 | // 4:4:4-only route. |
| 2778 | // |
| 2779 | // WHAT THIS COUNTER IS NOT: it is NOT evidence that the fix bites, and it |
| 2780 | // never was. A route counter fires identically before and after a change that |
| 2781 | // changes nothing downstream, so a non-zero count proves REACH and nothing |
| 2782 | // more. On this lane it is also armed deliberately OUTSIDE the `own444` |
| 2783 | // expression, so that the mutation (`own444 = false`) still increments it and |
| 2784 | // the red comes from the pixel/entropy arm instead. The evidence that the ss |
| 2785 | // gate bites is the measured fork move -- first entropy fork read 11750 -> |
| 2786 | // 12465, luma first wrong sample 164416 -> 205264, 455240 -> 390380 total -- |
| 2787 | // not this count. See skill://ec-av1-pipeline-gate-counters: a counter needs |
| 2788 | // a DIFFERS-style assertion to carry a claim. |
| 2789 | thread_local! |
| 2790 | |
| 2791 | |
| 2792 | |
| 2793 | // lane-av1422luma: the ss (1,0) twin of `INTRABC_RECT4_OWN_CHROMA444_HITS` |
| 2794 | // -- how many intra-BC 1:4 strips at 4:2:2 took the own-chroma (no pair) |
| 2795 | // route. Same caveat as the 4:4:4 counter: it proves REACH and nothing else. |
| 2796 | // lane-av1422lift: 4:2:2 is DECODED, so this counter is no longer pinned |
| 2797 | // behind a header refusal -- and it DOES fire: measured on this branch's tip, |
| 2798 | // the six committed corpus cells each read 1 more than the cell before |
| 2799 | // (`s422_320x246` 1, `s422_322x240` 2, `s422_322x246` 3, `s422_352x242_10b` |
| 2800 | // 4, `s422_416x242_10b` 5, `s422_416x250_10b` 6), and every other committed |
| 2801 | // 4:2:2 cell leaves it at 6. **No committed gate reads it**: the accessor |
| 2802 | // below has no callers in the crate (the 4:4:4 twin is read at two |
| 2803 | // `stream.rs` sites, this one nowhere). The honest sentence is therefore |
| 2804 | // "no committed test reads this counter", which is what the 4:4:4 twin's |
| 2805 | // doc says about itself -- it does NOT become "the corpus gate reads it". |
| 2806 | thread_local! |
| 2807 | |
| 2808 | |
| 2809 | |
| 2810 | /// Current value of [`INTRABC_RECT4_OWN_CHROMA422_HITS`]. |
| 2811 | // read only from the `#[cfg(test)]` gates |
| 2812 | pub |
| 2813 | |
| 2814 | |
| 2815 | |
| 2816 | /// Resets [`INTRABC_RECT4_OWN_CHROMA422_HITS`] before a decode. |
| 2817 | // read only from the `#[cfg(test)]` gates |
| 2818 | pub |
| 2819 | |
| 2820 | |
| 2821 | |
| 2822 | /// Current value of [`INTRABC_RECT4_OWN_CHROMA444_HITS`]. |
| 2823 | // read only from the `#[cfg(test)]` gates |
| 2824 | pub |
| 2825 | |
| 2826 | |
| 2827 | |
| 2828 | /// Resets [`INTRABC_RECT4_OWN_CHROMA444_HITS`] before a decode. |
| 2829 | // read only from the `#[cfg(test)]` gates |
| 2830 | pub |
| 2831 | |
| 2832 | |
| 2833 | |
| 2834 | // lane-rectx r5: how many times a NON-strip `kf_y_mode` reader |
| 2835 | // ([`decode_block`], [`decode_block_rect`], [`decode_block_rect64`]) took an |
| 2836 | // above/left mode from the mi-exact map that DIFFERS from its coarse 16x16 |
| 2837 | // slot -- i.e. how often the r5 defect would have picked the wrong CDF row. |
| 2838 | thread_local! |
| 2839 | |
| 2840 | |
| 2841 | |
| 2842 | |
| 2843 | /// Current value of [`MODE_MI_OVERRIDE_HITS`]. |
| 2844 | // read only from the `#[cfg(test)]` gates |
| 2845 | pub |
| 2846 | |
| 2847 | |
| 2848 | |
| 2849 | // lane-cfl r1: how many times a chroma intra-edge filter-type read |
| 2850 | // (`get_filt_type`, libaom reconintra.c) took an above/left UV mode from the |
| 2851 | // mi-exact map that DIFFERS from its coarse 16x16 slot -- i.e. how often the |
| 2852 | // r1 defect would have filtered a chroma edge with the wrong strength. |
| 2853 | thread_local! |
| 2854 | |
| 2855 | |
| 2856 | |
| 2857 | |
| 2858 | /// Current value of [`UV_MODE_MI_OVERRIDE_HITS`]. |
| 2859 | // read only from the `#[cfg(test)]` gates |
| 2860 | pub |
| 2861 | |
| 2862 | |
| 2863 | |
| 2864 | // lane-t900 r12: how many chroma edge-filter-type reads took their above/left |
| 2865 | // `uv_mode` from the mi GRID where the one-slot-per-column map would have |
| 2866 | // answered differently -- the sub-8x8 pair case where the pair's own first |
| 2867 | // half had already overwritten the column slot the chroma-ref half reads. |
| 2868 | thread_local! |
| 2869 | |
| 2870 | |
| 2871 | |
| 2872 | |
| 2873 | /// Current value of [`UV_MODE_GRID_OVERRIDE_HITS`]. |
| 2874 | |
| 2875 | |
| 2876 | |
| 2877 | |
| 2878 | // lane-t900 r8: how many intra edge-filter-type reads (luma + chroma) the |
| 2879 | // INTER neighbour stamp saved: the coarse SUB band still held a SMOOTH mode |
| 2880 | // from an earlier block in that pixel row/column while the mi-exact map -- |
| 2881 | // which an inter block only started writing this round -- correctly says the |
| 2882 | // neighbour is not smooth (libaom `is_smooth`: an inter neighbour's `mode` is |
| 2883 | // an INTER mode, and its `uv_mode` "is not set for inter blocks"). |
| 2884 | thread_local! |
| 2885 | |
| 2886 | |
| 2887 | |
| 2888 | |
| 2889 | /// Current value of [`INTER_NEIGHBOUR_NOT_SMOOTH_HITS`]. |
| 2890 | // read only from the `#[cfg(test)]` gates |
| 2891 | pub |
| 2892 | |
| 2893 | |
| 2894 | |
| 2895 | // lane-mtfix r1: how many times a chroma intra-edge filter-type read was |
| 2896 | // suppressed at a TILE edge that is not a frame edge -- the above/left |
| 2897 | // `uv_mode` neighbour of a block on a tile's first mi row/column lives in |
| 2898 | // another tile, so libaom's `above_mbmi`/`left_mbmi` are NULL there. The |
| 2899 | // coarse [`SUB`] maps are frame-sized and (`above_uv_mode`) not cleared per |
| 2900 | // tile, so without the guard in [`Neighbours::smooth_uv_neighbour`] the tile |
| 2901 | // above would decide this tile's chroma edge filter strength. |
| 2902 | thread_local! |
| 2903 | |
| 2904 | |
| 2905 | |
| 2906 | |
| 2907 | /// Current value of [`UV_TILE_EDGE_SUPPRESSED_HITS`]. |
| 2908 | // read only from the `#[cfg(test)]` gates |
| 2909 | pub |
| 2910 | |
| 2911 | |
| 2912 | |
| 2913 | // lane-av1leftref: how many chroma intra-edge filter-type reads land on a |
| 2914 | // left neighbour whose `uv_mode` at libaom's real read cell |
| 2915 | // (`base_mi[ss_y * mi_stride - 1]` = row `+ss_y`, col `-1`) DIFFERS from the |
| 2916 | // cell this decoder used to read (its own mi row). Two buckets: the raw mode |
| 2917 | // value moved, and `is_smooth_mode` -- the boolean the read actually feeds -- |
| 2918 | // flipped. The second is the one that can move pixels. |
| 2919 | thread_local! |
| 2920 | |
| 2921 | |
| 2922 | |
| 2923 | |
| 2924 | |
| 2925 | |
| 2926 | /// Current value of [`UV_LEFT_SS_Y_MODE_DIFF_HITS`]. |
| 2927 | |
| 2928 | |
| 2929 | |
| 2930 | |
| 2931 | /// Current value of [`UV_LEFT_SS_Y_SMOOTH_DIFF_HITS`]. |
| 2932 | |
| 2933 | |
| 2934 | |
| 2935 | |
| 2936 | // lane-av1leftwit: decode-path chroma edge-filter-type reads at `ss_y > 0` |
| 2937 | // whose left-neighbour COLUMN holds a run of length 1 -- the cell this |
| 2938 | // decoder reads (its own mi row) and the cell libaom reads (one row down) |
| 2939 | // were written by two DIFFERENT blocks, i.e. the left neighbour is at most |
| 2940 | // 1 mi tall. That is the only geometry in which the `+ss_y` term can change |
| 2941 | // the answer at all; `UV_LEFT_SS_Y_READS` alone proves nothing about it. |
| 2942 | thread_local! |
| 2943 | |
| 2944 | |
| 2945 | |
| 2946 | /// Current value of [`UV_LEFT_1MI_SPLIT_HITS`]. |
| 2947 | |
| 2948 | |
| 2949 | |
| 2950 | |
| 2951 | // lane-cfl r1 gate counters: `UV_CFL_PRED` blocks (every `cfl_alpha_signs` |
| 2952 | // read) and chroma blocks with a NONZERO `angle_delta_uv` -- the two block |
| 2953 | // shapes the r1 chroma defect showed up on. |
| 2954 | thread_local! |
| 2955 | |
| 2956 | |
| 2957 | |
| 2958 | |
| 2959 | // lane-av1cfl: which `cfl_ac_ss` arm ran, one bump per CfL block. The 4:4:4 |
| 2960 | // arm is libaom `cfl_luma_subsampling_444_lbd_c` (1x1 luma per chroma sample) |
| 2961 | // and the 4:2:2 arm is `cfl_luma_subsampling_422_lbd_c`; only the last two |
| 2962 | // reach `cfl_ac_q3_at`'s 2x2 average, so these four are the reachability |
| 2963 | // evidence for that function's format-blind extent. |
| 2964 | thread_local! |
| 2965 | |
| 2966 | |
| 2967 | |
| 2968 | |
| 2969 | |
| 2970 | |
| 2971 | |
| 2972 | /// `[4:4:4, 4:2:2, 4:2:0 square, 4:2:0 rect]` [`cfl_ac_ss`] arm hits. |
| 2973 | |
| 2974 | |
| 2975 | |
| 2976 | |
| 2977 | |
| 2978 | |
| 2979 | |
| 2980 | |
| 2981 | |
| 2982 | /// Entries into [`cfl_ac_q3_at`] itself -- the one arm whose extent is |
| 2983 | /// `bw / 2, bh / 2` and whose footprint is a 2x2 luma average. The gate |
| 2984 | /// proves it is reached ONLY at 4:2:0. |
| 2985 | |
| 2986 | |
| 2987 | |
| 2988 | |
| 2989 | /// Current value of [`CFL_BLOCK_HITS`]. |
| 2990 | // read only from the `#[cfg(test)]` gates |
| 2991 | pub |
| 2992 | |
| 2993 | |
| 2994 | |
| 2995 | /// Current value of [`UV_ANGLE_DELTA_HITS`]. |
| 2996 | // read only from the `#[cfg(test)]` gates |
| 2997 | pub |
| 2998 | |
| 2999 | |
| 3000 | |
| 3001 | // lane-sbpart r2: how many superblock-level `PARTITION_HORZ`/`PARTITION_VERT` |
| 3002 | // blocks (two true 64x32/32x64 strips, [`decode_block_rect64`]) fired -- the |
| 3003 | // gate's proof this round's arms actually reached a real block, not just |
| 3004 | // that `partition_w64` read one of those two symbol values. |
| 3005 | thread_local! |
| 3006 | |
| 3007 | |
| 3008 | |
| 3009 | |
| 3010 | // Current value of [`SB_RECT_HITS`]. |
| 3011 | // lane-hgkf r1: the frame-edge partition bit, one level each. Slot 0 = a |
| 3012 | // 64-level gathered edge bit read as HORZ/VERT, 1 = the same bit read as |
| 3013 | // SPLIT, 2/3 = the 32-level pair. A gate asserting slot 0 or 2 proves the |
| 3014 | // non-SPLIT edge arm actually decoded (before this round the bit was read and |
| 3015 | // thrown away, so that arm was unreachable). |
| 3016 | thread_local! |
| 3017 | |
| 3018 | |
| 3019 | |
| 3020 | /// Current value of [`EDGE_PART_HITS`]. |
| 3021 | // read only from the `#[cfg(test)]` gates |
| 3022 | pub |
| 3023 | |
| 3024 | |
| 3025 | |
| 3026 | /// Reset [`EDGE_PART_HITS`] (a gate counts one stream at a time). |
| 3027 | // read only from the `#[cfg(test)]` gates |
| 3028 | pub |
| 3029 | |
| 3030 | |
| 3031 | |
| 3032 | // read only from the `#[cfg(test)]` gates |
| 3033 | pub |
| 3034 | |
| 3035 | |
| 3036 | |
| 3037 | // lane-golomb r2: the 32x32-level FRAME-EDGE partition. Slot 0/1 = the |
| 3038 | // gathered edge bit read as 0 (HORZ/VERT) / 1 (SPLIT); slot 2 = a 32-level |
| 3039 | // PARTITION_HORZ decoded with `has_rows32 == false` (only the top 32x16 half |
| 3040 | // is coded), slot 3 = a PARTITION_VERT with `has_cols32 == false`. Both tile |
| 3041 | // paths (intra and inter) feed the same counter. |
| 3042 | // |
| 3043 | // lane-golomb r3: slots 4..7 are the same four facts one level up, at the |
| 3044 | // SUPERBLOCK (64x64) edge -- 4/5 = the gathered 64-level bit read as |
| 3045 | // HORZ/VERT / SPLIT, 6 = a 64x32 bottom-edge strip decoded with |
| 3046 | // `has_rows == false`, 7 = a 32x64 right-edge strip. Real aomenc answers a |
| 3047 | // bottom-edge superblock with the 64-level HORZ (measured: 192x80 flat-band, |
| 3048 | // every SB of the last row), so the 32-level slots stay 0 on that content and |
| 3049 | // only these prove the arm fired. |
| 3050 | thread_local! |
| 3051 | |
| 3052 | |
| 3053 | |
| 3054 | |
| 3055 | /// Current value of [`EDGE32_HITS`]. |
| 3056 | // read only from the `#[cfg(test)]` gates |
| 3057 | pub |
| 3058 | |
| 3059 | |
| 3060 | |
| 3061 | // lane-part32 r4: how many superblock-level AB blocks (`PARTITION_HORZ_A`/ |
| 3062 | // `_B`/`VERT_A`/`_B` at 64x64 -- two 32x32 squares plus one 64x32/32x64 |
| 3063 | // strip) fired. Real aomenc picks these at 64 even with |
| 3064 | // `--enable-ab-partitions=0` (lane-sbpart r2's own measurement), so this is |
| 3065 | // the counter the gate hard-asserts. |
| 3066 | thread_local! |
| 3067 | |
| 3068 | |
| 3069 | |
| 3070 | |
| 3071 | /// Current value of [`SB_AB_HITS`], summed over the four arms. |
| 3072 | // read only from the `#[cfg(test)]` gates |
| 3073 | pub |
| 3074 | |
| 3075 | |
| 3076 | |
| 3077 | /// [`SB_AB_HITS`] split per arm, in `PARTITION_HORZ_A`, `_HORZ_B`, |
| 3078 | /// `_VERT_A`, `_VERT_B` order -- what the gate hard-asserts arm by arm, so a |
| 3079 | /// run where aomenc's RD only ever picked (say) `HORZ_A` cannot pass off as |
| 3080 | /// proof of all four. |
| 3081 | // read only from the `#[cfg(test)]` gates |
| 3082 | pub |
| 3083 | |
| 3084 | |
| 3085 | |
| 3086 | // lane-tx64x16: the two 1:4 superblock arms, counted per orientation -- |
| 3087 | // `PARTITION_HORZ_4` (four 64x16 strips) and `PARTITION_VERT_4` (four 16x64 |
| 3088 | // strips). Two counters, not one, because a gate that only proved "some 1:4 |
| 3089 | // strip fired" would pass on a stream that never coded the other axis, and |
| 3090 | // every scan/context table this round added comes in a transposed pair. |
| 3091 | thread_local! |
| 3092 | |
| 3093 | |
| 3094 | |
| 3095 | |
| 3096 | /// Current value of `SB_RECT4_HORZ_HITS` (64x16 strips decoded). |
| 3097 | // read only from the `#[cfg(test)]` gates |
| 3098 | pub |
| 3099 | |
| 3100 | |
| 3101 | |
| 3102 | /// Current value of `SB_RECT4_VERT_HITS` (16x64 strips decoded). |
| 3103 | // read only from the `#[cfg(test)]` gates |
| 3104 | pub |
| 3105 | |
| 3106 | |
| 3107 | |
| 3108 | // lane-tx64x16 r3: the 32x32-level 1:4 arms, counted per orientation -- |
| 3109 | // `PARTITION_HORZ_4` (four 32x8 strips) and `PARTITION_VERT_4` (four 8x32 |
| 3110 | // strips), the arms the ReelB mid-film extract stops at. |
| 3111 | thread_local! |
| 3112 | |
| 3113 | |
| 3114 | |
| 3115 | |
| 3116 | |
| 3117 | |
| 3118 | |
| 3119 | |
| 3120 | |
| 3121 | |
| 3122 | |
| 3123 | |
| 3124 | |
| 3125 | |
| 3126 | |
| 3127 | // How many 32x32-level 1:4 strips actually read coefficients (non-skip): |
| 3128 | // a gate that only counted strips would pass on an all-skip stream, which |
| 3129 | // exercises none of the new scan/context tables. |
| 3130 | thread_local! |
| 3131 | |
| 3132 | |
| 3133 | |
| 3134 | // lane-rectsplitx r1: 1:4 strips (32x8/8x32/64x16/16x64) decoded through the |
| 3135 | // per-transform-unit split path, split by tx depth -- depth 1 is a 2:1 RECT |
| 3136 | // unit (TX_16X8/TX_32X16), depth 2 a square one, and the two INTERLEAVE in |
| 3137 | // every real stream, so a gate must prove both fired. `SUB16_SPLIT_HITS` |
| 3138 | // counts the same for a 16x8/8x16 strip below 16x16. |
| 3139 | thread_local! |
| 3140 | |
| 3141 | |
| 3142 | |
| 3143 | |
| 3144 | |
| 3145 | /// Current values of `RECT4_SPLIT_DEPTH1_HITS` / `RECT4_SPLIT_DEPTH2_HITS`. |
| 3146 | // read only from the `#[cfg(test)]` gates |
| 3147 | pub |
| 3148 | |
| 3149 | |
| 3150 | |
| 3151 | |
| 3152 | |
| 3153 | |
| 3154 | /// Current value of `SUB16_SPLIT_HITS`. |
| 3155 | // read only from the `#[cfg(test)]` gates |
| 3156 | pub |
| 3157 | |
| 3158 | |
| 3159 | |
| 3160 | // lane-frame36 r2: superblock-level strips ([`decode_block_rect64`]) whose |
| 3161 | // luma transform is SPLIT and which therefore leave through that fn's early |
| 3162 | // return -- the arm that published no `TXFM_CONTEXT` band until this round. |
| 3163 | thread_local! |
| 3164 | |
| 3165 | |
| 3166 | |
| 3167 | /// Current value of `RECT64_SPLIT_TXFM_PUBLISH_HITS`. |
| 3168 | // read only from the `#[cfg(test)]` gates |
| 3169 | pub |
| 3170 | |
| 3171 | |
| 3172 | |
| 3173 | /// Current value of `RECT4_COEFF_HITS`. |
| 3174 | pub |
| 3175 | |
| 3176 | |
| 3177 | |
| 3178 | // lane-sbab r1: how many superblock-level (64x64) AB partitions fired IN AN |
| 3179 | // INTER frame, per arm, in `PARTITION_HORZ_A`, `_HORZ_B`, `_VERT_A`, |
| 3180 | // `_VERT_B` order (the intra-frame counterpart is `SB_AB_HITS`). Each arm is |
| 3181 | // two 32x32 inter squares plus one true 64x32/32x64 inter strip; the gate |
| 3182 | // asserts the arms it proves separately so a run whose RD only picked one |
| 3183 | // cannot pass as proof of the others. |
| 3184 | thread_local! |
| 3185 | |
| 3186 | |
| 3187 | |
| 3188 | /// [`SB_AB_INTER_HITS`] per arm (HORZ_A, HORZ_B, VERT_A, VERT_B at 64x64 in an |
| 3189 | /// inter frame). |
| 3190 | |
| 3191 | |
| 3192 | |
| 3193 | |
| 3194 | // lane-inter16ab r1: how many 16x16-level AB partitions fired IN AN INTER |
| 3195 | // frame, per arm, in `PARTITION_HORZ_A`, `_HORZ_B`, `_VERT_A`, `_VERT_B` |
| 3196 | // order (the intra-frame counterpart is `AB16_HITS`). Each arm is two 8x8 |
| 3197 | // inter leaves (`decode_inter_block8`) plus one true 16x8/8x16 inter strip |
| 3198 | // (`decode_inter_block` with `write_w`/`write_h`); the gate asserts every |
| 3199 | // arm separately so a run whose RD only picked one cannot pass as proof of |
| 3200 | // four. |
| 3201 | thread_local! |
| 3202 | |
| 3203 | |
| 3204 | |
| 3205 | /// [`AB16_INTER_HITS`] per arm (HORZ_A, HORZ_B, VERT_A, VERT_B at 16x16 in an |
| 3206 | /// inter frame). |
| 3207 | |
| 3208 | |
| 3209 | |
| 3210 | |
| 3211 | // lane-inter16ab r2: the 16x16-level 1:4 pair as INTER blocks -- four 16x4 |
| 3212 | // (`PARTITION_HORZ_4`) or 4x16 (`PARTITION_VERT_4`) strips. `CHROMA_PAIRS` |
| 3213 | // counts the odd strips that close a 4:2:0 chroma pair |
| 3214 | // (`is_chroma_reference`, av1_common_int.h:1454: bh == 1 mi => odd mi_row), |
| 3215 | // `SUB8_PIECES` the pair chroma blocks whose TOP (LEFT) half was built from |
| 3216 | // the PREVIOUS strip's own mv/ref/filters -- libaom |
| 3217 | // `build_inter_predictors_sub8x8` (reconinter_template.inc:87-160), reached |
| 3218 | // through `is_sub8x8_inter` (same file, :54). |
| 3219 | thread_local! |
| 3220 | |
| 3221 | |
| 3222 | |
| 3223 | |
| 3224 | |
| 3225 | |
| 3226 | // lane-arfchroma: chroma transform-unit publications whose block started |
| 3227 | // MID-CELL -- the condition `record_mi_chroma`'s origin alignment exists for. |
| 3228 | // A 4x4 chroma unit is `1 << ss` luma mi per axis, so a block whose mi origin |
| 3229 | // is not step-aligned (a 16x4 / 4x16 1:4 strip at 4:2:0 has an ODD mi row or |
| 3230 | // column) publishes a context cell whose origin is the step-aligned mi BELOW |
| 3231 | // or RIGHT of its own. Counted per publication, `[row_misaligned, |
| 3232 | // col_misaligned, both]`, so a gate can prove the witness really walks the |
| 3233 | // realigned path instead of passing on a stream whose chroma units all happen |
| 3234 | // to start on a cell boundary. |
| 3235 | thread_local! |
| 3236 | |
| 3237 | |
| 3238 | |
| 3239 | |
| 3240 | /// ChROMA publications that started mid-cell: `[row, col, both]`. See |
| 3241 | /// [`CHROMA_MIDCELL_PUB_HITS`]. |
| 3242 | // read only from the `#[cfg(test)]` gates |
| 3243 | |
| 3244 | |
| 3245 | |
| 3246 | |
| 3247 | /// Zeroes [`CHROMA_MIDCELL_PUB_HITS`] so a gate can measure its own decode. |
| 3248 | // read only from the `#[cfg(test)]` gates |
| 3249 | |
| 3250 | |
| 3251 | |
| 3252 | |
| 3253 | // lane-intra16x4: INTRA-coded strips of an inter 16x16-level 1:4 partition -- |
| 3254 | // [0] 16x4, [1] 4x16, [2] the odd (chroma-reference) ones, which carry the |
| 3255 | // pair's single 8x4 (4x8) chroma unit for BOTH strips. |
| 3256 | thread_local! |
| 3257 | |
| 3258 | |
| 3259 | |
| 3260 | |
| 3261 | /// `(intra 16x4 strips, intra 4x16 strips, of which chroma-reference)` decoded |
| 3262 | /// inside an INTER 16x16-level 1:4 partition (lane-intra16x4). |
| 3263 | |
| 3264 | |
| 3265 | |
| 3266 | |
| 3267 | |
| 3268 | /// Current values of the inter 16x16-level 1:4 counters: `(16x4 strips, 4x16 |
| 3269 | /// strips, chroma pairs closed, chroma pairs built from two different |
| 3270 | /// strips' motion vectors)`. |
| 3271 | |
| 3272 | |
| 3273 | |
| 3274 | |
| 3275 | |
| 3276 | |
| 3277 | |
| 3278 | |
| 3279 | |
| 3280 | // lane-r14: the 16x16-level 1:4 pair -- four 16x4 (`PARTITION_HORZ_4`) or |
| 3281 | // 4x16 (`PARTITION_VERT_4`) strips, `CHROMA` counting the odd strips that |
| 3282 | // close a 4:2:0 chroma pair and `COEFF` the strips with a coded residual. |
| 3283 | thread_local! |
| 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 | /// How many skipped sub-8x8 chroma blocks carried a CfL alpha (the shape |
| 3341 | /// that reconstructed as flat DC before lane-kf1200 r2). |
| 3342 | |
| 3343 | |
| 3344 | |
| 3345 | |
| 3346 | /// How many chroma transform units the frame-edge clip skipped in |
| 3347 | /// [`decode_block`]'s multi-transform-unit walk (lane-av1-loss64). Zero on a |
| 3348 | /// stream whose lossless blocks never overhang the frame -- a gate asserting |
| 3349 | /// the clip fired must see this nonzero. |
| 3350 | |
| 3351 | |
| 3352 | |
| 3353 | |
| 3354 | /// How many skipped lossless intrabc rect strips had their luma entropy |
| 3355 | /// bands zeroed per unit (lane-av1-loss64). |
| 3356 | |
| 3357 | |
| 3358 | |
| 3359 | |
| 3360 | /// How many 4x4 chroma transform units a lossless HORZ/VERT strip walked at |
| 3361 | /// subsampling 0/0 (lane-av1-llband). Zero means a stream never decoded the |
| 3362 | /// 4:4:4 lossless unit walk this counter proves -- a gate asserting the fix |
| 3363 | /// must see this nonzero. |
| 3364 | |
| 3365 | |
| 3366 | |
| 3367 | |
| 3368 | /// How many 4x4 chroma units a lossless HORZ/VERT strip's plane-major walk |
| 3369 | /// skipped for falling outside the chroma plane (lane-av1offtile). Zero means |
| 3370 | /// no stream decoded a lossless strip overhanging the frame edge -- a gate |
| 3371 | /// asserting the clip must see this nonzero. |
| 3372 | |
| 3373 | |
| 3374 | |
| 3375 | |
| 3376 | /// Reset [`rect_split_lossless_chroma_offtile_hits`] to zero (lane-av1offtile). |
| 3377 | |
| 3378 | |
| 3379 | |
| 3380 | |
| 3381 | /// How many unskipped intrabc 8x4/4x8 leaves a lossless frame walked luma as |
| 3382 | /// per-4x4 inter units (lane-av1-ibc444rect). |
| 3383 | |
| 3384 | |
| 3385 | |
| 3386 | |
| 3387 | /// How many unskipped intrabc 8x4/4x8 leaves a lossless 4:4:4 frame walked |
| 3388 | /// chroma as per-4x4 [`TxbSet::Chroma4`] units (lane-av1-ibc444rect). |
| 3389 | |
| 3390 | |
| 3391 | |
| 3392 | |
| 3393 | /// How many 4:4:4 lossless sub-8x8 RECT leaf chroma units took the |
| 3394 | /// block-relative reach libaom's `has_bottom_left` gives, where the |
| 3395 | /// standalone-BLOCK_4X4 lookup that used to answer disagreed |
| 3396 | /// (lane-av1loss444kf). Zero on a stream with no such leaf. |
| 3397 | |
| 3398 | |
| 3399 | |
| 3400 | |
| 3401 | /// Gate-side reset for [`SUB8_CHROMA444_LOSSLESS_TU_REACH_HITS`]. |
| 3402 | |
| 3403 | |
| 3404 | |
| 3405 | |
| 3406 | /// Gate-side reset for the two lane-av1-ibc444rect counters above. |
| 3407 | |
| 3408 | |
| 3409 | |
| 3410 | |
| 3411 | |
| 3412 | /// Gate-side reset for the two lane-av1-loss64 counters above. |
| 3413 | |
| 3414 | |
| 3415 | |
| 3416 | |
| 3417 | |
| 3418 | /// How many 16x4/4x16 chroma pairs took a different `intra_edge_filter_type` |
| 3419 | /// from the pair's base mi than the strip's own mi would have given. |
| 3420 | |
| 3421 | |
| 3422 | |
| 3423 | |
| 3424 | /// How many lossless 16x4/4x16 chroma pairs walked two TX_4X4s per plane. |
| 3425 | |
| 3426 | |
| 3427 | |
| 3428 | |
| 3429 | /// How many 16x4/4x16 strips reconstructed as intra block copy. |
| 3430 | |
| 3431 | |
| 3432 | |
| 3433 | |
| 3434 | /// Zero the lane-av1-rect14 pair counters so a gate measures one stream. |
| 3435 | |
| 3436 | |
| 3437 | |
| 3438 | |
| 3439 | |
| 3440 | // lane-reelckf r1: the two chroma defects ReelC's key frames exposed -- |
| 3441 | // CHROMA_SKIP_CFL counts skipped intra blocks whose chroma is `UV_CFL_PRED` |
| 3442 | // (prediction still runs, libaom `predict_and_reconstruct_intra_block`), and |
| 3443 | // RECT4_16_CHROMA_DIR counts 1:4 chroma pairs predicted directionally (whose |
| 3444 | // intra-edge filter type must come from the chroma-reference position). |
| 3445 | thread_local! |
| 3446 | |
| 3447 | |
| 3448 | |
| 3449 | |
| 3450 | /// `(skipped UV_CFL_PRED blocks, directional 1:4 chroma pairs)` -- lane-reelckf. |
| 3451 | |
| 3452 | |
| 3453 | |
| 3454 | |
| 3455 | |
| 3456 | |
| 3457 | |
| 3458 | /// Current values of the 16x16-level 1:4 counters: `(16x4 strips, 4x16 |
| 3459 | /// strips, chroma-reference strips, strips with a coded residual, strips |
| 3460 | /// whose luma transform is split)`. |
| 3461 | |
| 3462 | |
| 3463 | |
| 3464 | |
| 3465 | |
| 3466 | |
| 3467 | |
| 3468 | |
| 3469 | |
| 3470 | |
| 3471 | /// Current value of `RECT4_32_HORZ_HITS` (32x8 strips decoded). |
| 3472 | pub |
| 3473 | |
| 3474 | |
| 3475 | |
| 3476 | /// Current value of `RECT4_32_VERT_HITS` (8x32 strips decoded). |
| 3477 | pub |
| 3478 | |
| 3479 | |
| 3480 | |
| 3481 | /// Current value of `RECT4_32_HORZ_INTER_HITS` (32x8 inter strips decoded). |
| 3482 | pub |
| 3483 | |
| 3484 | |
| 3485 | |
| 3486 | /// Current value of `RECT4_32_VERT_INTER_HITS` (8x32 inter strips decoded). |
| 3487 | pub |
| 3488 | |
| 3489 | |
| 3490 | |
| 3491 | /// Current value of `INTER_SB_HORZ_HITS` (64x32 inter strips decoded). |
| 3492 | pub |
| 3493 | |
| 3494 | |
| 3495 | |
| 3496 | /// Current value of `INTER_SB_VERT_HITS` (32x64 inter strips decoded). |
| 3497 | pub |
| 3498 | |
| 3499 | |
| 3500 | |
| 3501 | /// Current value of `INTER_SB_HORZ4_HITS` (64x16 inter strips decoded). |
| 3502 | pub |
| 3503 | |
| 3504 | |
| 3505 | |
| 3506 | /// Current value of `INTER_SB_VERT4_HITS` (16x64 inter strips decoded). |
| 3507 | pub |
| 3508 | |
| 3509 | |
| 3510 | |
| 3511 | // lane-rect64q r1: how many of [`decode_block_rect64`]'s three per-plane |
| 3512 | // dequant calls actually observed `CURRENT_Q_IDX != base_q_idx` -- proof the |
| 3513 | // running-vs-stale-snapshot bug this round fixed is exercised by a gate, not |
| 3514 | // just inert-compiled. Zero forever on a passing gate means that gate's |
| 3515 | // stream never carries `delta_q_present=1` through a rect64 block. |
| 3516 | thread_local! |
| 3517 | |
| 3518 | |
| 3519 | |
| 3520 | |
| 3521 | /// Current value of [`RECT64_QIDX_DRIFT_HITS`]. |
| 3522 | // read only from the `#[cfg(test)]` gates |
| 3523 | pub |
| 3524 | |
| 3525 | |
| 3526 | |
| 3527 | // lane-partab r1: how many 32x32 quadrants decoded an AB partition |
| 3528 | // (PARTITION_HORZ_A / VERT_A / VERT_B -- two 16x16 squares plus one |
| 3529 | // 16x32/32x16 strip). Like [`RECT_PARTITION_HITS`], this is the |
| 3530 | // free-partition gate's proof this round's arms actually fired. |
| 3531 | thread_local! |
| 3532 | |
| 3533 | |
| 3534 | |
| 3535 | |
| 3536 | /// Current value of [`PARTAB_HITS`]. |
| 3537 | // read only from the `#[cfg(test)]` gates |
| 3538 | pub |
| 3539 | |
| 3540 | |
| 3541 | |
| 3542 | // lane-part32 r1: how many 32x32 quadrants decoded each INTRA AB/4-way arm, |
| 3543 | // one counter per arm rather than one shared total -- the gate hard-asserts |
| 3544 | // each of these individually nonzero so a recipe that only ever fires |
| 3545 | // HORZ_A can't silently stand in for the whole set. |
| 3546 | thread_local! |
| 3547 | |
| 3548 | |
| 3549 | |
| 3550 | |
| 3551 | |
| 3552 | |
| 3553 | |
| 3554 | |
| 3555 | |
| 3556 | |
| 3557 | /// Current value of [`INTRA_HORZ_A_HITS`]. |
| 3558 | // read only from the `#[cfg(test)]` gates |
| 3559 | pub |
| 3560 | |
| 3561 | |
| 3562 | |
| 3563 | /// Current value of [`INTRA_HORZ_B_HITS`]. |
| 3564 | // read only from the `#[cfg(test)]` gates |
| 3565 | pub |
| 3566 | |
| 3567 | |
| 3568 | |
| 3569 | /// Current value of [`INTRA_VERT_A_HITS`]. |
| 3570 | // read only from the `#[cfg(test)]` gates |
| 3571 | pub |
| 3572 | |
| 3573 | |
| 3574 | |
| 3575 | /// Current value of [`INTRA_VERT_B_HITS`]. |
| 3576 | // read only from the `#[cfg(test)]` gates |
| 3577 | pub |
| 3578 | |
| 3579 | |
| 3580 | |
| 3581 | // How many [`read_inter_compound_mode`] reads actually happened |
| 3582 | // (lane-av1comp) -- proves a `COMPOUND_REFERENCE` block reached its own |
| 3583 | // `compound_mode` symbol (past `comp_mode`/`comp_ref` and the compound |
| 3584 | // mvstack build), not just that `comp_mode` fired. Still refused right |
| 3585 | // after (no MV assignment or MC wired), so this only counts attempted |
| 3586 | // reads. |
| 3587 | thread_local! |
| 3588 | |
| 3589 | |
| 3590 | |
| 3591 | |
| 3592 | /// Current value of [`COMPOUND_MODE_HITS`]. |
| 3593 | // reader is test-only (the 12-bit compound witness); dead in non-test builds |
| 3594 | pub |
| 3595 | |
| 3596 | |
| 3597 | |
| 3598 | /// How many query blocks folded in at least one temporal MV candidate |
| 3599 | /// (spec 7.10.2.8's `add_tpl_ref_mv`) so far in this process -- the |
| 3600 | /// temporal-MV gate's own firing counter (lane-av1tmvp). |
| 3601 | /// |
| 3602 | /// # HANDOFF (lane-av1tmvp): not yet wired to a live stream |
| 3603 | /// [`crate::mvstack::find_mv_stack_with_sign_bias`]'s only call site in |
| 3604 | /// this file (`decode_inter_block`) still passes `tpl: None` -- this |
| 3605 | /// counter compiles and the projection math it counts is unit-tested |
| 3606 | /// ([`crate::motion_field`]), but nothing in [`crate::stream::decode_stream`] |
| 3607 | /// builds a per-DPB-slot [`crate::motion_field::MotionField`] or calls |
| 3608 | /// [`crate::motion_field::setup_motion_field`] yet, so this will read `0` |
| 3609 | /// against any real stream today. See the module doc on |
| 3610 | /// `crate::motion_field` and this crate's ledger for the remaining wiring. |
| 3611 | // read only from the `#[cfg(test)]` gates |
| 3612 | pub |
| 3613 | |
| 3614 | |
| 3615 | |
| 3616 | /// Current value of [`crate::mc::inter_pred_hits`] -- inter predictions |
| 3617 | /// produced on this thread, the 10-bit inter gate's firing proof. |
| 3618 | // read only from the `#[cfg(test)]` gates |
| 3619 | pub |
| 3620 | |
| 3621 | |
| 3622 | |
| 3623 | /// Current value of the counter for `ref_frame` (`LAST2_FRAME`..=`ALTREF_FRAME`; |
| 3624 | /// panics on `LAST_FRAME`/`INTRA_FRAME`/`NONE`, which have no counter here). |
| 3625 | // read only from the `#[cfg(test)]` gates |
| 3626 | pub |
| 3627 | |
| 3628 | |
| 3629 | |
| 3630 | |
| 3631 | |
| 3632 | |
| 3633 | |
| 3634 | |
| 3635 | |
| 3636 | |
| 3637 | |
| 3638 | |
| 3639 | /// Current value of [`ANGLE_DELTA_HITS`]. |
| 3640 | // read only from the `#[cfg(test)]` gates |
| 3641 | pub |
| 3642 | |
| 3643 | |
| 3644 | |
| 3645 | /// Current value of [`TX_CLASS1_HITS`]. |
| 3646 | // read only from the `#[cfg(test)]` gates |
| 3647 | pub |
| 3648 | |
| 3649 | |
| 3650 | |
| 3651 | // How many `PARTITION_SPLIT` decisions below an 8x8 block (four independent |
| 3652 | // `BLOCK_4X4` leaves, spec `decode_partition`'s `bSize < BLOCK_8X8` recursion |
| 3653 | // bottom) this thread's decode actually reconstructed -- the same |
| 3654 | // before/after counter pattern as [`TX_CLASS1_HITS`], proving a stream |
| 3655 | // genuinely exercised the sub-8x8 leaf path rather than every attempt |
| 3656 | // coincidentally landing on `PARTITION_NONE`. |
| 3657 | thread_local! |
| 3658 | |
| 3659 | |
| 3660 | |
| 3661 | |
| 3662 | |
| 3663 | |
| 3664 | |
| 3665 | |
| 3666 | |
| 3667 | |
| 3668 | |
| 3669 | |
| 3670 | |
| 3671 | |
| 3672 | |
| 3673 | |
| 3674 | |
| 3675 | |
| 3676 | |
| 3677 | /// Current value of [`SUB8_INTRA_RECT_HITS`]: `(8x4, 4x8, chroma-reference, |
| 3678 | /// mixed groups, split 4x4 leaves)`. |
| 3679 | |
| 3680 | |
| 3681 | |
| 3682 | |
| 3683 | |
| 3684 | |
| 3685 | |
| 3686 | /// Current value of [`SUB8_INTER_RECT_HITS`]: `(8x4 groups, 4x8 groups)`. |
| 3687 | |
| 3688 | |
| 3689 | |
| 3690 | |
| 3691 | |
| 3692 | |
| 3693 | |
| 3694 | // lane-cdef r1: (a) how many 8x8 CDEF units `apply_cdef` EXCLUDED because all |
| 3695 | // four of their mi cells are `skip_txfm` (libaom `cdef.c:29-38` |
| 3696 | // `is_8x8_block_skip` / `av1_cdef_compute_sb_list`'s dlist test), and (b) how |
| 3697 | // many 8x8 inter leaves (`decode_inter_block8`) wrote that skip band at all. |
| 3698 | // (b) was 0 for every stream before this round -- the leaf path never touched |
| 3699 | // the band, so an all-skip 8x8 group kept the PREVIOUS frame's flags and got |
| 3700 | // filtered where libaom skips it. A gate asserts both are non-zero. |
| 3701 | thread_local! |
| 3702 | |
| 3703 | |
| 3704 | |
| 3705 | |
| 3706 | |
| 3707 | |
| 3708 | |
| 3709 | |
| 3710 | |
| 3711 | /// Current value of `RECT_SKIP_BAND_HITS`. |
| 3712 | |
| 3713 | |
| 3714 | |
| 3715 | |
| 3716 | /// Current value of `INTER8_SKIP_BAND_HITS`. |
| 3717 | // read only from the `#[cfg(test)]` gates |
| 3718 | pub |
| 3719 | |
| 3720 | |
| 3721 | |
| 3722 | /// Current value of [`SUB8_SPLIT_HITS`]. |
| 3723 | // read only from the `#[cfg(test)]` gates |
| 3724 | pub |
| 3725 | |
| 3726 | |
| 3727 | |
| 3728 | /// Current value of [`SUB8_INTER_SPLIT_HITS`]. |
| 3729 | |
| 3730 | |
| 3731 | |
| 3732 | |
| 3733 | // lane-t900 r7: sub-8x8 inter groups whose one chroma unit inherits a |
| 3734 | // `tx_type` DIFFERENT from the group's FIRST sub-block -- the only shape that |
| 3735 | // tells the two rules apart (`av1_get_tx_type` indexes `xd->tx_type_map`, |
| 3736 | // which `set_mi_offsets` re-points to the CHROMA-REFERENCE sub-block, so the |
| 3737 | // first sub-block's type is never the one). Reading it off sub-block 0 |
| 3738 | // inverted one 4x4 chroma unit on the wrong basis with the entropy stream |
| 3739 | // perfectly in sync (no chroma `tx_type` symbol is coded), so a gate can only |
| 3740 | // see this rule through this counter. |
| 3741 | thread_local! |
| 3742 | |
| 3743 | |
| 3744 | |
| 3745 | /// Current value of `SUB8_CHROMA_TX_FROM_REF_HITS`. |
| 3746 | |
| 3747 | |
| 3748 | |
| 3749 | |
| 3750 | // How many 4x8 / 8x4 leaves (lane-tx4x8's `PARTITION_VERT`/`PARTITION_HORZ` |
| 3751 | // of an 8x8 block) this thread's decode reconstructed with REAL coefficients |
| 3752 | // -- a skipped leaf exercises the prediction and the mi bookkeeping but never |
| 3753 | // the rect transform, the 32-position `eob_pt` or the rect scan, so the gate |
| 3754 | // asserts on these two rather than a plain leaf count. |
| 3755 | thread_local! |
| 3756 | |
| 3757 | |
| 3758 | |
| 3759 | |
| 3760 | |
| 3761 | |
| 3762 | |
| 3763 | |
| 3764 | |
| 3765 | |
| 3766 | |
| 3767 | |
| 3768 | |
| 3769 | |
| 3770 | |
| 3771 | |
| 3772 | |
| 3773 | /// Current value of [`RECT8_SPLIT_TX_HITS`]. |
| 3774 | // read only from the `#[cfg(test)]` gates |
| 3775 | pub |
| 3776 | |
| 3777 | |
| 3778 | |
| 3779 | /// Current value of [`RECT_STRIP_PRED_HITS`]. |
| 3780 | // read only from the `#[cfg(test)]` gates |
| 3781 | pub |
| 3782 | |
| 3783 | |
| 3784 | |
| 3785 | /// Current value of [`RECT_STRIP_REACH_HITS`]. |
| 3786 | // read only from the `#[cfg(test)]` gates |
| 3787 | pub |
| 3788 | |
| 3789 | |
| 3790 | |
| 3791 | /// Current value of [`TX4X8_CODED_HITS`]. |
| 3792 | // read only from the `#[cfg(test)]` gates |
| 3793 | pub |
| 3794 | |
| 3795 | |
| 3796 | |
| 3797 | /// Current value of [`TX8X4_CODED_HITS`]. |
| 3798 | // read only from the `#[cfg(test)]` gates |
| 3799 | pub |
| 3800 | |
| 3801 | |
| 3802 | |
| 3803 | // How many CHROMA coefficient blocks read their `eob_pt` from the class-1 |
| 3804 | // (`TX_CLASS_HORIZ`/`VERT`) row, across every call on the current thread. |
| 3805 | // Chroma never codes a `tx_type` symbol -- it inherits the colocated luma |
| 3806 | // type verbatim (`av1_get_tx_type`, `blockd.h:1291`) -- so this fires only on |
| 3807 | // an inter leaf whose luma picked a 1D type, the path lane-eobc1 wired |
| 3808 | // (`eob_pt_{16,64,128,256}_chroma_class1`). |
| 3809 | thread_local! |
| 3810 | |
| 3811 | |
| 3812 | |
| 3813 | |
| 3814 | /// Current value of [`CHROMA_EOB_CLASS1_HITS`]. |
| 3815 | // read only from the `#[cfg(test)]` gates |
| 3816 | pub |
| 3817 | |
| 3818 | |
| 3819 | |
| 3820 | /// Enabled by `EC_AV1_PLANE_SENTINEL` (there is no separate flag for it): print |
| 3821 | /// an EXACT census of the samples the tile walk never wrote -- with it, every |
| 3822 | /// plane still holding [`plane_poison`] at this point is a sample no block |
| 3823 | /// reconstructed, and no legal sample can equal the poison (reconstruction |
| 3824 | /// clamps to `(1 << bit_depth) - 1`, at most 4095). |
| 3825 | /// |
| 3826 | /// Coverage, stated as the code has it: this census runs at TWO of the four |
| 3827 | /// places [`apply_deblock`] is entered from -- the key-frame path and the |
| 3828 | /// non-pipelined inter path, both immediately before that frame's deblock. The |
| 3829 | /// two it does NOT cover are the encoder's filter search ([`replay_filters`], |
| 3830 | /// which runs the filters over a CAPTURED copy, not a live decode) and the |
| 3831 | /// pipelined inter branch, where deblock has already run band by band inside |
| 3832 | /// `par` by the time this tail is reached. A zero count therefore means "no hole |
| 3833 | /// on the paths that reach this call", not "no hole on any path". It is EXACT |
| 3834 | /// over the extent it scans -- the scan itself reads every sample of that |
| 3835 | /// extent, unlike the older [`dump_stage`] pair, which truncates to `as u8`. |
| 3836 | /// |
| 3837 | /// This is the shipped form of the four-line temporary scan the |
| 3838 | /// `lane/av1422seed` census used: it replaces a wrong-sample diff (which says |
| 3839 | /// where the OUTPUT is wrong, not whether the block was written at all) with a |
| 3840 | /// direct count plus the coordinates of every hole, grouped into per-row |
| 3841 | /// spans so a large hole stays readable. |
| 3842 | /// |
| 3843 | /// It scans TWO regions per plane, because they answer different questions and |
| 3844 | /// the earlier revision only scanned one of them: |
| 3845 | /// * the TRUE EXTENT -- each plane over its own `true_width` x `true_height`, |
| 3846 | /// PER AXIS (`true_width.min(p.width)`), so a 4:2:2 frame's chroma is scanned |
| 3847 | /// at its own `fw/2 x fh` shape rather than the 4:2:0 `div_ceil(2)` crop the |
| 3848 | /// older [`dump_stage16`] used. A hole here can reach the caller, and it is |
| 3849 | /// the region lane/av1unwritten's 224 samples sat in. |
| 3850 | /// * the PADDED TAIL -- everything outside that extent, out to the block-aligned |
| 3851 | /// coding surface -- counted separately into [`PAD_UNWRITTEN_SAMPLES`]. The |
| 3852 | /// earlier revision's doc comment asserted "past that is the padded coding |
| 3853 | /// surface's invented tail, which no decoder ever reads". That assertion is |
| 3854 | /// exactly what a tail that is never written and never read looks like, so it |
| 3855 | /// was self-certifying; the tail is now scanned and counted like any other |
| 3856 | /// region. `EC_AV1_PLANE_ALLOC=padzero`/`extzero` attribute a read to one |
| 3857 | /// side or the other (see [`fresh_plane`]). |
| 3858 | pub |
| 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 | /// Samples [`census_unwritten`] has looked at since the last |
| 3927 | /// [`take_census_scanned`]. A gate that only asserts |
| 3928 | /// [`take_unwritten_samples`] == 0 passes on a decode that never scanned |
| 3929 | /// anything, so it reads THIS too: a census that scanned nothing has proved |
| 3930 | /// nothing. |
| 3931 | pub static CENSUS_SCANNED: AtomicUsize = new; |
| 3932 | |
| 3933 | /// Reads and clears [`CENSUS_SCANNED`]; see [`take_unwritten_samples`] for the |
| 3934 | /// pairing. |
| 3935 | |
| 3936 | |
| 3937 | |
| 3938 | |
| 3939 | /// Samples [`census_unwritten`] scanned in the padded tail, paired with |
| 3940 | /// [`PAD_UNWRITTEN_SAMPLES`] for the same reason as [`CENSUS_SCANNED`]. |
| 3941 | pub static PAD_CENSUS_SCANNED: AtomicUsize = new; |
| 3942 | |
| 3943 | /// Reads and clears [`PAD_CENSUS_SCANNED`]. |
| 3944 | |
| 3945 | |
| 3946 | |
| 3947 | |
| 3948 | /// Samples [`census_unwritten_final`] has looked at since the last |
| 3949 | /// [`take_final_census_scanned`]. A gate that only asserts |
| 3950 | /// [`take_final_unwritten_samples`] == 0 passes on a build whose census call was |
| 3951 | /// deleted, so it reads THIS too -- the same pairing |
| 3952 | /// [`CENSUS_SCANNED`] documents for the pre-deblock census. |
| 3953 | pub static FINAL_CENSUS_SCANNED: AtomicUsize = |
| 3954 | new; |
| 3955 | |
| 3956 | /// Reads and clears [`FINAL_CENSUS_SCANNED`]; the pairing is the reason it |
| 3957 | /// exists, exactly as for [`take_census_scanned`]. |
| 3958 | |
| 3959 | |
| 3960 | |
| 3961 | |
| 3962 | /// lane-unwritten-dep: the census at the pipeline's last point. Counts, over each |
| 3963 | /// plane, how many samples still hold [`PLANE_SENTINEL`] once every filter has |
| 3964 | /// run, and records how many samples it LOOKED at in [`FINAL_CENSUS_SCANNED`]. |
| 3965 | /// |
| 3966 | /// SCOPE, which lane-av1graincensus did not change but had to be true about: |
| 3967 | /// this runs BEFORE `apply_grain`, over the PRE-grain planes. It does NOT and |
| 3968 | /// never did measure the grained picture the caller receives -- that is |
| 3969 | /// [`census_unwritten_grained`], a separate counter over a separate buffer. |
| 3970 | /// |
| 3971 | /// Gated on [`plane_sentinel_on`] -- the SAME predicate as [`fresh_plane`] and as |
| 3972 | /// the pre-deblock [`census_unwritten`]: the env flag OR the thread-local |
| 3973 | /// [`set_plane_sentinel`] override. An earlier revision gated this on the raw env |
| 3974 | /// var alone, which made the census silently inert for any in-process test using |
| 3975 | /// the thread-local switch that the rest of the crate honours. The fill and both |
| 3976 | /// censuses must agree on when they are live, or a "0" means nothing. |
| 3977 | pub |
| 3978 | |
| 3979 | |
| 3980 | |
| 3981 | |
| 3982 | |
| 3983 | |
| 3984 | |
| 3985 | /// The `(scanned, unwritten)` pair both output-point censuses accumulate, or |
| 3986 | /// `None` when the sentinel fill is not live. |
| 3987 | /// |
| 3988 | /// Shared so the two censuses cannot drift into disagreeing about what counts |
| 3989 | /// as unwritten -- the failure this crate's other paired counters exist to |
| 3990 | /// prevent. `None` (rather than `(0, 0)`) is what keeps a caller from |
| 3991 | /// publishing a meaningless zero when the fill was off. |
| 3992 | |
| 3993 | |
| 3994 | |
| 3995 | |
| 3996 | |
| 3997 | |
| 3998 | |
| 3999 | |
| 4000 | |
| 4001 | |
| 4002 | |
| 4003 | |
| 4004 | |
| 4005 | |
| 4006 | /// The scanned half of the pairing for [`GRAINED_UNWRITTEN_SAMPLES`]. A gate |
| 4007 | /// asserting only `== 0` passes on a build whose census call was deleted. |
| 4008 | pub static GRAINED_CENSUS_SCANNED: AtomicUsize = |
| 4009 | new; |
| 4010 | |
| 4011 | /// Reads and clears [`GRAINED_CENSUS_SCANNED`]; the pairing is the reason it |
| 4012 | /// exists, exactly as for [`take_final_census_scanned`]. |
| 4013 | |
| 4014 | |
| 4015 | |
| 4016 | |
| 4017 | /// lane-av1graincensus: the SECOND output-point census -- the one |
| 4018 | /// [`census_unwritten_final`] structurally cannot be. |
| 4019 | /// |
| 4020 | /// # WHY IT EXISTS |
| 4021 | /// |
| 4022 | /// `census_unwritten_final` runs at `stream.rs`'s `EC_AV1_FINAL_DUMP` site, which |
| 4023 | /// is BEFORE `apply_grain`. Every filter (deblock/CDEF/LR/superres) writes in |
| 4024 | /// place into the same buffer that census scanned, so those stages cannot open a |
| 4025 | /// hole outside its extent. `apply_grain` is the ONE stage after it that |
| 4026 | /// allocates a fresh picture -- `uninit_plane`, `Vec::with_capacity` + |
| 4027 | /// `set_len`, no fill -- and whose soundness rests on a band row partition |
| 4028 | /// rather than on the type system. Its destination therefore reaches the caller |
| 4029 | /// having never been looked at by any census, and `lanes/unwritten-dep.report.md` |
| 4030 | /// §6/§8 explicitly declines to claim otherwise. |
| 4031 | /// |
| 4032 | /// # WHAT IT IS WORTH ONLY IF THE FILL IS LIVE |
| 4033 | /// |
| 4034 | /// Counting `== plane_poison()` over an uninitialised buffer is a census that |
| 4035 | /// can only ever report ~0: garbage is arbitrary, so a hole survives with |
| 4036 | /// probability ~1/65536 rather than always. `uninit_plane` therefore fills with |
| 4037 | /// the poison when [`plane_sentinel_on`] -- under the SAME predicate |
| 4038 | /// [`fresh_plane`] honours -- so "the band copy wrote every sample" becomes a |
| 4039 | /// measurement instead of an assumption. With the sentinel off (every shipped |
| 4040 | /// build) nothing here runs and `uninit_plane` keeps its corner-cut. |
| 4041 | pub |
| 4042 | |
| 4043 | |
| 4044 | |
| 4045 | |
| 4046 | |
| 4047 | |
| 4048 | |
| 4049 | thread_local! |
| 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 | /// [`SKIP_VARTX_LUMA_RESET_HITS`], for a gate's own before/after delta. |
| 4119 | |
| 4120 | |
| 4121 | |
| 4122 | |
| 4123 | /// [`INTRA128_LOSSLESS_HITS`], for a gate's own before/after delta. |
| 4124 | pub |
| 4125 | |
| 4126 | |
| 4127 | |
| 4128 | /// [`INTRA128_IN_INTER_HITS`], for a gate's own before/after delta. |
| 4129 | pub |
| 4130 | |
| 4131 | |
| 4132 | |
| 4133 | /// [`INTRA_SB128_HORZ_HITS`] / [`INTRA_SB128_VERT_HITS`] / |
| 4134 | /// [`INTRA_SB128_DEPTH_HITS`], for a gate's own before/after delta. |
| 4135 | pub |
| 4136 | |
| 4137 | |
| 4138 | |
| 4139 | |
| 4140 | |
| 4141 | |
| 4142 | |
| 4143 | /// [`SB128RECT_CHROMA_REPLAY_HITS`] (chroma units re-stamped by |
| 4144 | /// `decode_block_128rect`'s end-of-block replay) and |
| 4145 | /// [`SB128RECT_REPLAY_SPAN_MISMATCH_HITS`] (replays whose stamped height was |
| 4146 | /// not the unit's own), for a gate's own before/after delta. |
| 4147 | pub |
| 4148 | |
| 4149 | |
| 4150 | |
| 4151 | |
| 4152 | |
| 4153 | |
| 4154 | /// Records one block's shape. The table is ordered by measured frequency over |
| 4155 | /// the three witnesses the census gate decodes, so the common square shapes |
| 4156 | /// leave the scan on their first comparison. |
| 4157 | pub |
| 4158 | |
| 4159 | |
| 4160 | |
| 4161 | |
| 4162 | |
| 4163 | |
| 4164 | |
| 4165 | |
| 4166 | |
| 4167 | |
| 4168 | /// lane-cdefstrip r1 instrument, run for every frame BEFORE either of |
| 4169 | /// [`apply_cdef`]'s early returns. |
| 4170 | pub |
| 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 | // lane-sb128 r2: the 128x128 superblock root, shared by the key-frame and |
| 4208 | // the inter tile loop. Its loop-restoration units are read once for the whole |
| 4209 | // 128x128 (spec 5.11.57 is called with the superblock's own size), then one |
| 4210 | // partition symbol off the `BLOCK_128X128` CDF (8 symbols, no HORZ_4/VERT_4) |
| 4211 | // decides the root -- only SPLIT recurses into the four 64x64 quadrants this |
| 4212 | // decoder codes, the other seven arms refuse by name. |
| 4213 | thread_local! |
| 4214 | |
| 4215 | |
| 4216 | |
| 4217 | |
| 4218 | |
| 4219 | |
| 4220 | |
| 4221 | |
| 4222 | |
| 4223 | |
| 4224 | |
| 4225 | |
| 4226 | |
| 4227 | |
| 4228 | |
| 4229 | |
| 4230 | |
| 4231 | /// [`PART128_AB_HITS`], for a gate's own before/after delta. |
| 4232 | pub |
| 4233 | |
| 4234 | |
| 4235 | |
| 4236 | /// [`PART128_NONE_HITS`], for a gate's own before/after delta. |
| 4237 | // read only from the `#[cfg(test)]` gates |
| 4238 | pub |
| 4239 | |
| 4240 | |
| 4241 | |
| 4242 | /// [`PART128_HORZ_HITS`], for a gate's own before/after delta. |
| 4243 | // gate counter accessor with no reader yet; the counter itself is live |
| 4244 | pub |
| 4245 | |
| 4246 | |
| 4247 | |
| 4248 | /// [`PART128_VERT_HITS`], for a gate's own before/after delta. |
| 4249 | // gate counter accessor with no reader yet; the counter itself is live |
| 4250 | pub |
| 4251 | |
| 4252 | |
| 4253 | |
| 4254 | /// [`PART128_EDGE_HORZ_HITS`] -- gathered-bit HORZ at the bottom frame edge. |
| 4255 | pub |
| 4256 | |
| 4257 | |
| 4258 | |
| 4259 | /// [`PART128_EDGE_VERT_HITS`] -- gathered-bit VERT at the right frame edge. |
| 4260 | pub |
| 4261 | |
| 4262 | |
| 4263 | |
| 4264 | thread_local! |
| 4265 | |
| 4266 | |
| 4267 | |
| 4268 | |
| 4269 | |
| 4270 | |
| 4271 | thread_local! |
| 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 | /// [`MU_CHUNK_ORDER_HITS`], for a gate's own before/after delta. |
| 4300 | // read only from the `#[cfg(test)]` gates |
| 4301 | pub |
| 4302 | |
| 4303 | |
| 4304 | |
| 4305 | /// [`LOSSLESS_SQ_TXFM_BAND_OVERWRITE_HITS`] -- square lossless inter blocks |
| 4306 | /// whose `set_txfm_ctxs` publish overwrote a size an earlier block of the |
| 4307 | /// same frame had left in the above band, for a gate's own before/after |
| 4308 | /// delta. |
| 4309 | // read only from the `#[cfg(test)]` gates |
| 4310 | pub |
| 4311 | |
| 4312 | |
| 4313 | |
| 4314 | /// [`CHROMA_SPLIT_TX_HITS`], for a gate's own before/after delta. |
| 4315 | // read only from the `#[cfg(test)]` gates |
| 4316 | pub |
| 4317 | |
| 4318 | |
| 4319 | |
| 4320 | thread_local! |
| 4321 | |
| 4322 | |
| 4323 | |
| 4324 | |
| 4325 | |
| 4326 | |
| 4327 | |
| 4328 | |
| 4329 | /// [`LLINTRA8_CHROMA_WALK_HITS`]: lossless 4:4:4 chroma walks through an |
| 4330 | /// inter frame's 8x8 INTRA leaf. |
| 4331 | |
| 4332 | |
| 4333 | |
| 4334 | |
| 4335 | thread_local! |
| 4336 | |
| 4337 | |
| 4338 | |
| 4339 | |
| 4340 | |
| 4341 | |
| 4342 | |
| 4343 | |
| 4344 | |
| 4345 | /// [`LLSUB8RECT444_CHROMA_WALK_HITS`]: lossless 4:4:4 chroma walks through a |
| 4346 | /// sub-8 8x4/4x8 INTRA leaf. |
| 4347 | |
| 4348 | |
| 4349 | |
| 4350 | |
| 4351 | thread_local! |
| 4352 | |
| 4353 | |
| 4354 | |
| 4355 | |
| 4356 | |
| 4357 | |
| 4358 | |
| 4359 | |
| 4360 | thread_local! |
| 4361 | |
| 4362 | |
| 4363 | |
| 4364 | |
| 4365 | |
| 4366 | |
| 4367 | |
| 4368 | |
| 4369 | |
| 4370 | thread_local! |
| 4371 | |
| 4372 | |
| 4373 | |
| 4374 | |
| 4375 | |
| 4376 | |
| 4377 | |
| 4378 | |
| 4379 | |
| 4380 | |
| 4381 | |
| 4382 | |
| 4383 | |
| 4384 | |
| 4385 | |
| 4386 | |
| 4387 | |
| 4388 | |
| 4389 | thread_local! |
| 4390 | |
| 4391 | |
| 4392 | |
| 4393 | |
| 4394 | |
| 4395 | |
| 4396 | |
| 4397 | |
| 4398 | |
| 4399 | |
| 4400 | /// [`CHROMA_QUAD_LEAF_TX_SINGLEREF_HITS`]: single-reference-arm chroma units |
| 4401 | /// that took their type from the covering luma leaf. |
| 4402 | // read only from the `#[cfg(test)]` gates |
| 4403 | pub |
| 4404 | |
| 4405 | |
| 4406 | |
| 4407 | /// [`CHROMA_QUAD_LEAF_TX_SINGLEREF_DIFF_HITS`]: of those, the units whose |
| 4408 | /// covering leaf's type differs from the block-level one. |
| 4409 | // read only from the `#[cfg(test)]` gates |
| 4410 | pub |
| 4411 | |
| 4412 | |
| 4413 | |
| 4414 | /// [`CHROMA_QUAD_LEAF_TX_HITS`]: chroma units that took their type from the |
| 4415 | /// covering luma leaf. |
| 4416 | // read only from the `#[cfg(test)]` gates |
| 4417 | pub |
| 4418 | |
| 4419 | |
| 4420 | |
| 4421 | /// [`CHROMA_QUAD_LEAF_TX_DIFF_HITS`]: chroma units whose covering leaf's type |
| 4422 | /// differs from the block-level one. |
| 4423 | // read only from the `#[cfg(test)]` gates |
| 4424 | pub |
| 4425 | |
| 4426 | |
| 4427 | |
| 4428 | thread_local! |
| 4429 | |
| 4430 | |
| 4431 | |
| 4432 | |
| 4433 | |
| 4434 | |
| 4435 | |
| 4436 | |
| 4437 | |
| 4438 | |
| 4439 | thread_local! |
| 4440 | |
| 4441 | |
| 4442 | |
| 4443 | |
| 4444 | |
| 4445 | |
| 4446 | |
| 4447 | /// [`CHROMA_RECT_LEAF_TX_HITS`]: rect chroma units that took their type from |
| 4448 | /// the covering luma leaf. |
| 4449 | // read only from the `#[cfg(test)]` gates |
| 4450 | pub |
| 4451 | |
| 4452 | |
| 4453 | |
| 4454 | /// [`CHROMA_RECT_LEAF_TX_DIFF_HITS`]: of those, the units whose covering |
| 4455 | /// leaf's type differs from the block-level one. |
| 4456 | // read only from the `#[cfg(test)]` gates |
| 4457 | pub |
| 4458 | |
| 4459 |