edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiBccbcc73Tahinli2 months ago2621 commits
| 1 | #!/usr/bin/env python3 |
| 2 | """Extract libaom's eob_multi CDF rows and emit / verify our Rust consts. |
| 3 | |
| 4 | `av1_default_eob_multi{16,32,64,128,256,512,1024}_cdfs` are |
| 5 | `[TOKEN_CDF_Q_CTXS][PLANE_TYPES][2][CDF_SIZE(n)]`; the third index is |
| 6 | `eob_multi_ctx = (tx_class == TX_CLASS_2D) ? 0 : 1`. This prints the |
| 7 | class-1 (index 1) rows as `EOB_PT_<n>_<PLANE>_CLASS1[_Qk]` consts and, with |
| 8 | `--check <cdf.rs>`, diffs every const that file already defines -- BOTH classes, |
| 9 | so a 2D const accidentally transcribed from the class-1 row is caught too |
| 10 | (rectsplit r4 suspected exactly that of `EOB_PT_512_CHROMA`). |
| 11 | |
| 12 | Usage: extract-eob-class1.py <token_cdfs.h> [--check <cdf.rs>] |
| 13 | """ |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | = |
| 19 | = |
| 20 | |
| 21 | |
| 22 | |
| 23 | = |
| 24 | |
| 25 | |
| 26 | = |
| 27 | |
| 28 | |
| 29 | |
| 30 | # flat order: q-major, then plane, then class |
| 31 | |
| 32 | |
| 33 | return |
| 34 | |
| 35 | |
| 36 | |
| 37 | = |
| 38 | |
| 39 | = |
| 40 | |
| 41 | |
| 42 | |
| 43 | = |
| 44 | = + |
| 45 | return |
| 46 | |
| 47 | |
| 48 | |
| 49 | = |
| 50 | = |
| 51 | |
| 52 | = |
| 53 | = = 0 |
| 54 | |
| 55 | = |
| 56 | |
| 57 | continue |
| 58 | += 1 |
| 59 | = |
| 60 | |
| 61 | += 1 |
| 62 | |
| 63 | |
| 64 | = |
| 65 | |
| 66 | |
| 67 | |
| 68 | = |
| 69 | |
| 70 | |
| 71 | |
| 72 |