edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiBcbbd6e2Tahinli2 months ago2369 commits
| 1 | //! Compound-reference blend weights (spec 7.11.3.15's "Distance weights |
| 2 | //! process", libaom's `av1_dist_wtd_comp_weight_assign` in |
| 3 | //! `reconinter.c`) -- pure, independent of the CDF/bitstream plumbing that |
| 4 | //! decides *whether* a block reads `compound_idx` at all (lane-av1comp, |
| 5 | //! decode.rs). Kept its own module so it is testable without a live |
| 6 | //! decoder: `dist_wtd_comp_weight_assign` takes exactly the four order |
| 7 | //! hints libaom's version reads off `AV1_COMMON`/`MB_MODE_INFO`. |
| 8 | |
| 9 | /// `MAX_FRAME_DISTANCE` (spec/`enums.h`): `(1 << FRAME_OFFSET_BITS) - 1`, |
| 10 | /// `FRAME_OFFSET_BITS == 5`. |
| 11 | const MAX_FRAME_DISTANCE: i32 = - 1; |
| 12 | |
| 13 | /// `quant_dist_weight` (libaom `common_data.h`) -- the three candidate |
| 14 | /// weight ratios the search below picks between, before falling back to the |
| 15 | /// index-3 row when either distance is zero. |
| 16 | const QUANT_DIST_WEIGHT: = ; |
| 17 | |
| 18 | /// `quant_dist_lookup_table` (libaom `common_data.h`): the actual |
| 19 | /// `fwd_offset`/`bck_offset` pair each `QUANT_DIST_WEIGHT` row resolves to |
| 20 | /// (both always sum to 16, `1 << DIST_PRECISION_BITS`). |
| 21 | const QUANT_DIST_LOOKUP_TABLE: = ; |
| 22 | |
| 23 | /// `av1_dist_wtd_comp_weight_assign` (spec 7.11.3.15 / libaom |
| 24 | /// `reconinter.c`): `(fwd_weight, bck_weight)` for a compound block, given |
| 25 | /// this frame's own `order_hint` and the two references' order hints -- |
| 26 | /// `ref0_order_hint` names `mbmi->ref_frame[0]` (libaom's "`bck`", despite |
| 27 | /// the name -- it is nearer in decode order for a typical GOP but the |
| 28 | /// spec's algebra does not assume that), `ref1_order_hint` names |
| 29 | /// `ref_frame[1]` ("`fwd`"). |
| 30 | /// |
| 31 | /// `compound_idx == 1` (or `!is_compound`, never reached from here) is the |
| 32 | /// simple-average caller's job: it never calls this and uses `(8, 8)` |
| 33 | /// directly (spec 7.11.3.15's `use_dist_wtd_comp_avg == 0` branch) -- |
| 34 | /// this function only ever implements the `use_dist_wtd_comp_avg == 1` |
| 35 | /// (`compound_idx == 0`) branch. |
| 36 | pub |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 |