diff mbox

[FFmpeg-devel] lavu/pixfmt: Add GRAY10

Message ID 201611140159.06799.cehoyos@ag.or.at
State Accepted
Commit 3f1b5ca22ec372bc6d4a45694e3070b8f5d05ad3
Headers show

Commit Message

Carl Eugen Hoyos Nov. 14, 2016, 12:59 a.m. UTC
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 <cehoyos@ag.or.at>
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(-)

Comments

Michael Niedermayer Nov. 14, 2016, 2:32 a.m. UTC | #1
On Mon, Nov 14, 2016 at 01:59:06AM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patches are a requirement to fix two tickets.
> 
> Please review, Carl Eugen

patches LGTM

thx

[...]
Carl Eugen Hoyos Nov. 14, 2016, 10:29 a.m. UTC | #2
2016-11-14 3:32 GMT+01:00 Michael Niedermayer <michael@niedermayer.cc>:
> On Mon, Nov 14, 2016 at 01:59:06AM +0100, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patches are a requirement to fix two tickets.
>>
>> Please review, Carl Eugen
>
> patches LGTM

Patches applied.

Thank you, Carl Eugen
diff mbox

Patch

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, \