Expand description
Multipass encoding quality comparison.
This module provides tools to verify that multipass encoding (two-pass, lookahead-based) produces measurably better quality than single-pass encoding at the same average bitrate. The comparison uses:
- Per-frame quality scores (QP-derived or PSNR-measured)
- Bitrate distribution analysis (variance, min/max ratio)
- Quality consistency metrics (standard deviation of per-frame quality)
§Verification Strategy
For a fair comparison between single-pass and multipass:
- Encode the same source with both methods at the same target bitrate
- Record per-frame (size, QP) tuples
- Compare:
- Average quality should be equal or better for multipass
- Quality variance should be lower for multipass
- Bitrate distribution should be smoother for multipass
§Usage
use oximedia_codec::multipass_quality::{
PassRecorder, MultipassComparison, FrameMetric,
};
let mut single = PassRecorder::new("single-pass");
let mut multi = PassRecorder::new("two-pass");
// Record frames from each encoding session
single.record(FrameMetric { size_bytes: 5000, qp: 28, is_keyframe: false });
multi.record(FrameMetric { size_bytes: 4800, qp: 27, is_keyframe: false });
// ... more frames ...
let cmp = MultipassComparison::compare(&single, &multi);
// multipass should have equal or better average QPStructs§
- Frame
Metric - Per-frame metric recorded during encoding.
- Multipass
Comparison - Result of comparing two encoding passes.
- Pass
Recorder - Records per-frame metrics for one encoding pass.