[FFmpeg-devel] [PATCH v1 1/9] lavu/pix_fmt: add P012 pixel format

Mark Thompson sw at jkqxz.net
Mon Jun 29 00:01:28 EEST 2020


On 19/06/2020 08:21, Hendrik Leppkes wrote:
> On Fri, Jun 19, 2020 at 3:53 AM Fei Wang <fei.w.wang at intel.com> wrote:
>>
>> P012 is 12bit planner format which is similar to NV12. It using two
>> bytes to store 12bit valid data and 4bit zero in LSB. This format
>> will be used for hardware decode/encode in VAAPI and QSV.
>>
> 
> P012 is not required, you can just use P016. All these P*  formats
> have the advantage of being aligned to MSB, which means the bitdepth
> does not matter for their layout.
> Instead you can use P016 and if you must know, look at a bitdepth
> value separately.

Tracking it separately does not seem fun - it looks to me like it would require adding a new bit depth field to AVFrame.

FFmpeg has always used pixfmt as defining both the memory layout and which bits are used in that (so, for example, ARGB and 0RGB are not the same thing), unlike most of the graphics APIs which tend to 
define those two separately.

- Mark


More information about the ffmpeg-devel mailing list