ec-av1 rate loop: GAIN = 1/WEIGHT_LEVEL_GAIN (was 1/0.0154). Measured slope is 0.0557, so the old gain was ~3.6x loop gain, a period-2 limit cycle (sizes alternating ~4800/~1800, settled mean 3094 vs 4000) that also biased the mean low. Matched gain gives ~1x, one source of truth for the slope.
Browse files at this commit96338e58bb1c9605677e82ed21d6b6e7368b935cParent: a8e773b1 changed file +1 -1
crates/ec-av1/src/encoder/mod.rsmodified+1 -1
| @@ -281,7 +281,7 @@ impl RateLoop { | |||
| 281 | const STEP_CLAMP: f64 = 12.0; | 281 | const STEP_CLAMP: f64 = 12.0; |
| 282 | /// The calibration sweep's own slope (see the struct doc), inverted to | 282 | /// The calibration sweep's own slope (see the struct doc), inverted to |
| 283 | /// convert a bytes ratio into a `q_idx` step. | 283 | /// convert a bytes ratio into a `q_idx` step. |
| 284 | - const GAIN: f64 = 1.0 / 0.0154; | 284 | + const GAIN: f64 = 1.0 / WEIGHT_LEVEL_GAIN; |
| 285 | /// The windup bound on [`RateLoop::replan`]: however much a bound level | 285 | /// The windup bound on [`RateLoop::replan`]: however much a bound level |
| 286 | /// fails to spend, no other level's target may grow past this multiple of | 286 | /// fails to spend, no other level's target may grow past this multiple of |
| 287 | /// its opening share. Without it a run whose hidden levels are all at the | 287 | /// its opening share. Without it a run whose hidden levels are all at the |