fix(engine): tune VP9 cpu-used across render paths (#1614)

* fix(engine): tune VP9 cpu-used across render paths

* fix: address VP9 review feedback
This commit is contained in:
Miguel Ángel
2026-06-20 16:36:59 -04:00
committed by GitHub
parent d6135ca155
commit 8408a44745
30 changed files with 273 additions and 26 deletions
@@ -0,0 +1,13 @@
export const DEFAULT_VP9_CPU_USED = 4;
export const MIN_VP9_CPU_USED = -8;
export const MAX_VP9_CPU_USED = 8;
export function normalizeVp9CpuUsed(value: number | undefined): number {
if (value === undefined || !Number.isFinite(value)) return DEFAULT_VP9_CPU_USED;
const integer = Math.trunc(value);
return Math.max(MIN_VP9_CPU_USED, Math.min(MAX_VP9_CPU_USED, integer));
}
export function appendVp9CpuUsedArg(args: string[], value: number | undefined): void {
args.push("-cpu-used", String(normalizeVp9CpuUsed(value)));
}