Add encoding.lp (0 = auto) so a long encode can be capped to N logical processors instead of pinning every core, as a lighter-weight alternative to the compose cgroup limit. Threaded config -> types.Job -> -svtav1-params via a testable svtav1Params helper. Settings-UI surfacing stays with #1. refs #5
24 lines
629 B
Go
24 lines
629 B
Go
package encoder
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestSvtav1Params(t *testing.T) {
|
|
const base = "film-grain=10:film-grain-denoise=1:scd=1:qm-min=4:qm-max=15:keyint=10s"
|
|
|
|
if got := svtav1Params(0); got != base {
|
|
t.Errorf("lp=0 should not append lp:\n got %q\nwant %q", got, base)
|
|
}
|
|
if got := svtav1Params(-1); got != base {
|
|
t.Errorf("lp<0 should not append lp: got %q", got)
|
|
}
|
|
if got := svtav1Params(4); got != base+":lp=4" {
|
|
t.Errorf("lp=4: got %q, want suffix :lp=4", got)
|
|
}
|
|
if got := svtav1Params(4); !strings.HasPrefix(got, base) {
|
|
t.Errorf("lp set should keep the base params intact: got %q", got)
|
|
}
|
|
}
|