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.


Go Back   Doom9's Forum > Programming and Hacking > Development

Thread Tools Search this Thread Display Modes
Old 11th May 2020, 15:51   #1  |  Link
Registered User
wswartzendruber's Avatar
Join Date: Feb 2008
Posts: 57
How Is YUV410P10LE Encoded?

ADDENDUM: 420, not 410

I'm trying to figure out how YUV420P10LE is encoded. I surmise that first there are the luminance values, one for each pixel. Next, there are the Cb values, one for every four pixels. Then, there are the Cr values, also one for every four pixels.

Y, I assume, has 0 to represent the darkest amount of light and 1023 to represent the most amount of light. But how in the world are Cb and Cr mapped onto the color plane? I wasn't able to figure this out. Are they two's compliment?

I ultimately want to convert to and from RGB, given the appropriate colorspace constants.

Last edited by wswartzendruber; 11th May 2020 at 22:08.
wswartzendruber is offline   Reply With Quote
Old 12th May 2020, 19:25   #2  |  Link
Registered User
Join Date: Mar 2015
Posts: 751
Hope this will help:
yes it is plane by plane as you suggested.
1) get uint16 values
2) upscale Cb and Cr to picture dimensions (2x wide and 2x high)
3) conversion to RGB
Y is unsigned value with range 0 to 1023 (0 may be darkest or not - depends on full range flag)
subtract 512 from Cb/Cr to get signed value (useful signed range -512 to 511)
Refer to formulas here http://www.vapoursynth.com/doc/functions/resize.html (bottom of page "pixel range")
shekh is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 03:27.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.