mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 06:30:03 +00:00
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:
@@ -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)));
|
||||
}
|
||||
Reference in New Issue
Block a user