Expand description
Fixed-frame R-D curve parameterization with corner-based angles.
Every encode lives in a triangle: the worst corner (max bpp, zero quality) is the origin, and the angle from that corner describes position on the rate-distortion tradeoff. This is comparable across codecs, corpora, and resolutions because the frame is fixed by the metric scales and a practical bpp ceiling.
§Fixed frame (web targeting)
| Axis | Min | Max | Notes |
|---|---|---|---|
| bpp | 0 | 4.0 | Practical web ceiling |
| s2 | 0 | 100 | SSIMULACRA2 scale |
| ba | 0 | 15 | Butteraugli practical floor (inverted) |
§Corner angle
θ = atan2(quality_norm * aspect, 1.0 - bpp_norm)
The aspect ratio is calibrated from the reference codec knee (mozjpeg 4:2:0 on CID22) so that the knee lands at exactly 45°.
- θ < 0° → worse than the worst corner (negative quality)
- θ = 0° → worst corner (max bpp, zero quality)
- θ < 45° → compression-efficient (below the knee)
- θ = 45° → reference knee (balanced tradeoff)
- θ ≈ 52° → ideal diagonal (zero bpp, perfect quality)
- θ > 52° → quality-dominated (spending bits for diminishing returns)
- θ = 90° → no compression (max bpp, max quality)
- θ > 90° → over-budget (bpp exceeds frame ceiling)
The knee (45° tangent on the corpus-aggregate curve) is a landmark within this system, not the origin. Its angle tells you where the “balanced tradeoff” falls for a given codec.
§Dual-metric angles
SSIMULACRA2 and Butteraugli produce different angles for the same encode.
Comparing theta_s2 and theta_ba reveals what kind of artifacts the
codec configuration produces at that operating point.
Modules§
- defaults
- Measured defaults from corpus calibration runs (2026-02-03).
Structs§
- Angle
Bin - A single angular bin.
- Axis
Range - Range for normalizing an axis to [0, 1].
- BinScheme
- Defines how the [0°, 90°] range is divided into bins.
- Codec
Config - The full set of tuning knobs that produced a particular encode.
- Configured
Pareto Front - Pareto frontier with angular binning.
- ConfiguredRD
Point - A point on the configuration-aware Pareto frontier.
- Corpus
Aggregate - Aggregated R-D data from a corpus.
- Dual
Angle Bin - Dual-metric bin.
- Encode
Result - A single encode result from one image at one quality level.
- Fixed
Frame - Fixed normalization frame for web-targeted R-D analysis.
- Normalization
Context - Normalization context for knee detection (uses per-curve observed ranges).
- RDCalibration
- Dual-metric calibration with knee landmarks in the fixed frame.
- RDKnee
- The 45° tangent point on a corpus-aggregate R-D curve.
- RDPosition
- An encode’s position in the fixed-frame corner coordinate system.
Enums§
- Param
Value - A single tuning parameter value.
- Quality
Direction - Direction of a quality metric.
Functions§
- plot_
rd_ svg - Generate an SVG plot of the R-D curve with corner angle grid and knee markers.