V210 issue fix + correct packing

This commit is contained in:
Dmitry Sergeev
2026-09-18 01:30:11 +03:00
parent efa958723a
commit 4d8035a434
24 changed files with 218 additions and 84 deletions
+3 -3
View File
@@ -29,8 +29,8 @@ func NewCPUGenerator(
if width == 0 || height == 0 {
return nil, fmt.Errorf("cpu: width and height must be greater than zero, got %dx%d", width, height)
}
if width%6 != 0 {
return nil, fmt.Errorf("cpu: width must be divisible by 6, got %d", width)
if width%2 != 0 {
return nil, fmt.Errorf("cpu: width must be even for 4:2:2 video, got %d", width)
}
if baseRenderer == nil {
return nil, fmt.Errorf("cpu: base renderer is nil")
@@ -39,7 +39,7 @@ func NewCPUGenerator(
g := &CPUGenerator{
width: int(width),
height: int(height),
base: make([]byte, int(width/6*height)*16),
base: make([]byte, V210FrameSize(int(width), int(height))),
patch: patch,
}
if err := baseRenderer(g.base, g.width, g.height, 0); err != nil {