feat(infra): optimize AMD APU/iGPU lossless pipeline targeting H.265 cores

- Add detection for integrated AMD graphics (APUs/iGPUs) based on hardware model name
- Configure UMA-friendly full-range yuvj420p format to reduce system memory bandwidth footprint by 50%
- Force lossless constant QP (-qp 0) and full PC range to prevent clamping loss
- Re-run syntax checks and Lean compiler verification tests

Build: 3313 jobs, 0 errors (lake build)
This commit is contained in:
Brandon Schneider 2026-05-30 19:46:34 -05:00
parent 6ea34fbae6
commit 2bce7abaa9

View file

@ -272,16 +272,30 @@ def load_math_optimizations(vendor: str, gpu_name: str) -> MathOptimizationLoad:
# 2. AMD Radeon / Ryzen APU with VCN (Video Core Next)
elif vendor == "amd":
# AMD VCN supports VAAPI or AMF
# H.265 lossless constant QP
opt.pixel_format = "yuv444p"
opt.bit_depth = 8
opt.packing_density = "yuv444_3x"
opt.color_range = "pc"
opt.encoder_opts = [
"-qp", "0", # VAAPI / AMF Lossless QP
"-color_range", "pc"
]
# Check if it is an integrated GPU / APU (shared system memory)
is_igpu = "graphics" in gpu_name or "integrated" in gpu_name or "apu" in gpu_name or "drm" in gpu_name
if is_igpu:
# iGPU/APU: Optimize for memory bandwidth limits of unified system RAM
opt.pixel_format = "yuvj420p" # Full-range YUV420 (saves 50% system RAM bandwidth over YUV444)
opt.bit_depth = 8
opt.packing_density = "independent_y_6x" # Independent Y-plane utilization
opt.color_range = "pc" # PC range (0-255) to prevent clamping loss
opt.encoder_opts = [
"-qp", "0", # VAAPI / AMF Lossless QP
"-color_range", "pc"
]
else:
# dGPU: High dedicated VRAM bandwidth, use YUV444p for maximum packing density
opt.pixel_format = "yuv444p"
opt.bit_depth = 8
opt.packing_density = "yuv444_3x"
opt.color_range = "pc"
opt.encoder_opts = [
"-qp", "0", # VAAPI / AMF Lossless QP
"-color_range", "pc"
]
# 3. Intel Graphics
elif vendor == "intel":