mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 12:54:29 +00:00
* fix(engine): tune VP9 cpu-used across render paths * fix: address VP9 review feedback
14 lines
532 B
TypeScript
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)));
|
|
}
|