[FFmpeg-devel] [PATCH 1/2] avutil: add P010 pixel format

Hendrik Leppkes h.leppkes at gmail.com
Thu Jan 7 13:31:16 CET 2016


On Thu, Jan 7, 2016 at 1:26 PM, wm4 <nfxjfg at googlemail.com> wrote:
> On Thu,  7 Jan 2016 12:11:21 +0100
> Hendrik Leppkes <h.leppkes at gmail.com> wrote:
>
>> P010 is the 10-bit variant of NV12 (planar luma, packed chroma), using two
>> bytes per component to store 10-bit data plus 6-bit zeroes in the LSBs.
>> ---
>>  libavutil/pixdesc.c | 24 ++++++++++++++++++++++++
>>  libavutil/pixfmt.h  |  4 ++++
>>  2 files changed, 28 insertions(+)
>>
>> diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
>> index 72d0470..58833cf 100644
>> --- a/libavutil/pixdesc.c
>> +++ b/libavutil/pixdesc.c
>> @@ -2004,6 +2004,30 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>>          },
>>          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_ALPHA,
>>      },
>> +    [AV_PIX_FMT_P010LE] = {
>> +        .name = "p010le",
>> +        .nb_components = 3,
>> +        .log2_chroma_w = 1,
>> +        .log2_chroma_h = 1,
>> +        .comp = {
>> +            { 0, 2, 0, 6, 10, 1, 9, 1 },        /* Y */
>> +            { 1, 4, 0, 6, 10, 3, 9, 1 },        /* U */
>> +            { 1, 4, 2, 6, 10, 3, 9, 3 },        /* V */
>
> So just to clarify: each component is represented like with other 10
> bit pixel formats (say, AV_PIX_FMT_YUV444P10LE), except the data is
> already shifted left by 6?
>
> If so, then this makes sense to me.
>

Yes, the data is in the MSBs with trailing zeroes, contrary to our
native high bitdepths formats which have leading zeros.

- Hendrik


More information about the ffmpeg-devel mailing list