[FFmpeg-devel] [PATCH 1/5] avutil: Add YUV444P10_LSB and YUV444P12_LSB pixel formats

Timo Rothenpieler timo at rothenpieler.org
Mon Oct 8 11:40:33 EEST 2018


On 08/10/2018 09:24, Marton Balint wrote:
> 
> 
> On Sun, 7 Oct 2018, Philip Langdale wrote:
> 
>> Currently, ffmpeg defines a set of YUV444P formats for use where
>> the bits-per-pixel are between 8 and 16 bits. In these formats,
>> the bits are packed in the MSBs of the 16 bits of available storage.
>>
>> On the other hand, all the hardware vendors have defined their
>> equivalent formats with the bits packed in the LSBs, which has the
>> virtue of making the memory layouts compatible with being treated
>> as full 16 bit values (which is also why P010 is defined this way).
>>
>> So, to be able to use these hardware compatible formats, we need
>> definitions for them in ffmpeg. Right now, I need this for nvdec,
>> but Vulkan also uses the same format definitions.
> 
> MSB and LSB is mixed up as far as I understand.
> 
> In classic formats ffmpeg stores data in low bits, the least significant 
> bits of 16 bit values.
> 
> In P010 and so on the docs says "zeros are in the low bits", therefore 
> data is in the high bits, which are the most significant ones.
> 
> Am I missing something?
> 
> Otherwise, I dont't disagree that this is the 
> fastest/easiest/least-error-prone way to add support for this, but it 
> sure feels like JUVJ formats all over again.
> 

Yes, the padding is in the LSB, data in MSB. _MSB is probably the better 
name then.

I don't think it's YUVJ all over again, as it was the exact same bit 
layout than normal YUV, while this one is actually different.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4538 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20181008/9a8f78a7/attachment.bin>


More information about the ffmpeg-devel mailing list