From patchwork Tue Nov 22 03:21:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Langdale X-Patchwork-Id: 1523 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.90.1 with SMTP id o1csp1973841vsb; Mon, 21 Nov 2016 19:21:56 -0800 (PST) X-Received: by 10.28.54.97 with SMTP id d94mr333654wma.28.1479784916101; Mon, 21 Nov 2016 19:21:56 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id qi6si23395637wjb.175.2016.11.21.19.21.55; Mon, 21 Nov 2016 19:21:56 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@overt.org; dkim=neutral (body hash did not verify) header.i=@overt.org; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 10128680D3C; Tue, 22 Nov 2016 05:21:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from so254-29.mailgun.net (so254-29.mailgun.net [198.61.254.29]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B4CD0680C81 for ; Tue, 22 Nov 2016 05:21:34 +0200 (EET) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=overt.org; q=dns/txt; s=k1; t=1479784896; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=a4jojzljkQuXfZ7lRYfkMa5KvYfEkA0v9dCmWEvBRqg=; b=oSTwZ3mvJeqh0X+oL4RO+Tp3hBFDWQHtU8zrr1atLuaak0qxVlPEPFHIm0vfsoKaol+XdhaI viLqB8gZTZ3q6/i809tpKG0axzSrvfTs7sT7LnRj6OepCYVo5LiLddFGQDZ0PXqdFtsiMvGW 7aPgP0htLGuZFR9pV7UyavroqIY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=overt.org; s=k1; q=dns; h=Sender: From: To: Cc: Subject: Date: Message-Id: In-Reply-To: References; b=lLHaxgJvIjQ9auW2OHzdf+d98Jt+VTIA4MVmSpJjhTvFMxXcuB1H17CZ46EyPSmblQ5tk6 /eD8KVu50yDSM3+NEvbrzqJn3gIhec8QmPWx31wKrOMK8z/rq/JesZU6Cr2OCAPtYef6Mx0r EfG6zmuKRxq0nlpoTw9DJEFmtzVoU= X-Mailgun-Sending-Ip: 198.61.254.29 X-Mailgun-Sid: WyIyM2Q3MCIsICJmZm1wZWctZGV2ZWxAZmZtcGVnLm9yZyIsICI0YTg5NjEiXQ== Received: from mail.overt.org (155.208.178.107.bc.googleusercontent.com [107.178.208.155]) by mxa.mailgun.org with ESMTP id 5833b9c0.7fbb2c044340-smtp-out-n01; Tue, 22 Nov 2016 03:21:36 -0000 (UTC) Received: from authenticated-user (mail.overt.org [107.178.208.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.overt.org (Postfix) with ESMTPSA id 816B368193; Tue, 22 Nov 2016 03:21:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1479784895; bh=eL9n1wNNpqi6Jn5yHF9u3K1+BBMmZDq9NjNzvLd3ogc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BvIoAMw62kdEcS8tfYRBHj/UZUtUWNmuTM7piSubZCgU2aHKCsiTONWaF0ZbMxj2Z o4g7V+RlEjXEbGouDvK9M1FY5jQLca22kEtcA7uPwJlWvBU0XJldwIHat23x6LPgpa naAYlJiMWGGjj8W7jNNDN+11j0+2V2fy7zwgE825eJMOnpXMmAcmq97ULVJqb/SY45 wERWahjzePIhk88p1HYOIlLpa0smUm8VJmp6GX9UB20cyo3vBcbQcfOiq7gv2cnTn5 6+96x4fSCRvcmrKDEkdK4WDNsciQCY/XtgVnn+YbWr3cOvqvgJ7mp3+Vg9MB2OI12b 7U/+XDbG18P1Q== From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Date: Mon, 21 Nov 2016 19:21:30 -0800 Message-Id: <20161122032131.8663-2-philipl@overt.org> In-Reply-To: <20161122032131.8663-1-philipl@overt.org> References: <20161122032131.8663-1-philipl@overt.org> Subject: [FFmpeg-devel] [PATCH 1/2] avutil: add P016 pixel format X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Philip Langdale MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" P016 is the 16-bit variant of NV12 (planar luma, packed chroma), using two bytes per component. It may, and in fact is most likely to, be used in situations where there are less than 16 bits of data. It is the responsibility of the writer to zero out any unused LSBs. Signed-off-by: Philip Langdale --- libavutil/pixdesc.c | 24 ++++++++++++++++++++++++ libavutil/pixfmt.h | 4 ++++ libavutil/version.h | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index f8092ef..3b9c45d 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -2078,6 +2078,30 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, }, + [AV_PIX_FMT_P016LE] = { + .name = "p016le", + .nb_components = 3, + .log2_chroma_w = 1, + .log2_chroma_h = 1, + .comp = { + { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */ + { 1, 4, 0, 0, 16, 3, 15, 1 }, /* U */ + { 1, 4, 2, 0, 16, 3, 15, 3 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR, + }, + [AV_PIX_FMT_P016BE] = { + .name = "p016be", + .nb_components = 3, + .log2_chroma_w = 1, + .log2_chroma_h = 1, + .comp = { + { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */ + { 1, 4, 0, 0, 16, 3, 15, 1 }, /* U */ + { 1, 4, 2, 0, 16, 3, 15, 3 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, + }, [AV_PIX_FMT_GBRAP12LE] = { .name = "gbrap12le", .nb_components = 4, diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 96860ce..dfb1b11 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -311,6 +311,9 @@ enum AVPixelFormat { AV_PIX_FMT_GRAY10BE, ///< Y , 10bpp, big-endian AV_PIX_FMT_GRAY10LE, ///< Y , 10bpp, little-endian + AV_PIX_FMT_P016LE, ///< like NV12, with 16bpp per component, little-endian + AV_PIX_FMT_P016BE, ///< like NV12, with 16bpp per component, big-endian + AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions }; @@ -389,6 +392,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE) #define AV_PIX_FMT_AYUV64 AV_PIX_FMT_NE(AYUV64BE, AYUV64LE) #define AV_PIX_FMT_P010 AV_PIX_FMT_NE(P010BE, P010LE) +#define AV_PIX_FMT_P016 AV_PIX_FMT_NE(P016BE, P016LE) /** * Chromaticity coordinates of the source primaries. diff --git a/libavutil/version.h b/libavutil/version.h index 471d968..57f221c 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 55 -#define LIBAVUTIL_VERSION_MINOR 40 +#define LIBAVUTIL_VERSION_MINOR 41 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \