Re: [FFmpeg-devel] Add 16-bit Depth pixel format

2019-03-22 Thread Carl Eugen Hoyos
2019-03-21 1:26 GMT+01:00, Carl Eugen Hoyos :
> 2018-11-19 18:41 GMT+01:00, Carl Eugen Hoyos :
>> 2018-11-19 18:21 GMT+01:00, Pablo Rubio Fernández
>> :
>>
>>> It's my first time here. I want to create a patch to add
>>> Z16 pixel format.
>>> I have did some changes, and I want to know if I'll need
>>> change any other file.
>>
>> Isn't attached poc sufficient?
>
> Patch attached that imo makes using z16 a little easier,
> will push if there are no objections.

Patch applied.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] Add 16-bit Depth pixel format

2019-03-20 Thread Carl Eugen Hoyos
2018-11-19 18:41 GMT+01:00, Carl Eugen Hoyos :
> 2018-11-19 18:21 GMT+01:00, Pablo Rubio Fernández :
>
>> It's my first time here. I want to create a patch to add Z16 pixel
>> format.
>> I have did some changes, and I want to know if I'll need change any other
>> file.
>
> Isn't attached poc sufficient?

Patch attached that imo makes using z16 a little easier,
will push if there are no objections.

Carl Eugen
From b33aac84ecce24cbe9125415c0c0e7732887dc5f Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Thu, 21 Mar 2019 01:24:42 +0100
Subject: [PATCH] lavd/v4l2-common: Add an entry for Z16.

---
 libavdevice/v4l2-common.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavdevice/v4l2-common.c b/libavdevice/v4l2-common.c
index 2d6bfac..b5b4448 100644
--- a/libavdevice/v4l2-common.c
+++ b/libavdevice/v4l2-common.c
@@ -46,6 +46,9 @@ const struct fmt_map ff_fmt_conversion_table[] = {
 #ifdef V4L2_PIX_FMT_Y16
 { AV_PIX_FMT_GRAY16LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_Y16 },
 #endif
+#ifdef V4L2_PIX_FMT_Z16
+{ AV_PIX_FMT_GRAY16LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_Z16 },
+#endif
 { AV_PIX_FMT_NV12,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12},
 { AV_PIX_FMT_NONE,AV_CODEC_ID_MJPEG,V4L2_PIX_FMT_MJPEG   },
 { AV_PIX_FMT_NONE,AV_CODEC_ID_MJPEG,V4L2_PIX_FMT_JPEG},
-- 
1.7.10.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Add 16-bit Depth pixel format

2018-11-28 Thread Pablo Rubio Fernández
Yes, it is like gray16. But gray16le is already in use to Y16 pixel format.
For this reason, I think that best way to add Z16 pixel format is creating it.
I'm not an expert, any help will be appreciated.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Add 16-bit Depth pixel format

2018-11-19 Thread Carl Eugen Hoyos
2018-11-19 18:41 GMT+01:00, Carl Eugen Hoyos :
> 2018-11-19 18:21 GMT+01:00, Pablo Rubio Fernández :
>
>> It's my first time here. I want to create a patch to add Z16 pixel
>> format.
>> I have did some changes, and I want to know if I'll need change any other
>> file.
>
> Isn't attached poc sufficient?

After adding the missing ","...

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Add 16-bit Depth pixel format

2018-11-19 Thread Carl Eugen Hoyos
2018-11-19 18:21 GMT+01:00, Pablo Rubio Fernández :

> It's my first time here. I want to create a patch to add Z16 pixel format.
> I have did some changes, and I want to know if I'll need change any other
> file.

Isn't attached poc sufficient?

Carl Eugen
diff --git a/libavdevice/v4l2-common.c b/libavdevice/v4l2-common.c
index 2d6bfac..4da6044 100644
--- a/libavdevice/v4l2-common.c
+++ b/libavdevice/v4l2-common.c
@@ -64,6 +64,9 @@ const struct fmt_map ff_fmt_conversion_table[] = {
 { AV_PIX_FMT_BAYER_GRBG8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_SGRBG8 },
 { AV_PIX_FMT_BAYER_RGGB8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_SRGGB8 },
 #endif
+#ifdef V4L2_PIX_FMT_Z16
+{ AV_PIX_FMT_GRAY16LE AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_Z16},
+#endif
 { AV_PIX_FMT_NONE,AV_CODEC_ID_NONE, 0},
 };
 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Add 16-bit Depth pixel format

2018-11-19 Thread Paul B Mahol
On 11/19/18, Pablo Rubio Fernández  wrote:
> Hi all!
> It's my first time here. I want to create a patch to add Z16 pixel format.
> I have did some changes, and I want to know if I'll need change any other
> file.
> I attach my current patch.
> Thanks in advance.
>

Isn't this same as gray16?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] Add 16-bit Depth pixel format

2018-11-19 Thread Pablo Rubio Fernández
Hi all!
It's my first time here. I want to create a patch to add Z16 pixel format.
I have did some changes, and I want to know if I'll need change any other
file.
I attach my current patch.
Thanks in advance.
From 7f3e028198c510fd8cf14c087d4a223bd7e94422 Mon Sep 17 00:00:00 2001
From: prubio 
Date: Fri, 16 Nov 2018 11:55:00 +0100
Subject: [PATCH] Add 16-bit Depth z16 pixel format

---
 libavdevice/v4l2-common.c | 3 +++
 libavutil/pixdesc.c   | 9 +
 libavutil/pixfmt.h| 2 ++
 libswscale/input.c| 3 +++
 libswscale/utils.c| 2 ++
 5 files changed, 19 insertions(+)

diff --git a/libavdevice/v4l2-common.c b/libavdevice/v4l2-common.c
index 2d6bfac..337bb08 100644
--- a/libavdevice/v4l2-common.c
+++ b/libavdevice/v4l2-common.c
@@ -46,6 +46,9 @@ const struct fmt_map ff_fmt_conversion_table[] = {
 #ifdef V4L2_PIX_FMT_Y16
 { AV_PIX_FMT_GRAY16LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_Y16 },
 #endif
+#ifdef V4L2_PIX_FMT_Z16
+{ AV_PIX_FMT_Z16, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_Z16 },
+#endif
 { AV_PIX_FMT_NV12,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12},
 { AV_PIX_FMT_NONE,AV_CODEC_ID_MJPEG,V4L2_PIX_FMT_MJPEG   },
 { AV_PIX_FMT_NONE,AV_CODEC_ID_MJPEG,V4L2_PIX_FMT_JPEG},
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 1c36577..9ede616 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2268,6 +2268,15 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 .flags = AV_PIX_FMT_FLAG_FLOAT,
 .alias = "yf32le",
 },
+[AV_PIX_FMT_Z16] = {
+.name = "z16",
+.nb_components = 1,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 2, 0, 0, 16, 1, 15, 1 },   /* Y */
+},
+},
 };
 #if FF_API_PLUS1_MINUS1
 FF_ENABLE_DEPRECATION_WARNINGS
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 6815f8d..d8a7119 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -300,6 +300,8 @@ enum AVPixelFormat {
 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_Z16,  ///< 16 bit Depth (little-endian)
+
 /**
  * Hardware surfaces for Direct3D11.
  *
diff --git a/libswscale/input.c b/libswscale/input.c
index 4099c19..7178307 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -1448,6 +1448,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 c->alpToYV12 = bswap16Y_c;
 break;
 #endif
+case AV_PIX_FMT_Z16:
+c->lumToYV12 = bswap16Y_c;
+break;
 case AV_PIX_FMT_YA16LE:
 c->lumToYV12 = read_ya16le_gray_c;
 break;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index d5913ed..2e18e2d 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -260,6 +260,7 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
 [AV_PIX_FMT_P016BE]  = { 1, 1 },
 [AV_PIX_FMT_GRAYF32LE]   = { 1, 1 },
 [AV_PIX_FMT_GRAYF32BE]   = { 1, 1 },
+[AV_PIX_FMT_Z16] = { 1, 1 },
 };
 
 int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
@@ -1034,6 +1035,7 @@ static int handle_jpeg(enum AVPixelFormat *format)
 case AV_PIX_FMT_GRAY16BE:
 case AV_PIX_FMT_YA16BE:
 case AV_PIX_FMT_YA16LE:
+case AV_PIX_FMT_Z16:
 return 1;
 default:
 return 0;
-- 
2.7.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel