GNOME Bugzilla – Bug 780189
video-format: Conversion from I420_10LE/BE, I420_12LE/BE, A420_10LE/BE to BGRA/RGBA creates corrupted output
Last modified: 2018-11-03 11:56:19 UTC
See e.g. gst-launch-1.0 videotestsrc ! "video/x-raw,format=I420_10LE" ! videoconvert ! "video/x-raw,format=BGRA" ! glimagesink Same with I420_10BE, I420_12BE/LE. I422_* and Y444_* and their alpha variants work fine. Conversion to AYUV, I420, AYUV64, ARGB64 also works fine.
I can't see what's wrong. Then I set all YUV to 0 in the pack/unpack functions, and I still see banded green and darker green, where I'd expect a full solid color. All I can see grepping for I420_10LE in -base looks OK, so I'm out of ideas right now :/
In any case, the UV on the first row (maybe two, hard to say) looks correct (and the Y is wholly correct). I can't see relevant differences with I422_10LE (ie, not to do with the extra subsampling). So it looks like some possible stride bug as the first line's OK.
Created attachment 350416 [details] [review] I420_10LE hack This fixes it. However, it only points to a bug elsewhere which gets "undone" by the patch. It looks like something somewhere assumes the wrong subsampling for those 4 formats.
I've reached video_chroma_up_v2_u16, which I think may be incorrect. It's called when using SUB420 but not SUB422 (and I hacked up everywhere to pretend 422 here, and 420 elsewhere to make sure this is the call which breaks). That's an orc function, which it impenetrable. ORC_DEBUG=backup doesn't fix (the backup function is impenetrable too).
Oh, actually, I was looking at video_orc_chroma_up_v2_u16 in the C file, but it's generated, which explains the *erf*. The one in the orc file looks very much nicer (though still obscure right now) :)
And AFAICT it's the exact match for the u8 version, which seems fine since I420 works. So I'm lost again for now.
One thing we notice is that I420_10LE -> I420 works, also I420_10LE -> ARGB64 works too. It's really something from I420_10LE -> ARGB that breaks.
*** Bug 785013 has been marked as a duplicate of this bug. ***
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/350.