edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! Handwritten trees and constants around the generated bulk tables, |
| 2 | //! plus the block/transform-size enums shared by every module. |
| 3 | |
| 4 | |
| 5 | |
| 6 | pub use *; |
| 7 | |
| 8 | use crateResult; |
| 9 | use Error; |
| 10 | |
| 11 | pub const DIFF_UPDATE_PROB: u8 = 252; |
| 12 | pub const ALLOW_32X32: u8 = 3; |
| 13 | |
| 14 | // spec 5.3 (PREDICTION_MODE) |
| 15 | pub const DC_PRED: u8 = 0; |
| 16 | pub const INTRA_MODES: usize = 10; |
| 17 | |
| 18 | // spec 5.2 (TX_SIZE) |
| 19 | pub const TX_4X4: usize = 0; |
| 20 | pub const TX_8X8: usize = 1; |
| 21 | pub const TX_16X16: usize = 2; |
| 22 | pub const TX_32X32: usize = 3; |
| 23 | |
| 24 | // spec 5.4 (TX_TYPE) |
| 25 | pub const DCT_DCT: usize = 0; |
| 26 | pub const ADST_DCT: usize = 1; |
| 27 | pub const DCT_ADST: usize = 2; |
| 28 | pub const ADST_ADST: usize = 3; |
| 29 | |
| 30 | // spec 5.3 (TX_MODE) |
| 31 | pub const ONLY_4X4: u8 = 0; |
| 32 | pub const TX_MODE_SELECT: u8 = 4; |
| 33 | /// decodeframe.c `tx_mode_to_biggest_tx_size`. |
| 34 | pub const TX_MODE_TO_BIGGEST_TX_SIZE: = |
| 35 | ; |
| 36 | |
| 37 | /// spec 6.3.5 `partition_tree`. |
| 38 | pub const PARTITION_TREE: = ; |
| 39 | /// libvpx `vp9_intra_mode_tree` (vp9_entropymode.c:245), verbatim. v1.15 |
| 40 | /// uses this one tree for both y and uv modes (decodemv.c `read_intra_mode`); |
| 41 | /// the spec document's separate chain-shaped `uv_mode_tree` does not exist |
| 42 | /// in libvpx and does not match its bitstream. |
| 43 | pub const INTRA_MODE_TREE: = |
| 44 | |
| 45 | ; |
| 46 | /// libvpx `vp9_segment_tree` (vp9_seg_common.c:58): node refs first, then |
| 47 | /// a balanced leaf block — not the spec doc's right-leaning chain. |
| 48 | pub const SEGMENT_TREE: = ; |
| 49 | |
| 50 | /// blockd.h `get_y_mode`. |
| 51 | |
| 52 | pub |
| 53 | |
| 54 | |
| 55 | |
| 56 | /// vp9_blockd.c `vp9_above_block_mode` (keyframes: neighbours are intra). |
| 57 | pub |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | /// vp9_blockd.c `vp9_left_block_mode`. |
| 73 | pub |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | /// blockd.h `get_y_mode_probs` reduced to the keyframe table. |
| 89 | |
| 90 | pub |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | /// `vp9_kf_uv_mode_prob` reshaped per y mode (9 branch probs). |
| 98 | pub |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | /// `BLOCK_INVALID`, the `ss_size_lookup` sentinel for a subsampled block size |
| 106 | /// that does not exist (`BLOCK_8X4` under 4:4:0, `BLOCK_4X8` under 4:2:2). |
| 107 | pub const BLOCK_INVALID: usize = 255; |
| 108 | |
| 109 | /// common_data.c `ss_size_lookup[bsize][ss_x][ss_y]`: the luma block size |
| 110 | /// `bsize` expressed in a plane subsampled by `ss_x`/`ss_y`. |
| 111 | |
| 112 | pub |
| 113 | |
| 114 | |
| 115 | |
| 116 | /// blockd.h `get_uv_tx_size`: |
| 117 | /// `uv_txsize_lookup[mi->sb_type][mi->tx_size][ss_x][ss_y]`. |
| 118 | |
| 119 | pub |
| 120 | |
| 121 | |
| 122 | |
| 123 | pub |
| 124 | |
| 125 | |
| 126 | |
| 127 | pub |
| 128 | |
| 129 |