diff mbox

[FFmpeg-devel] lavc/libx265: Add gray10 and gray12 encoding support

Message ID 201702230030.10455.cehoyos@ag.or.at
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Feb. 22, 2017, 11:30 p.m. UTC
Hi!

Attached patch adds gray10 and gray12 native endian encoding support 
to libx265.

Please comment, Carl Eugen
From f3ce6a1bfc6a5d3201541d51fc4547b1b0b555f8 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos@ag.or.at>
Date: Thu, 23 Feb 2017 00:28:22 +0100
Subject: [PATCH] lavc/libx265: Add gray10 and gray12 encoding support.

---
 libavcodec/libx265.c |    5 +++++
 1 file changed, 5 insertions(+)

Comments

Paul B Mahol Feb. 23, 2017, 7:06 a.m. UTC | #1
On 2/23/17, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
> Hi!
>
> Attached patch adds gray10 and gray12 native endian encoding support
> to libx265.
>
> Please comment, Carl Eugen
>

Does this get decoded with native hevc?
Carl Eugen Hoyos Feb. 23, 2017, 1:24 p.m. UTC | #2
2017-02-23 8:06 GMT+01:00 Paul B Mahol <onemda@gmail.com>:
> On 2/23/17, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:

>> Attached patch adds gray10 and gray12 native endian
>> encoding support to libx265.

> Does this get decoded with native hevc?

Yes, which sample fails for you?

Carl Eugen
Paul B Mahol Feb. 23, 2017, 1:55 p.m. UTC | #3
On 2/23/17, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
> 2017-02-23 8:06 GMT+01:00 Paul B Mahol <onemda@gmail.com>:
>> On 2/23/17, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
>
>>> Attached patch adds gray10 and gray12 native endian
>>> encoding support to libx265.
>
>> Does this get decoded with native hevc?
>
> Yes, which sample fails for you?

I haven't tried any.
Carl Eugen Hoyos March 9, 2017, 10:46 p.m. UTC | #4
2017-02-23 0:30 GMT+01:00 Carl Eugen Hoyos <cehoyos@ag.or.at>:

> Attached patch adds gray10 and gray12 native endian encoding support
> to libx265.

Tested and applied.

Carl Eugen
diff mbox

Patch

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index f9b287e..5ca937a 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -167,6 +167,8 @@  static av_cold int libx265_encode_init(AVCodecContext *avctx)
         ctx->params->internalCsp = X265_CSP_I444;
         break;
     case AV_PIX_FMT_GRAY8:
+    case AV_PIX_FMT_GRAY10:
+    case AV_PIX_FMT_GRAY12:
         if (ctx->api->api_build_number < 85) {
             av_log(avctx, AV_LOG_ERROR,
                    "libx265 version is %d, must be at least 85 for gray encoding.\n",
@@ -349,6 +351,7 @@  static const enum AVPixelFormat x265_csp_ten[] = {
     AV_PIX_FMT_YUV422P10,
     AV_PIX_FMT_YUV444P10,
     AV_PIX_FMT_GBRP10,
+    AV_PIX_FMT_GRAY10,
     AV_PIX_FMT_GRAY8,
     AV_PIX_FMT_NONE
 };
@@ -366,6 +369,8 @@  static const enum AVPixelFormat x265_csp_twelve[] = {
     AV_PIX_FMT_YUV422P12,
     AV_PIX_FMT_YUV444P12,
     AV_PIX_FMT_GBRP12,
+    AV_PIX_FMT_GRAY12,
+    AV_PIX_FMT_GRAY10,
     AV_PIX_FMT_GRAY8,
     AV_PIX_FMT_NONE
 };