From patchwork Mon Nov 14 00:59:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 1410 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.90.1 with SMTP id o1csp813419vsb; Sun, 13 Nov 2016 16:59:23 -0800 (PST) X-Received: by 10.28.144.70 with SMTP id s67mr7298213wmd.138.1479085163787; Sun, 13 Nov 2016 16:59:23 -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 b125si20812473wmd.55.2016.11.13.16.59.23; Sun, 13 Nov 2016 16:59:23 -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; 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 04F64689FB0; Mon, 14 Nov 2016 02:59:22 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-3.mx.upcmail.net (vie01a-qmta-pe01-3.mx.upcmail.net [62.179.121.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5B98C68971F for ; Mon, 14 Nov 2016 02:59:15 +0200 (EET) Received: from [172.31.218.34] (helo=vie01a-dmta-pe02-1.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1c65cA-000605-PH for ffmpeg-devel@ffmpeg.org; Mon, 14 Nov 2016 01:59:14 +0100 Received: from [172.31.216.44] (helo=vie01a-pemc-psmtp-pe02) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1c65c4-0003VO-Fw for ffmpeg-devel@ffmpeg.org; Mon, 14 Nov 2016 01:59:08 +0100 Received: from [192.168.1.3] ([80.110.110.43]) by vie01a-pemc-psmtp-pe02 with SMTP @ mailcloud.upcmail.net id 7cz61u00u0wDQrU01cz73l; Mon, 14 Nov 2016 01:59:08 +0100 X-SourceIP: 80.110.110.43 From: Carl Eugen Hoyos To: FFmpeg development discussions and patches Date: Mon, 14 Nov 2016 01:59:06 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Message-Id: <201611140159.06799.cehoyos@ag.or.at> Subject: [FFmpeg-devel] [PATCH]lavu/pixfmt: Add GRAY10 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! Attached patches are a requirement to fix two tickets. Please review, Carl Eugen From 64541da83bf85110a8cab5805a8425e632f560ee Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 14 Nov 2016 01:43:40 +0100 Subject: [PATCH 1/2] lavu/pixfmt: Add GRAY10 Based on 7471352f by Luca Barbato. --- libavutil/pixdesc.c | 21 +++++++++++++++++++++ libavutil/pixfmt.h | 3 +++ libavutil/version.h | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 73474be..f8092ef 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -560,6 +560,27 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_RGB, }, + [AV_PIX_FMT_GRAY10BE] = { + .name = "gray10be", + .nb_components = 1, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */ + }, + .flags = AV_PIX_FMT_FLAG_BE, + .alias = "y10be", + }, + [AV_PIX_FMT_GRAY10LE] = { + .name = "gray10le", + .nb_components = 1, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */ + }, + .alias = "y10le", + }, [AV_PIX_FMT_GRAY12BE] = { .name = "gray12be", .nb_components = 1, diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 9de4eaf..96860ce 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -308,6 +308,8 @@ enum AVPixelFormat { AV_PIX_FMT_GRAY12BE, ///< Y , 12bpp, big-endian AV_PIX_FMT_GRAY12LE, ///< Y , 12bpp, little-endian + AV_PIX_FMT_GRAY10BE, ///< Y , 10bpp, big-endian + AV_PIX_FMT_GRAY10LE, ///< Y , 10bpp, little-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 }; @@ -325,6 +327,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_0RGB32 AV_PIX_FMT_NE(0RGB, BGR0) #define AV_PIX_FMT_0BGR32 AV_PIX_FMT_NE(0BGR, RGB0) +#define AV_PIX_FMT_GRAY10 AV_PIX_FMT_NE(GRAY10BE, GRAY10LE) #define AV_PIX_FMT_GRAY12 AV_PIX_FMT_NE(GRAY12BE, GRAY12LE) #define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE) #define AV_PIX_FMT_YA16 AV_PIX_FMT_NE(YA16BE, YA16LE) diff --git a/libavutil/version.h b/libavutil/version.h index 6d68051..471d968 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 55 -#define LIBAVUTIL_VERSION_MINOR 39 +#define LIBAVUTIL_VERSION_MINOR 40 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \