ec-av1 rate loop: geometric-mean smoothing only when not repaying. Root cause of Bitrate 384k flat leaf 1720 -> 2002 (+7.4% -> +21.3%): c-round3-full.log (11:25) predates d6f79ca2 (11:28), c-round4.log (12:06) includes it, so the smoothing is the only Bitrate change between them; with replan moving the target every frame the lagged ratio (taken against an older target) fights the repay. BytesPerFrame (fixed target) keeps smoothing. cargo check -p ec-av1 --all-targets clean; remaining +7.4% not addressed, tests left to orchestrator
Browse files at this commitb8d3de0038ffaed8c068822ec2b15c92394c5c41Parent: da6a5d91 changed file +1 -1
crates/ec-av1/src/encoder/mod.rsmodified+1 -1
| @@ -425,7 +425,7 @@ impl RateLoop { | |||
| 425 | // the second frame on the clamp is back, and nothing is accumulated | 425 | // the second frame on the clamp is back, and nothing is accumulated |
| 426 | // between frames, so [[vorbis-rate-loop-windup]]'s bound still holds. | 426 | // between frames, so [[vorbis-rate-loop-windup]]'s bound still holds. |
| 427 | let seeded = std::mem::replace(&mut self.seeded[slot], true); | 427 | let seeded = std::mem::replace(&mut self.seeded[slot], true); |
| 428 | - let smoothed = if seeded { | 428 | + let smoothed = if seeded && !self.repay { |
| 429 | (ratio * self.prev_ratio[slot]).sqrt() | 429 | (ratio * self.prev_ratio[slot]).sqrt() |
| 430 | } else { | 430 | } else { |
| 431 | ratio | 431 | ratio |