Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Registered User
Join Date: Jul 2019
Posts: 42
|
YUV to RGB via numpy?
Is there a lossless way to convert YUV to RGB (with support for both sub-sampled YUV and not).
I'm trying to add YUV support to VSGAN, with no success. The main issue I'm having is that with sub-sampled YUV, (e.g. 4:2:0). The Y channel is obviously full resolution, however U and V channels arent. This causes np.dstack to freak out about it, and I haven't been able to find a way to losslessly convert from sub-sampled 4:2:0 to 4:4:4 in a no-interpolation way. Any advice would be great, as I'd love to be able to use VSGAN on YUV input's (which would be the majority of data I would be sending through VapourSynth, e.g. DVD's, Blu-ray's). |
![]() |
![]() |
![]() |
#2 | Link | |
I'm Siri
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,509
|
Quote:
but seriously, it makes absolutely no sense to request a lossless conversion since you will be performing some lossy resampling (SRGAN) afterwards anyways. the composite function SRGAN(YUVtoRGB(x)) is no longer lossless even if YUVtoRGB(x) is lossless
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated |
|
![]() |
![]() |
![]() |
#3 | Link | |
Registered User
Join Date: Jul 2019
Posts: 42
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 | Link |
I'm Siri
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,509
|
It makes no difference, SRGAN is unaware of the untouched data and has no specialization for data that went thru a lossless YUVtoRGB conversion
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated |
![]() |
![]() |
![]() |
#6 | Link |
Registered User
Join Date: May 2011
Posts: 180
|
I come back to this, because I thought you asked about something else. You want just simple YUV to RGB to fill RGB planes?
https://forum.videohelp.com/threads/...e2#post2575815 rgb was obtained manually to show it is the same as using vapoursynth Point resize function (rgb2). Is it a problem for SRGAN to extrapolate from values obtained like that (YUV420V to RGB)? So simple: Code:
rgb = core.resize.Point(YUV420clip, format = vs.RGB24, matrix_in_s = '709') Last edited by _Al_; 1st March 2021 at 20:46. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|