Repository navigation
fix(encoder): only convert RGB input where the driver sites chroma as the stream implies - #49
Merged
Merged
Conversation
… the stream implies Streams don't signal a chroma location, so players assume type 0 (cosited left, midway vertically). A driver that couldn't site chroma there got the other offset, shifting color edges without the stream saying so. Now it gets no RGB input, and callers convert instead. RADV supports type 0.
1 task
Owner
|
Awesome, good find! This lead to some other smaller issues, namely that we never signal that we set the type of the chroma location so players presumably default to type 0, but also that the shader didn't actually convert using type 0 (using 3x2 with I pushed those fixes on top of your PR, PSNR went up quite a bit in my tests: Pretty much on par with ffmpeg, or even slightly better. |
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.
Small follow-up to #46, came out of @repparw's review on hgaiser/moonshine#254.
With 4:2:0 there's one color sample per 2×2 block, and the decoder has to guess where in the block it was taken. Our streams don't say, so decoders should fall back to the usual default (left pixel, between the two rows).
session_infoasks the driver for that default, but if a driver can't do it, it quietly picks a different spot, and colors could end up half a pixel off from where the decoder draws them.This makes it refuse RGB input in that case instead, so callers just use the shader converter like before (Moonshine already falls back when the RGB encoder can't be built).