forge
Explore
Log in

Don't you dare go Hollow

The split census guard printed on every unarmed encode (then_some drops its argument)

Browse files at this commit

651e20788e4de5b08b1592e63b4f84d178691cd2Ahmet Kaan GümüşParent: c781f74
  • fix
    • the split census guard printed on every unarmed encode (then_some drops its argument)
Show full message
fix(av1): the split census guard printed on every unarmed encode (then_some drops its argument)
crates/ec-av1/src/encoder.rsmodified+4 -1
@@ -1389,7 +1389,10 @@ impl Av1Encoder {
13891389 crate::encode::dump_split_census();
13901390 }
13911391 }
1392- let _census = crate::encode::split_census_on().then_some(SplitCensusDump);
1392+ // `then_some` would CONSTRUCT the guard eagerly and drop it when the
1393+ // flag is off, which runs `Drop` -- and printed the census header on
1394+ // every unarmed encode. `then` builds it only when armed.
1395+ let _census = crate::encode::split_census_on().then(|| SplitCensusDump);
13931396 if (picture.width, picture.height) != (self.config.width, self.config.height) {
13941397 return Err(Error::unsupported(
13951398 "AV1 encode",