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
+20
View File
@@ -0,0 +1,20 @@
package generator
const v210RowAlignment = 128
// V210ActiveLineSize returns the number of bytes containing pixel data in one
// v210 row, including the final partial six-pixel block when needed.
func V210ActiveLineSize(width int) int {
return (width + 5) / 6 * 16
}
// V210LineSize returns the MXL v210 row stride. MXL stores every row at a
// 128-byte boundary, equivalent to rounding the width up to 48 pixels.
func V210LineSize(width int) int {
return ((width + 47) / 48) * v210RowAlignment
}
// V210FrameSize returns the complete MXL payload size for a v210 frame.
func V210FrameSize(width, height int) int {
return V210LineSize(width) * height
}