Skip to content

fix: SG-42272: Fix subsample422_10bit tail pixel handling for non-multiple-of-6 widths#1141

Open
bernie-laberge wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
bernie-laberge:fix_subsample422_10bit
Open

fix: SG-42272: Fix subsample422_10bit tail pixel handling for non-multiple-of-6 widths#1141
bernie-laberge wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
bernie-laberge:fix_subsample422_10bit

Conversation

@bernie-laberge
Copy link
Contributor

Fix subsample422_10bit tail pixel handling for non-multiple-of-6 widths

Linked issues

NA

Describe the reason for the change.

SDI bug in YCbCr 10 bits for non-multiple-of-6 widths resolutions showing up as a green line on the right side of screen.
I was able to reproduce with a Blackmagic DeckLink 8K Pro outputing in 1280x720p 50Hz.

Cause: The main loop of FastMemcpy.cpp::subsample422_10bit() processed pixels in groups of 6 (v210 packing quantum) but silently dropped any remaining 1-5 pixels at the end of each row, causing incomplete output for non-standard widths.

Summarize your change.

Added tail handling that follows the same v210 bit packing as the main loop, padding missing pixels with neutral chroma (Cb=Cr=512, Y=0) instead of zeros to avoid green/magenta fringing artifacts at the right edge.

I have also temporarily disabled the automatic installation of the marked down linter because it was blocking on my mac and was preventing me from committing anything.

Describe what you have tested and on which operating system.

Successfully tested on macOS

Add a list of changes, and note any that might need special attention during the review.

If possible, provide screenshots.

@cedrik-fuoco-adsk cedrik-fuoco-adsk changed the title Fix subsample422_10bit tail pixel handling for non-multiple-of-6 widths fix: Fix subsample422_10bit tail pixel handling for non-multiple-of-6 widths Feb 19, 2026
@bernie-laberge bernie-laberge changed the title fix: Fix subsample422_10bit tail pixel handling for non-multiple-of-6 widths fix: SG-42272: Fix subsample422_10bit tail pixel handling for non-multiple-of-6 widths Feb 20, 2026
Comment on lines 435 to 436
const size_t tailPixels = width % 6;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment why 6?

Copy link
Contributor Author

@bernie-laberge bernie-laberge Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. I'll add a more explicit constexpr variable here so that it is self explanatory
On it.

…tiple-of-6 widths

Signed-off-by: Bernard Laberge <bernard.laberge@autodesk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants