<div dir="ltr"><div class="im" style="font-family:arial,sans-serif;font-size:13px">Hi Carl, </div><div class="im" style="font-family:arial,sans-serif;font-size:13px"><br></div><div class="im" style="font-family:arial,sans-serif;font-size:13px">
thanks for your answers. Please see my remarks.</div><div class="im" style="font-family:arial,sans-serif;font-size:13px"><br></div><div class="im" style="font-family:arial,sans-serif;font-size:13px">>> Assume I have YUV422 BT 601 input and I want my output<br>
>> to be YUV444 FullRange. Is this possible without telling<br>>> SwsContext that my input source is BT 601?<br><br></div><span style="font-family:arial,sans-serif;font-size:13px">> How is this supposed to work?</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">> (Assuming libswscale is a black box and without discussing</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">> its internals: How would it know what you want if you</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">>don't set the appropriate options?)</span><div><br></div><div>Yes, you are right. I think the user has to specify what the input color space is. Its quite logical actually.<br style="font-family:arial,sans-serif;font-size:13px">
<div class="im" style="font-family:arial,sans-serif;font-size:13px"><br>>> Also, does swscale first transform the input color<br>>> space to XYZ and then transform it further into the<br>>> target color space?<br>
<br></div><span style="font-family:arial,sans-serif;font-size:13px">> (Sorry if I misunderstand XYZ)</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">> This sounds very slow, some conversions use yuv420p as</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">> intermediate format (this is what is generally needed</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">> for video). It is possible to use yuv444p instead, at</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">> least for some conversions.</span></div><div><br></div><div>If yuv420p is used as an intermediate format, wouldnt that result into heavy information loss? Assume I want</div>
<div>to convert from rgb fullrange to yuv444 BT709. If the intermediate color space would be yuv420, my chroma samples</div><div>would be quarted and then again interpolated. Thats not acceptable I guess. Thats why I was wondering if XYZ is</div>
<div>used as intermediate format as it can store all color spaces that exist.</div><div><div class="im" style="font-family:arial,sans-serif;font-size:13px"><br>>> And why is there no yuv2rgb function but only a<br>>> rgb2yuv function?<br>
<br></div><span style="font-family:arial,sans-serif;font-size:13px">> I believe many such functions exist.</span></div><div><br></div><div>Couldn't find them. But I must dig further into the source code. For the beginning, it would be great to get high level</div>
<div>overview over how swscale is working.<br><div class="im" style="font-family:arial,sans-serif;font-size:13px"><br>>> If I want my output color space to be rgb, such a<br>>> function would be needed or not? <br>
<br></div><span style="font-family:arial,sans-serif;font-size:13px">> Does yuv->rgb conversion not work for you?</span><br style="font-family:arial,sans-serif;font-size:13px"><br>It does. Sorry for the missunderstanding. Everything works fine. I do 10bit and 12bit conversion with yuv2yuv, rgb2yuv, yuv2rgb etc.</div>
<div>The color space is my big question mark.</div><div><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">> I cannot answer some of your questions: If no 16 bit</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">> path exist for a conversion you need, it should be</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">> possible to add it but currently your information</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">> about what you need is very vague.</span></div><div><br></div><div>This is something I would like to know from the swscale developer. Are there 16bit paths or is the conversion done via 8bit? This would</div>
<div>be a big loss.<br><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">> Carl Eugen</span><br><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Thanks</span></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 18, 2014 at 7:39 PM, Carl Eugen Hoyos <span dir="ltr"><<a href="mailto:cehoyos@ag.or.at" target="_blank">cehoyos@ag.or.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">Markus Pfundstein <markuspfundstein86@...> writes:<br>
<br>
> Assume I have YUV422 BT 601 input and I want my output<br>
> to be YUV444 FullRange. Is this possible without telling<br>
> SwsContext that my input source is BT 601?<br>
<br>
</div>How is this supposed to work?<br>
(Assuming libswscale is a black box and without discussing<br>
its internals: How would it know what you want if you<br>
don't set the appropriate options?)<br>
<div class=""><br>
> Also, does swscale first transform the input color<br>
> space to XYZ and then transform it further into the<br>
> target color space?<br>
<br>
</div>(Sorry if I misunderstand XYZ)<br>
This sounds very slow, some conversions use yuv420p as<br>
intermediate format (this is what is generally needed<br>
for video). It is possible to use yuv444p instead, at<br>
least for some conversions.<br>
<div class=""><br>
> And why is there no yuv2rgb function but only a<br>
> rgb2yuv function?<br>
<br>
</div>I believe many such functions exist.<br>
<div class=""><br>
> If I want my output color space to be rgb, such a<br>
> function would be needed or not? <br>
<br>
</div>Does yuv->rgb conversion not work for you?<br>
<br>
I cannot answer some of your questions: If no 16 bit<br>
path exist for a conversion you need, it should be<br>
possible to add it but currently your information<br>
about what you need is very vague.<br>
<br>
Carl Eugen<br>
<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</blockquote></div><br></div>