V210 issue fix + correct packing
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user