Skip to content

Fix cropping of planar 10 and 16 bit images - #1350

Merged
ddennedy merged 1 commit into
mltframework:masterfrom
eseifert:fix-crop-planar-high-bit-depth
Oct 25, 2026
Merged

ddennedy merged 1 commit into
mltframework:masterfrom
eseifert:fix-crop-planar-high-bit-depth

Conversation

@eseifert

Copy link
Copy Markdown
Contributor

crop() only handles packed formats, so the crop filter converts yuv420p to yuv422 first, but yuv420p10, yuv444p10 and yuv422p16 were cropped as if they were packed, which garbled the image, for example with Crop: Source when exporting with pix_fmt=yuv420p10le. Convert these formats to rgba64, which keeps the bit depth.

Reproduced: a 1280x720 clip with -attach crop left=100 right=100 in a 1080x720 profile, rendered with pix_fmt=yuv420p10le, was garbled on master (PSNR 11 dB against the 8-bit render) and correct with the fix (36 dB).

crop() only handles packed formats, so the crop filter converts yuv420p to yuv422 first, but yuv420p10, yuv444p10 and yuv422p16 were cropped as if they were packed, which garbled the image, for example with Crop: Source when exporting with pix_fmt=yuv420p10le. Convert these formats to rgba64, which keeps the bit depth.
@ddennedy
ddennedy merged commit ab2f057 into mltframework:master Oct 25, 2026
15 checks passed
@ddennedy ddennedy added this to the v7.44.0 milestone Oct 25, 2026
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