Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/3] avfilter/vf_overlay: Add support for yuv444p10 pixel format
@ 2023-07-07 12:44 Tobias Rapp
  2023-07-07 12:44 ` [FFmpeg-devel] [PATCH 2/3] tests/fate: Add test for overlay filter using yuv444p10 output format Tobias Rapp
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tobias Rapp @ 2023-07-07 12:44 UTC (permalink / raw)
  To: ffmpeg-devel

---
 doc/filters.texi         |  3 +++
 libavfilter/vf_overlay.c | 36 +++++++++++++++++++++++++++++++++++-
 libavfilter/vf_overlay.h |  1 +
 3 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index f17488c..3b82edf 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -18605,6 +18605,9 @@ force YUV422p10 output
 @item yuv444
 force YUV444 output
 
+@item yuv444p10
+force YUV444p10 output
+
 @item rgb
 force packed RGB output
 
diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c
index 36c04ac..fa39abb 100644
--- a/libavfilter/vf_overlay.c
+++ b/libavfilter/vf_overlay.c
@@ -156,7 +156,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 
 static const enum AVPixelFormat alpha_pix_fmts[] = {
     AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
-    AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA422P10,
+    AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA444P10,
     AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, AV_PIX_FMT_RGBA,
     AV_PIX_FMT_BGRA, AV_PIX_FMT_GBRAP, AV_PIX_FMT_NONE
 };
@@ -204,6 +204,13 @@ static int query_formats(AVFilterContext *ctx)
         AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE
     };
 
+    static const enum AVPixelFormat main_pix_fmts_yuv444p10[] = {
+        AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_NONE
+    };
+    static const enum AVPixelFormat overlay_pix_fmts_yuv444p10[] = {
+        AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_NONE
+    };
+
     static const enum AVPixelFormat main_pix_fmts_gbrp[] = {
         AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_NONE
     };
@@ -248,6 +255,10 @@ static int query_formats(AVFilterContext *ctx)
         main_formats    = main_pix_fmts_yuv444;
         overlay_formats = overlay_pix_fmts_yuv444;
         break;
+    case OVERLAY_FORMAT_YUV444P10:
+        main_formats    = main_pix_fmts_yuv444p10;
+        overlay_formats = overlay_pix_fmts_yuv444p10;
+        break;
     case OVERLAY_FORMAT_RGB:
         main_formats    = main_pix_fmts_rgb;
         overlay_formats = overlay_pix_fmts_rgb;
@@ -759,6 +770,22 @@ static int blend_slice_yuva444(AVFilterContext *ctx, void *arg, int jobnr, int n
     return 0;
 }
 
+static int blend_slice_yuv444p10(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+    OverlayContext *s = ctx->priv;
+    ThreadData *td = arg;
+    blend_slice_yuv_16_10bits(ctx, td->dst, td->src, 0, 0, 0, s->x, s->y, 1, jobnr, nb_jobs);
+    return 0;
+}
+
+static int blend_slice_yuva444p10(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+    OverlayContext *s = ctx->priv;
+    ThreadData *td = arg;
+    blend_slice_yuv_16_10bits(ctx, td->dst, td->src, 0, 0, 1, s->x, s->y, 1, jobnr, nb_jobs);
+    return 0;
+}
+
 static int blend_slice_gbrp(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 {
     OverlayContext *s = ctx->priv;
@@ -902,6 +929,9 @@ static int config_input_main(AVFilterLink *inlink)
     case OVERLAY_FORMAT_YUV444:
         s->blend_slice = s->main_has_alpha ? blend_slice_yuva444 : blend_slice_yuv444;
         break;
+    case OVERLAY_FORMAT_YUV444P10:
+        s->blend_slice = s->main_has_alpha ? blend_slice_yuva444p10 : blend_slice_yuv444p10;
+        break;
     case OVERLAY_FORMAT_RGB:
         s->blend_slice = s->main_has_alpha ? blend_slice_rgba : blend_slice_rgb;
         break;
@@ -925,6 +955,9 @@ static int config_input_main(AVFilterLink *inlink)
         case AV_PIX_FMT_YUVA444P:
             s->blend_slice = blend_slice_yuva444;
             break;
+        case AV_PIX_FMT_YUVA444P10:
+            s->blend_slice = blend_slice_yuva444p10;
+            break;
         case AV_PIX_FMT_ARGB:
         case AV_PIX_FMT_RGBA:
         case AV_PIX_FMT_BGRA:
@@ -1084,6 +1117,7 @@ static const AVOption overlay_options[] = {
         { "yuv422", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV422}, .flags = FLAGS, .unit = "format" },
         { "yuv422p10", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV422P10}, .flags = FLAGS, .unit = "format" },
         { "yuv444", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV444}, .flags = FLAGS, .unit = "format" },
+        { "yuv444p10", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV444P10}, .flags = FLAGS, .unit = "format" },
         { "rgb",    "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_RGB},    .flags = FLAGS, .unit = "format" },
         { "gbrp",   "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_GBRP},   .flags = FLAGS, .unit = "format" },
         { "auto",   "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_AUTO},   .flags = FLAGS, .unit = "format" },
diff --git a/libavfilter/vf_overlay.h b/libavfilter/vf_overlay.h
index 7e65095..5974964 100644
--- a/libavfilter/vf_overlay.h
+++ b/libavfilter/vf_overlay.h
@@ -47,6 +47,7 @@ enum OverlayFormat {
     OVERLAY_FORMAT_YUV422,
     OVERLAY_FORMAT_YUV422P10,
     OVERLAY_FORMAT_YUV444,
+    OVERLAY_FORMAT_YUV444P10,
     OVERLAY_FORMAT_RGB,
     OVERLAY_FORMAT_GBRP,
     OVERLAY_FORMAT_AUTO,
-- 
2.7.4

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [FFmpeg-devel] [PATCH 2/3] tests/fate: Add test for overlay filter using yuv444p10 output format
  2023-07-07 12:44 [FFmpeg-devel] [PATCH 1/3] avfilter/vf_overlay: Add support for yuv444p10 pixel format Tobias Rapp
@ 2023-07-07 12:44 ` Tobias Rapp
  2023-07-07 12:44 ` [FFmpeg-devel] [PATCH 3/3] doc/filters: Extend description of overlay filter format option values Tobias Rapp
  2023-07-17  6:47 ` [FFmpeg-devel] [PATCH 1/3] avfilter/vf_overlay: Add support for yuv444p10 pixel format Tobias Rapp
  2 siblings, 0 replies; 5+ messages in thread
From: Tobias Rapp @ 2023-07-07 12:44 UTC (permalink / raw)
  To: ffmpeg-devel

---
 tests/fate/filter-video.mak             | 2 +-
 tests/filtergraphs/overlay_yuv444p10    | 5 +++++
 tests/ref/fate/filter-overlay_yuv444p10 | 8 ++++++++
 3 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 tests/filtergraphs/overlay_yuv444p10
 create mode 100644 tests/ref/fate/filter-overlay_yuv444p10

diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index e6de7de..789ec64 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -213,7 +213,7 @@ fate-filter-vstack: CMD = framecrc -c:v pgmyuv -i $(SRC) -c:v pgmyuv -i $(SRC) -
 FATE_FILTER_OVERLAY-$(call FILTERDEMDEC, SCALE OVERLAY, IMAGE2, PGMYUV) += fate-filter-overlay
 fate-filter-overlay: CMD = framecrc -c:v pgmyuv -i $(SRC) -c:v pgmyuv -i $(SRC) -filter_complex_script $(FILTERGRAPH)
 
-FATE_FILTER_OVERLAY-$(call FILTERDEMDEC, SPLIT SCALE PAD OVERLAY, IMAGE2, PGMYUV) += $(addprefix fate-filter-overlay_, rgb yuv420 yuv420p10 nv12 nv21 yuv422 yuv422p10 yuv444)
+FATE_FILTER_OVERLAY-$(call FILTERDEMDEC, SPLIT SCALE PAD OVERLAY, IMAGE2, PGMYUV) += $(addprefix fate-filter-overlay_, rgb yuv420 yuv420p10 nv12 nv21 yuv422 yuv422p10 yuv444 yuv444p10)
 fate-filter-overlay_%: CMD = framecrc -auto_conversion_filters -c:v pgmyuv -i $(SRC) -filter_complex_script $(FILTERGRAPH)
 fate-filter-overlay_yuv420: CMD = framecrc -c:v pgmyuv -i $(SRC) -filter_complex_script $(FILTERGRAPH)
 fate-filter-overlay_%p10: CMD = framecrc -auto_conversion_filters -c:v pgmyuv -i $(SRC) -filter_complex_script $(FILTERGRAPH) -pix_fmt $(@:fate-filter-overlay_%=%)le -frames:v 3
diff --git a/tests/filtergraphs/overlay_yuv444p10 b/tests/filtergraphs/overlay_yuv444p10
new file mode 100644
index 0000000..b184277
--- /dev/null
+++ b/tests/filtergraphs/overlay_yuv444p10
@@ -0,0 +1,5 @@
+sws_flags=+accurate_rnd+bitexact;
+split [main][over];
+[over] scale=88:72, format=yuv444p10, pad=96:80:4:4 [overf];
+[main] format=yuv444p10 [mainf];
+[mainf][overf] overlay=240:16:format=yuv444p10
diff --git a/tests/ref/fate/filter-overlay_yuv444p10 b/tests/ref/fate/filter-overlay_yuv444p10
new file mode 100644
index 0000000..b74dbcc
--- /dev/null
+++ b/tests/ref/fate/filter-overlay_yuv444p10
@@ -0,0 +1,8 @@
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 352x288
+#sar 0: 0/1
+0,          0,          0,        1,   608256, 0xc5ba4285
+0,          1,          1,        1,   608256, 0x3066fd50
+0,          2,          2,        1,   608256, 0xdb8e68a8
-- 
2.7.4

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [FFmpeg-devel] [PATCH 3/3] doc/filters: Extend description of overlay filter format option values
  2023-07-07 12:44 [FFmpeg-devel] [PATCH 1/3] avfilter/vf_overlay: Add support for yuv444p10 pixel format Tobias Rapp
  2023-07-07 12:44 ` [FFmpeg-devel] [PATCH 2/3] tests/fate: Add test for overlay filter using yuv444p10 output format Tobias Rapp
@ 2023-07-07 12:44 ` Tobias Rapp
  2023-07-17  6:47 ` [FFmpeg-devel] [PATCH 1/3] avfilter/vf_overlay: Add support for yuv444p10 pixel format Tobias Rapp
  2 siblings, 0 replies; 5+ messages in thread
From: Tobias Rapp @ 2023-07-07 12:44 UTC (permalink / raw)
  To: ffmpeg-devel

---
 doc/filters.texi | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 3b82edf..b57bb5a 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -18591,28 +18591,28 @@ Set the format for the output video.
 It accepts the following values:
 @table @samp
 @item yuv420
-force YUV420 output
+force YUV 4:2:0 8-bit planar output
 
 @item yuv420p10
-force YUV420p10 output
+force YUV 4:2:0 10-bit planar output
 
 @item yuv422
-force YUV422 output
+force YUV 4:2:2 8-bit planar output
 
 @item yuv422p10
-force YUV422p10 output
+force YUV 4:2:2 10-bit planar output
 
 @item yuv444
-force YUV444 output
+force YUV 4:4:4 8-bit planar output
 
 @item yuv444p10
-force YUV444p10 output
+force YUV 4:4:4 10-bit planar output
 
 @item rgb
-force packed RGB output
+force RGB 8-bit packed output
 
 @item gbrp
-force planar RGB output
+force RGB 8-bit planar output
 
 @item auto
 automatically pick format
-- 
2.7.4

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_overlay: Add support for yuv444p10 pixel format
  2023-07-07 12:44 [FFmpeg-devel] [PATCH 1/3] avfilter/vf_overlay: Add support for yuv444p10 pixel format Tobias Rapp
  2023-07-07 12:44 ` [FFmpeg-devel] [PATCH 2/3] tests/fate: Add test for overlay filter using yuv444p10 output format Tobias Rapp
  2023-07-07 12:44 ` [FFmpeg-devel] [PATCH 3/3] doc/filters: Extend description of overlay filter format option values Tobias Rapp
@ 2023-07-17  6:47 ` Tobias Rapp
  2023-07-20 15:07   ` Tobias Rapp
  2 siblings, 1 reply; 5+ messages in thread
From: Tobias Rapp @ 2023-07-17  6:47 UTC (permalink / raw)
  To: ffmpeg-devel

On 07/07/2023 14:44, Tobias Rapp wrote:

> ---
>   doc/filters.texi         |  3 +++
>   libavfilter/vf_overlay.c | 36 +++++++++++++++++++++++++++++++++++-
>   libavfilter/vf_overlay.h |  1 +
>   3 files changed, 39 insertions(+), 1 deletion(-)
>
> [...]

Would like to apply this patch-set in a few days from now if there are 
no objections.

Regards, Tobias

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_overlay: Add support for yuv444p10 pixel format
  2023-07-17  6:47 ` [FFmpeg-devel] [PATCH 1/3] avfilter/vf_overlay: Add support for yuv444p10 pixel format Tobias Rapp
@ 2023-07-20 15:07   ` Tobias Rapp
  0 siblings, 0 replies; 5+ messages in thread
From: Tobias Rapp @ 2023-07-20 15:07 UTC (permalink / raw)
  To: ffmpeg-devel

On 17/07/2023 08:47, Tobias Rapp wrote:

> On 07/07/2023 14:44, Tobias Rapp wrote:
>
>> ---
>>   doc/filters.texi         |  3 +++
>>   libavfilter/vf_overlay.c | 36 +++++++++++++++++++++++++++++++++++-
>>   libavfilter/vf_overlay.h |  1 +
>>   3 files changed, 39 insertions(+), 1 deletion(-)
>>
>> [...]
>
> Would like to apply this patch-set in a few days from now if there are 
> no objections.

Applied.

Regards, Tobias

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-20 15:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-07 12:44 [FFmpeg-devel] [PATCH 1/3] avfilter/vf_overlay: Add support for yuv444p10 pixel format Tobias Rapp
2023-07-07 12:44 ` [FFmpeg-devel] [PATCH 2/3] tests/fate: Add test for overlay filter using yuv444p10 output format Tobias Rapp
2023-07-07 12:44 ` [FFmpeg-devel] [PATCH 3/3] doc/filters: Extend description of overlay filter format option values Tobias Rapp
2023-07-17  6:47 ` [FFmpeg-devel] [PATCH 1/3] avfilter/vf_overlay: Add support for yuv444p10 pixel format Tobias Rapp
2023-07-20 15:07   ` Tobias Rapp

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git