Files
hyperframes/packages/engine/src/services/vp9Options.ts
T
Miguel Ángel 8408a44745 fix(engine): tune VP9 cpu-used across render paths (#1614)
* fix(engine): tune VP9 cpu-used across render paths

* fix: address VP9 review feedback
2026-06-20 16:36:59 -04:00

14 lines
532 B
TypeScript

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)));
}