Add skip_mode CDF table + adaptation state (unwired)
Browse files at this commit3403b039db53c61b99c4a612eba05c3545d14cbaParent: 1324c3d- feat
- add skip_mode CDF table + adaptation state (unwired)
2 changed files +13 -0
crates/ec-av1/src/cdf.rsmodified+8 -0
| @@ -1177,6 +1177,14 @@ pub const SINGLE_REF: [[[u16; 3]; 6]; 3] = [ | ||
| 1177 | 1177 | ], |
| 1178 | 1178 | ]; |
| 1179 | 1179 | |
| 1180 | +/// `default_skip_mode_cdfs` (entropymode.c, `SKIP_MODE_CONTEXTS` = 3): whether | |
| 1181 | +/// a block reads `skip_mode` (forced `NEAREST_NEARESTMV` compound, `skip` | |
| 1182 | +/// forced true, no residual) -- indexed by `av1_get_skip_mode_context` | |
| 1183 | +/// (`above.skip_mode + left.skip_mode`, `pred_common.h`), only read when this | |
| 1184 | +/// frame's own `skip_mode_present` header bit is set and the block is at | |
| 1185 | +/// least 8x8 both dims (`is_comp_ref_allowed`) -- lane-av1comp. | |
| 1186 | +pub const SKIP_MODE: [[u16; 3]; 3] = [[32621, 32768, 0], [20708, 32768, 0], [8127, 32768, 0]]; | |
| 1187 | + | |
| 1180 | 1188 | /// `Default_Comp_Mode_Cdf` (spec 9.4, `default_comp_inter_cdf`): whether an |
| 1181 | 1189 | /// inter block reads `SINGLE_REFERENCE` or `COMPOUND_REFERENCE` -- only |
| 1182 | 1190 | /// reached once `read_ref_frames` knows the frame's `reference_select` |
crates/ec-av1/src/cdf_state.rsmodified+5 -0
| @@ -296,6 +296,9 @@ pub(crate) struct Cdfs { | ||
| 296 | 296 | /// Whether a block reads `SINGLE_REFERENCE` or `COMPOUND_REFERENCE` |
| 297 | 297 | /// (lane-av1comp, spec 5.11.25's `comp_mode`). |
| 298 | 298 | pub comp_mode: [[u16; 3]; 5], |
| 299 | + /// Whether a block reads `skip_mode` (lane-av1comp, spec 5.11.29's | |
| 300 | + /// `skip_mode`), indexed by `av1_get_skip_mode_context`. | |
| 301 | + pub skip_mode: [[u16; 3]; 3], | |
| 299 | 302 | /// Which of the eight `INTER_COMPOUND_MODES` a `COMPOUND_REFERENCE` |
| 300 | 303 | /// block takes (lane-av1comp, spec 5.11.24's `compound_mode`). |
| 301 | 304 | pub inter_compound_mode: [[u16; 9]; 8], |
| @@ -523,6 +526,7 @@ impl Cdfs { | ||
| 523 | 526 | reset2(&mut self.intra_inter); |
| 524 | 527 | reset3(&mut self.single_ref); |
| 525 | 528 | reset2(&mut self.comp_mode); |
| 529 | + reset2(&mut self.skip_mode); | |
| 526 | 530 | reset2(&mut self.inter_compound_mode); |
| 527 | 531 | reset2(&mut self.comp_ref_type); |
| 528 | 532 | reset3(&mut self.uni_comp_ref); |
| @@ -960,6 +964,7 @@ impl Cdfs { | ||
| 960 | 964 | uni_comp_ref: cdf::UNI_COMP_REF, |
| 961 | 965 | comp_ref: cdf::COMP_REF, |
| 962 | 966 | comp_bwdref: cdf::COMP_BWDREF, |
| 967 | + skip_mode: cdf::SKIP_MODE, | |
| 963 | 968 | comp_group_idx: cdf::COMP_GROUP_IDX, |
| 964 | 969 | compound_idx: cdf::COMPOUND_IDX, |
| 965 | 970 | y_mode: cdf::Y_MODE, |