J420 (full range YUV 4:2:0) to ARGB conversion?

243 views
Skip to first unread message

Faraz Khan

unread,
Oct 23, 2014, 10:25:30 PM10/23/14
to discuss...@googlegroups.com
Hi guys,
First of all - thanks for libyuv and putting in the awesome ArgbToJ420 function! I find myself seriously missing the reverse (J420 to ARGB). We are a screensharing utility (Screenhero) and we rely on webrtc (and libyuv) heavily. On the mac we get around this by using openGl and a fragment shader - on windows we use libyuv for the I420 to ARGB conversion. I guess we could do the same in windows but if there is a magical way to get this functionality in libyuv it'll be great. I can help (with code) on this front but I dont really understand asm :\

Thanks guys!

Frank Barchard

unread,
Oct 24, 2014, 8:49:53 PM10/24/14
to discuss-libyuv
Hi, I havent had time or strong need for the function, but it makes sense. 
The existing I420ToARGB code should easily adapt to J420ToARGB, given the new matrix values.
Mainly need to work out the coefficients.
We're really trying for jpeg compatible color space, hence the J, so the math is derived from jccolor.c

row_common.cc has comments about the J420 math:
// JPeg uses a variation on BT.601-1 full range
// y =  0.29900 * r + 0.58700 * g + 0.11400 * b
// u = -0.16874 * r - 0.33126 * g + 0.50000 * b  + center
// v =  0.50000 * r - 0.41869 * g - 0.08131 * b  + center
So the opposite would be in jdcolor.c
 *  R = Y                + 1.40200 * Cr
 *  G = Y - 0.34414 * Cb - 0.71414 * Cr
 *  B = Y + 1.77200 * Cb


--
You received this message because you are subscribed to the Google Groups "discuss-libyuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-libyu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Faraz Khan

unread,
Oct 25, 2014, 3:40:00 PM10/25/14
to discuss...@googlegroups.com
Frank - thanks! I think thats a good start. 

I'll give it a shot and let you know how that fares! I'm using the exact same matrix coeffs in my fragment shader (on the mac).



--
You received this message because you are subscribed to a topic in the Google Groups "discuss-libyuv" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-libyuv/zxy-7ws5qGE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-libyu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

--
Faraz Khan
Simple Collaboration Screensharing
Reply all
Reply to author
Forward
0 new messages