Increase H264/H265 bitrate multipliers to improve image quality

- H265: Increase base multiplier from 1.5x to 2.0x (33% more bitrate)
- H264: Increase base multiplier from 2.0x to 2.5x (25% more bitrate)
- Also adjusted high-bitrate decay factors proportionally
- At 1080p Balanced quality: H265 now uses ~2777 kbps (was 2084)
- Fixes issue where H265 had worse quality than VP8 software codec

Co-authored-by: rustdesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-30 17:10:44 +00:00
parent 22000245bc
commit 8c8e6deb18

View File

@@ -264,17 +264,21 @@ impl HwRamEncoder {
5.0 5.0
} }
} else if h264 { } else if h264 {
// Increased base multiplier from 2.0 to 2.5 to improve image quality
// while maintaining H264's compression efficiency
if base > threshold {
1.0 + 1.5 / (1.0 + (base - threshold) * decay_rate)
} else {
2.5
}
} else {
// H265: Increased base multiplier from 1.5 to 2.0 to fix poor image quality
// H265 should be more efficient than H264, but needs sufficient bitrate
if base > threshold { if base > threshold {
1.0 + 1.0 / (1.0 + (base - threshold) * decay_rate) 1.0 + 1.0 / (1.0 + (base - threshold) * decay_rate)
} else { } else {
2.0 2.0
} }
} else {
if base > threshold {
1.0 + 0.5 / (1.0 + (base - threshold) * decay_rate)
} else {
1.5
}
}; };
(base * factor) as u32 (base * factor) as u32
} }