Full Range Conversion

687 views
Skip to first unread message

Seth Willits

unread,
Nov 18, 2012, 2:44:12 PM11/18/12
to pixf...@googlegroups.com
I was looking around the net and came across PixFC. I have a need to go from RGB to YUV full range using the Rec 709 matrix, so I was looking at what PixFC does and I noticed it does "full range", 601, or 709 conversions. Based on what I can tell (I haven't looked at it for too long), according to rgb_8bit_to_yuv_8bit_coef in common.c, the "full range" conversion uses 601's matrix, not 709's, and it's presented in such a way that it suggests 601 vs 709 isn't a factor, when it is.

I'm no expert, but according to everything I've read, the matrix for a 709 full range conversion would be

 0.2126      0.7152      0.0722
-0.114572   -0.385428    0.5
 0.5        -0.454153   -0.045847

(The wikipedia page has this info as well, though not explicitly. http://en.wikipedia.org/wiki/YCbCr  You'd have to do the math to get the full matrix from the Kb Kr values in the 709 section.)


Pix FC

unread,
Nov 19, 2012, 5:48:37 AM11/19/12
to pixf...@googlegroups.com
Hi Seth,
You are absolutely correct: 1)  the full range equations used in pixfc are indeed based off rec601 (the ones you provided are correct and produce full range YUV based on rec.709), and 2), it is an oversight and pixfc shouldnt make it seem like full range is independent from either 601 or 709.

I learnt more and more about colorspaces as I was writting pixfc and I came to that realisation well into the process, but I am yet to address it. Now that I have added 10-bit YUV and RGB support, I have even more designing to do, and i am still thinking about how to integrate the following two:
- full range needs to be split into FR_601 and FR_709, for all conversions.
- right now pixfc is hardcoded to regard RGB as using computer range (aka full range) and YUV as using either computer or video range depending on the equations used. I decided to do this because I rarely (more like never) came across 8bit RGB image using studio range. However, now that I have implemented 10bit RGB, I understand both studio and video ranges are used.

Sorry to hear the GPL will get in your way. Unfortunately, we have no plans to change the license.

Anyway, thanks for bringing this to my attention. I now have a number of features on my todo list and I ll get to them in the next releases.
Frank
Reply all
Reply to author
Forward
0 new messages