diff --git a/Services/Compositor/SceneCompositor.cs b/Services/Compositor/SceneCompositor.cs index 58249f8..bf0a7ba 100644 --- a/Services/Compositor/SceneCompositor.cs +++ b/Services/Compositor/SceneCompositor.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Threading.Tasks; using ytLive.Helpers; using ytLive.Models; @@ -575,10 +576,11 @@ public sealed class SceneCompositor sxLut[xi] = sxCanvas; } - for (var y = y0; y <= y1; y++) + var parallelOpts = new ParallelOptions { MaxDegreeOfParallelism = 4 }; + Parallel.For(y0, y1 + 1, parallelOpts, y => { var py = y - ey; - if (py < oy || py > oy + drawnH) continue; + if (py < oy || py > oy + drawnH) return; // syNorm: normalized [0,1] position within the drawn content (vertically) var syNorm = (py - oy) / drawnH; @@ -656,7 +658,7 @@ public sealed class SceneCompositor } } } - } + }); } /// Two-stage bilinear in 8.8 fixed point; result within ±1 of the