Warn when a filter or output setting reduces bit depth on high-bit-depth sources#47
Merged
Merged
Conversation
…th sources Adds inline advisory banners so users know when enabling a pass — or picking an output option — will silently reduce colour precision on a >8-bit source: - Filter pass: schema gains an optional `maxBitDepth`. When set and the source exceeds it, the worker down-converts to that depth for the pass and back (a lossy round-trip), so the pass settings panel shows a warning. DeScratch is the only such filter today (8-bit only), so its schema declares maxBitDepth 8. (IVTC/VFM is lossless via clip2; f3kdb/deblock/cas/etc. handle 8–16 bit.) - Output: choosing a chroma-subsampling conversion (4:2:0/4:2:2) forces 8-bit output even for a 10-bit source, so the encoding settings show a warning next to the dropdown; "Original" preserves the source's bit depth. Implementation: - utils/pixel_format.dart: pixelFormatBitDepth() parses ffprobe pix_fmt strings (yuv422p10le -> 10, etc.); filterBitDepthWarning()/chromaConversionBitDepthWarning() are pure decision helpers, fully unit-tested. - widgets/warning_banner.dart: extracted the repeated advisory-banner widget; the existing OpenCL warning now reuses it too. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #46. Adds inline advisory banners so users know when enabling a pass — or picking an output option — will silently reduce colour precision on a >8-bit source (e.g. 10-bit ProRes 422).
Cases covered
maxBitDepth. When set and the source exceeds it, the worker down-converts to that depth for the pass and restores it afterward (a lossy round-trip), so the pass settings panel shows a warning. DeScratch is the only such filter today (8-bit only,YV12/YV16/YV24), so its schema declaresmaxBitDepth: 8. IVTC/VFM is lossless now (clip2, Fix IVTC failure on >8-bit sources (e.g. 10-bit ProRes 422) #46); f3kdb/deblock/cas all handle 8–16 bit natively.Implementation
utils/pixel_format.dartpixelFormatBitDepth()— parses ffprobepix_fmtstrings (yuv422p10le→ 10,p010le→ 10,rgb48le→ 16, unknown → 8 so no spurious warnings).filterBitDepthWarning()/chromaConversionBitDepthWarning()— pure decision helpers returning the message or null.widgets/warning_banner.dart— extracted the repeated advisory-banner widget (icon + text in the theme error-container style); the existing OpenCL-unavailable warning now reuses it.pass_settings_container.dart/settings_dialog.dart— render aWarningBannerwhen the respective helper returns a message.Tests
test/pixel_format_test.dart— 17 unit tests covering the parser (8/10/12/16-bit formats, null/unknown fallback, case/whitespace) and both decision helpers (enabled/disabled, no ceiling, source fits, 8-bit source, unknown format, converting vs Original). The UI widgets are thin wrappers over these tested pure functions.Generated
.g.dartis gitignored and regenerated by CI'sbuild_runner, so only the model/JSON source changes are committed.🤖 Generated with Claude Code