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 | pub class0_bit: [u16; 3], | 194 | pub class0_bit: [u16; 3], |
| 195 | /// The fractional part of a small-class magnitude, by its integer bit. | 195 | /// The fractional part of a small-class magnitude, by its integer bit. |
| 196 | pub class0_fr: [[u16; 5]; 2], | 196 | pub class0_fr: [[u16; 5]; 2], |
| 197 | - /// The half-pel bit of a small-class magnitude. | 197 | + // `class0_hp`/`hp` (spec's half-pel-bit CDFs) are never written: this |
| 198 | - pub class0_hp: [u16; 3], | 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 | /// One bit of an above-small-class magnitude, by its position. | 201 | /// One bit of an above-small-class magnitude, by its position. |
| 200 | pub bit: [[u16; 3]; 10], | 202 | pub bit: [[u16; 3]; 10], |
| 201 | /// The fractional part of an above-small-class magnitude. | 203 | /// The fractional part of an above-small-class magnitude. |
| 202 | pub fr: [u16; 5], | 204 | pub fr: [u16; 5], |
| 203 | - /// The half-pel bit of an above-small-class magnitude. | ||
| 204 | - pub hp: [u16; 3], | ||
| 205 | /// The component's sign. | 205 | /// The component's sign. |
| 206 | pub sign: [u16; 3], | 206 | pub sign: [u16; 3], |
| 207 | } | 207 | } |
| @@ -212,10 +212,8 @@ impl MvComponentCdfs { | |||
| 212 | class: cdf::MV_CLASS, | 212 | class: cdf::MV_CLASS, |
| 213 | class0_bit: cdf::MV_CLASS0_BIT, | 213 | class0_bit: cdf::MV_CLASS0_BIT, |
| 214 | class0_fr: cdf::MV_CLASS0_FR, | 214 | class0_fr: cdf::MV_CLASS0_FR, |
| 215 | - class0_hp: cdf::MV_CLASS0_HP, | ||
| 216 | bit: cdf::MV_BIT, | 215 | bit: cdf::MV_BIT, |
| 217 | fr: cdf::MV_FR, | 216 | fr: cdf::MV_FR, |
| 218 | - hp: cdf::MV_HP, | ||
| 219 | sign: cdf::MV_SIGN, | 217 | sign: cdf::MV_SIGN, |
| 220 | } | 218 | } |
| 221 | } | 219 | } |
crates/ec-av1/src/encode.rsmodified+9 -1
| @@ -2433,7 +2433,15 @@ mod tests { | |||
| 2433 | // 854x480 is covered separately by | 2433 | // 854x480 is covered separately by |
| 2434 | // `an_854x480_picture_round_trips_through_its_padding`, which its own | 2434 | // `an_854x480_picture_round_trips_through_its_padding`, which its own |
| 2435 | // doc comment explains was worth keeping as its own test. | 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 | let picture = test_card(width, height); | 2445 | let picture = test_card(width, height); |
| 2438 | let encoded = encode_key_frame(&picture, 100, 0.5).unwrap(); | 2446 | let encoded = encode_key_frame(&picture, 100, 0.5).unwrap(); |
| 2439 | assert_eq!( | 2447 | assert_eq!( |