Widen the own-size sweep
Browse files at this commit1457eaab896abfad2073035469e09b26a2ea4ae5Parent: 0e70b27- test
- widen the own-size sweep
- close hp-mv dead code
2 changed files +13 -7
crates/ec-av1/src/cdf_state.rsmodified+4 -6
| @@ -194,14 +194,14 @@ pub(crate) struct MvComponentCdfs { | ||
| 194 | 194 | pub class0_bit: [u16; 3], |
| 195 | 195 | /// The fractional part of a small-class magnitude, by its integer bit. |
| 196 | 196 | pub class0_fr: [[u16; 5]; 2], |
| 197 | - /// The half-pel bit of a small-class magnitude. | |
| 198 | - pub class0_hp: [u16; 3], | |
| 197 | + // `class0_hp`/`hp` (spec's half-pel-bit CDFs) are never written: this | |
| 198 | + // encoder always sets `allow_high_precision_mv = false`, so the syntax | |
| 199 | + // that reads them (spec 5.9.32 `mv_class0_hp`/`mv_hp`) never fires -- | |
| 200 | + // dropped rather than kept dead. Add back if/when hp mode ships. | |
| 199 | 201 | /// One bit of an above-small-class magnitude, by its position. |
| 200 | 202 | pub bit: [[u16; 3]; 10], |
| 201 | 203 | /// The fractional part of an above-small-class magnitude. |
| 202 | 204 | pub fr: [u16; 5], |
| 203 | - /// The half-pel bit of an above-small-class magnitude. | |
| 204 | - pub hp: [u16; 3], | |
| 205 | 205 | /// The component's sign. |
| 206 | 206 | pub sign: [u16; 3], |
| 207 | 207 | } |
| @@ -212,10 +212,8 @@ impl MvComponentCdfs { | ||
| 212 | 212 | class: cdf::MV_CLASS, |
| 213 | 213 | class0_bit: cdf::MV_CLASS0_BIT, |
| 214 | 214 | class0_fr: cdf::MV_CLASS0_FR, |
| 215 | - class0_hp: cdf::MV_CLASS0_HP, | |
| 216 | 215 | bit: cdf::MV_BIT, |
| 217 | 216 | fr: cdf::MV_FR, |
| 218 | - hp: cdf::MV_HP, | |
| 219 | 217 | sign: cdf::MV_SIGN, |
| 220 | 218 | } |
| 221 | 219 | } |
crates/ec-av1/src/encode.rsmodified+9 -1
| @@ -2433,7 +2433,15 @@ mod tests { | ||
| 2433 | 2433 | // 854x480 is covered separately by |
| 2434 | 2434 | // `an_854x480_picture_round_trips_through_its_padding`, which its own |
| 2435 | 2435 | // doc comment explains was worth keeping as its own test. |
| 2436 | - for &(width, height) in &[(1920usize, 1080usize), (640, 352), (1280, 720)] { | |
| 2436 | + for &(width, height) in &[ | |
| 2437 | + (1920usize, 1080usize), | |
| 2438 | + (640, 352), | |
| 2439 | + (1280, 720), | |
| 2440 | + (64, 56), | |
| 2441 | + (854, 480), | |
| 2442 | + (216, 96), | |
| 2443 | + (192, 120), | |
| 2444 | + ] { | |
| 2437 | 2445 | let picture = test_card(width, height); |
| 2438 | 2446 | let encoded = encode_key_frame(&picture, 100, 0.5).unwrap(); |
| 2439 | 2447 | assert_eq!( |