edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiBabd0a08Tahinli3 months ago1343 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. |
| 9 | |
| 10 | Usage: extract-eob-class1.py <token_cdfs.h> [--check <cdf.rs>] |
| 11 | """ |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | = |
| 17 | = |
| 18 | |
| 19 | |
| 20 | |
| 21 | = |
| 22 | |
| 23 | |
| 24 | = |
| 25 | |
| 26 | |
| 27 | |
| 28 | # flat order: q-major, then plane, then class |
| 29 | |
| 30 | |
| 31 | return |
| 32 | |
| 33 | |
| 34 | |
| 35 | = |
| 36 | |
| 37 | = |
| 38 | |
| 39 | |
| 40 | = |
| 41 | = + |
| 42 | return |
| 43 | |
| 44 | |
| 45 | |
| 46 | = |
| 47 | = |
| 48 | |
| 49 | = |
| 50 | = = 0 |
| 51 | |
| 52 | = |
| 53 | |
| 54 | continue |
| 55 | += 1 |
| 56 | = |
| 57 | |
| 58 | += 1 |
| 59 | |
| 60 | |
| 61 | = |
| 62 | |
| 63 | |
| 64 | |
| 65 | = |
| 66 | |
| 67 | |
| 68 | |
| 69 |