edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB231663eTahinli3 months ago1475 commits
| 1 | /* lane-recttx r1: pins the 14 rectangular inverse transform sizes against |
| 2 | * the REAL libaom 1D kernels (av1_idct4/8/16/32/64, DCT_DCT only), linked |
| 3 | * from libaom.a -- NOT the higher-level `av1_inv_txfm2d_add_WxH_c` facade, |
| 4 | * which segfaults called standalone from a bare harness (its |
| 5 | * `av1_get_inv_txfm_cfg` path resolves a NULL function pointer outside a |
| 6 | * real decoder's init sequence; root cause not chased further -- turn |
| 7 | * budget). Calling the plain per-axis kernels directly sidesteps that and |
| 8 | * is still linked, not transcribed, code for the part that actually needs |
| 9 | * checking here: the axis-swap / rect-scale / row-shift PLUMBING is this |
| 10 | * harness's own C, ported line-for-line from `inv_txfm2d_add_c` |
| 11 | * (av1_inv_txfm2d.c:234-315) -- see the charter's `reference-layout-not-spec` |
| 12 | * note: libaom's row-pass input is COLUMN-major (`input[c * txfm_size_row + |
| 13 | * r]`, av1_inv_txfm2d.c:275), our own `dequant` is ROW-major |
| 14 | * (`dequant[i * w + j]`) -- this harness transposes at the boundary, |
| 15 | * feeding the SAME logical coefficient grid the Rust side gets, so a |
| 16 | * transposed-axis bug in the Rust port cannot be cancelled by an |
| 17 | * equally-transposed harness. |
| 18 | * |
| 19 | * stage_range is fixed at 16 for every stage: `av1_gen_inv_stage_range` |
| 20 | * (av1_inv_txfm2d.c:194-196) sets `opt_range_row = opt_range_col = 16` for |
| 21 | * `bd == 8`, which is exactly what this lane's row_clamp/col_clamp already |
| 22 | * are at bit_depth 8 (`bit_depth + 8 = 16`, `max(bit_depth + 6, 16) = 16`). |
| 23 | * |
| 24 | * Build: cc -O2 -I<aom-src> lanes/recttx_dump.c <aom-build>/libaom.a \ |
| 25 | * -lm -lpthread -o /tmp/recttx_dump |
| 26 | */ |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | typedef int32_t tran_low_t; |
| 32 | |
| 33 | extern void ; |
| 34 | extern void ; |
| 35 | extern void ; |
| 36 | extern void ; |
| 37 | extern void ; |
| 38 | |
| 39 | |
| 40 | static const int8_t STAGE_RANGE = ; |
| 41 | |
| 42 | typedef void ; |
| 43 | |
| 44 | static idct_fn |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | static int |
| 56 | |
| 57 | /* `Transform_Row_Shift` / `av1_inv_txfm_shift_ls` (av1_inv_txfm2d.c:132-158, |
| 58 | * `shift[0]`): keyed on the full (w, h) TX size, identical table the Rust |
| 59 | * side's `row_shift_wh` carries. */ |
| 60 | static int |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | /* Asymmetric per (row, col) coefficient in the coded corner (min(w,32) x |
| 76 | * min(h,32)), zero elsewhere -- row weight (24) and col weight (17) differ |
| 77 | * so a transposed-axis bug lands on a different value, not a |
| 78 | * coincidentally equal one. */ |
| 79 | static int32_t |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | /* `inv_txfm2d_add_c`'s DCT_DCT path (av1_inv_txfm2d.c:234-315), transcribed |
| 87 | * for (w, h) with `dequant` in ROW-major order as our Rust side keeps it -- |
| 88 | * libaom's own `input[c * txfm_size_row + r]` column-major addressing is |
| 89 | * reproduced here (`col_major`), not copied into our indexing convention. */ |
| 90 | static void |
| 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 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | int |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 |