Как пиксели на самом деле отображаются на дисплее

438
Fredrik Pihl

Я трачу много времени на просмотр raw-видео в формате YCbCr. Начали думать о том, что действительно отображается на дисплее и как пиксели оказываются там.

Никакой дисплей не может обрабатывать YCbCr-данные, поэтому я думаю, что все где-то конвертируется в RGB. Тем не менее, YCbCr-> RGB - сложная задача, см., Например, http://www.fourcc.org/fccyvrgb.php

Если я выполняю преобразование YCbCr- в RGB, гарантирую ли я, что отображаемые значения пикселов совпадают?

Если не считать аппаратно-откалиброванного Eizo-дисплея, подобного показанному здесь:

http://www.eizo.com/global/products/coloredge/

Как пиксели на самом деле отображаются на дисплее

Есть ли способ иметь как можно больше контроля над «конвейером» на дисплее (т.е. мои пиксели не преобразуются в пути), я думаю, возможно, nvidia / gpu / opengl и перемещать все как можно ближе к HW, как возможный; тогда, по крайней мере, для моей графической карты я знаю, на что смотрю.

Существует ли RGB-формат, который является родным для видеокарты и не требует дальнейшего преобразования? YCbCr - 8bpp, и я думаю о 32-битном RGB 4: 4: 4.

Я в основном использую Linux-систему, если это имеет значение. В настоящее время я использую http://www.libsdl.org/ Там также http://directfb.org/, но я еще не исследовал этот путь.

Или, может быть, все это просто глупо и параноидально :-)

1
Пожалуйста, не вандализируйте ваши собственные сообщения. Я закрыл вопрос на данный момент - это должно быть хорошо. Я не склонен удалять его, потому что кто-то действительно нашел время, чтобы ответить на ваши вопросы и также получил голоса. slhck 10 лет назад 0

1 ответ на вопрос

3
gronostaj

That's a lot of questions, I'll try to answer at least some of them.

No display can handle YCbCr-data so I guess everything gets converted to RGB somewhere.

All displays use RGB. On LCDs each pixel consists of three subpixels in three basic colors. So you're right, everything must be converted to RGB to be displayed.

If I do the YCbCr- to RGB-conversion, am I guaranteed that the pixel-values I have are the ones being displayed?

It depends what you mean. You are guaranteed that exact results of the conversion are displayed. So it depends on the results of conversion and those depend on the gamma you're using.

is there a way to have as much control as possible over the "pipeline" to the display (i.e. my pixels do not get converted on the way) I'm thinking perhaps nvidia/gpu/opengl and moving everything as close to the HW as possible; then for my graphic-card at least I know what I'm looking at.

Once the image is converted to RGB, it's not modified anymore (unless you use f.lux or similar software). It doesn't really matter if it's closer to hardware or not, it's just a bunch of pixels and nothing will modify them after conversion to RGB (unless you ask something to, like with the mentioned f.lux, color correction software or video editing programs that can apply color filters).

YCbCr is 8bpp and I'm thinking 32-bit RGB 4:4:4.

I think you're mixing few things up or I don't get what you mean. First, 32-bit RGB can't be 4:4:4, because you can't equally split 32 bits to 3 color channels. (10 bits for R, 11 bits for G, 11 bits for B?) 32-bit RGB actually consists of three 8-bit color channels and one 8-bit transparency channel. Videos don't have transparency, so they work with 24-bit RGB. (8 bits for each channel)

I don't know how YCbCr is saved in digital format, but I'm sure it's not 8-bit, at least assuming we're talking about total size of a pixel. (if you mean 8-bit color channels, then it's exactly as much as in RGB) 8-bit pixels could hold up to 256 colors. 24-bit RGB is over 16 million colors.

Is there a RGB-format that is native for graphics card and that doesn't require any further conversion?

So you want raw, uncompressed RGB pixels? Well, there are such picture and video formats, but uncompressed videos take up really A LOT of space. Let's do a quick calculation for a 24-bit 24fps 1080p video:

3B * 1920px * 1080px * 24fps = 149299200B 

So every second of raw uncompressed 1080p video weights over 140 MB. It means you could have up to 5 and a half minute of video on an industry-standard Blu-Ray disc. Not really a good deal I think ;)