diff options
author | Philip Langdale <philipl@overt.org> | 2019-05-07 06:39:39 +0300 |
---|---|---|
committer | Philip Langdale <philipl@overt.org> | 2019-05-12 17:51:02 +0300 |
commit | 5de4f1d871d60886b9630531fa8c34cad13cc9dd (patch) | |
tree | 811d11d729903ee3659592a006ed0087633fbf38 /libavutil/pixdesc.c | |
parent | 7c6f2bfdb25ccadf6ba82dc72eaad1b692122d9a (diff) |
avutil: Add NV24 and NV42 pixel formats
These are the 4:4:4 variants of the semi-planar NV12/NV21 formats.
These formats are not used much, so we've never had a reason to add
them until now. VDPAU recently added support HEVC 4:4:4 content
and when you use the OpenGL interop, the returned surfaces are in
NV24 format, so we need the pixel format for media players, even
if there's no direct use within ffmpeg.
Separately, there are apparently webcams that use NV24, but I've
never seen one.
Diffstat (limited to 'libavutil/pixdesc.c')
-rw-r--r-- | libavutil/pixdesc.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index fe38344d73..b97b0665b0 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -2320,6 +2320,30 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA, }, + [AV_PIX_FMT_NV24] = { + .name = "nv24", + .nb_components = 3, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */ + { 1, 2, 0, 0, 8, 1, 7, 1 }, /* U */ + { 1, 2, 1, 0, 8, 1, 7, 2 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR, + }, + [AV_PIX_FMT_NV42] = { + .name = "nv42", + .nb_components = 3, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */ + { 1, 2, 1, 0, 8, 1, 7, 2 }, /* U */ + { 1, 2, 0, 0, 8, 1, 7, 1 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR, + }, }; #if FF_API_PLUS1_MINUS1 FF_ENABLE_DEPRECATION_WARNINGS |