From: Timo Rothenpieler <timo@rothenpieler.org> To: ffmpeg-devel@ffmpeg.org Cc: Timo Rothenpieler <timo@rothenpieler.org> Subject: [FFmpeg-devel] [PATCH 03/11] avfilter/vsrc_ddagrab: add rgbaf16 output support Date: Wed, 10 Aug 2022 22:47:04 +0200 Message-ID: <20220810204712.3123-3-timo@rothenpieler.org> (raw) In-Reply-To: <20220810204712.3123-1-timo@rothenpieler.org> --- libavfilter/version.h | 2 +- libavfilter/vsrc_ddagrab.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libavfilter/version.h b/libavfilter/version.h index 19a009c110..fa67606495 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -32,7 +32,7 @@ #include "version_major.h" #define LIBAVFILTER_VERSION_MINOR 46 -#define LIBAVFILTER_VERSION_MICRO 101 +#define LIBAVFILTER_VERSION_MICRO 102 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ diff --git a/libavfilter/vsrc_ddagrab.c b/libavfilter/vsrc_ddagrab.c index ce36716281..252505b96d 100644 --- a/libavfilter/vsrc_ddagrab.c +++ b/libavfilter/vsrc_ddagrab.c @@ -115,6 +115,8 @@ static const AVOption ddagrab_options[] = { { "bgra", "only output 8 Bit BGRA", 0, AV_OPT_TYPE_CONST, { .i64 = DXGI_FORMAT_B8G8R8A8_UNORM }, 0, INT_MAX, FLAGS, "output_fmt" }, { "10bit", "only output default 10 Bit format", 0, AV_OPT_TYPE_CONST, { .i64 = DXGI_FORMAT_R10G10B10A2_UNORM }, 0, INT_MAX, FLAGS, "output_fmt" }, { "x2bgr10", "only output 10 Bit X2BGR10", 0, AV_OPT_TYPE_CONST, { .i64 = DXGI_FORMAT_R10G10B10A2_UNORM }, 0, INT_MAX, FLAGS, "output_fmt" }, + { "16bit", "only output default 16 Bit format", 0, AV_OPT_TYPE_CONST, { .i64 = DXGI_FORMAT_R16G16B16A16_FLOAT },0, INT_MAX, FLAGS, "output_fmt" }, + { "rgbaf16", "only output 16 Bit RGBAF16", 0, AV_OPT_TYPE_CONST, { .i64 = DXGI_FORMAT_R16G16B16A16_FLOAT },0, INT_MAX, FLAGS, "output_fmt" }, { NULL } }; @@ -212,6 +214,7 @@ static av_cold int init_dxgi_dda(AVFilterContext *avctx) if (set_thread_dpi && SUCCEEDED(hr)) { DPI_AWARENESS_CONTEXT prev_dpi_ctx; DXGI_FORMAT formats[] = { + DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM }; @@ -665,6 +668,10 @@ static av_cold int init_hwframes_ctx(AVFilterContext *avctx) av_log(avctx, AV_LOG_VERBOSE, "Probed 10 bit RGB frame format\n"); dda->frames_ctx->sw_format = AV_PIX_FMT_X2BGR10; break; + case DXGI_FORMAT_R16G16B16A16_FLOAT: + av_log(avctx, AV_LOG_VERBOSE, "Probed 16 bit float RGB frame format\n"); + dda->frames_ctx->sw_format = AV_PIX_FMT_RGBAF16; + break; default: av_log(avctx, AV_LOG_ERROR, "Unexpected texture output format!\n"); return AVERROR_BUG; @@ -990,6 +997,12 @@ static int ddagrab_request_frame(AVFilterLink *outlink) frame->color_primaries = AVCOL_PRI_BT709; frame->color_trc = AVCOL_TRC_IEC61966_2_1; frame->colorspace = AVCOL_SPC_RGB; + } else if(desc.Format == DXGI_FORMAT_R16G16B16A16_FLOAT) { + // According to MSDN, all floating point formats contain sRGB image data with linear 1.0 gamma. + frame->color_range = AVCOL_RANGE_JPEG; + frame->color_primaries = AVCOL_PRI_BT709; + frame->color_trc = AVCOL_TRC_LINEAR; + frame->colorspace = AVCOL_SPC_RGB; } else { ret = AVERROR_BUG; goto fail; -- 2.34.1 _______________________________________________ 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".
next prev parent reply other threads:[~2022-08-10 20:47 UTC|newest] Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-08-10 20:47 [FFmpeg-devel] [PATCH 01/11] lavu/pixfmt: add packed RGBA float16 format Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 02/11] avutil/hwcontext_d3d11va: add support for rgbaf16 pixel format Timo Rothenpieler 2022-08-10 20:47 ` Timo Rothenpieler [this message] 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 04/11] avfilter/vsrc_ddagrab: add options for more control over output format fallback Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 05/11] avutil: move half-precision float helper to avutil Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 06/11] avutil/half2float: adjust conversion of NaN Timo Rothenpieler 2022-08-10 21:24 ` Andreas Rheinhardt 2022-08-10 21:36 ` Timo Rothenpieler 2022-08-10 21:43 ` Andreas Rheinhardt 2022-08-10 21:53 ` Timo Rothenpieler 2022-08-10 22:14 ` Mark Reid 2022-08-10 22:18 ` James Almer 2022-08-10 22:28 ` Timo Rothenpieler 2022-08-10 22:37 ` Mark Reid 2022-08-10 22:55 ` Timo Rothenpieler 2022-08-11 2:18 ` Mark Reid 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 07/11] avutil/half2float: move tables to header-internal structs Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 08/11] avutil/half2float: move non-inline init code out of header Timo Rothenpieler 2022-08-11 20:46 ` Michael Niedermayer 2022-08-11 20:50 ` Andreas Rheinhardt 2022-08-11 21:16 ` Michael Niedermayer 2022-08-11 21:31 ` Andreas Rheinhardt 2022-08-14 19:32 ` Michael Niedermayer 2022-08-15 4:20 ` Andreas Rheinhardt 2022-08-15 18:09 ` Michael Niedermayer 2022-08-14 21:54 ` Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 09/11] avutil/half2float: use native _Float16 if available Timo Rothenpieler 2022-08-10 21:03 ` Andreas Rheinhardt 2022-08-10 21:58 ` Timo Rothenpieler 2022-08-10 22:02 ` James Almer 2022-08-10 22:51 ` [FFmpeg-devel] [PATCH v2 " Timo Rothenpieler 2022-08-11 0:14 ` James Almer 2022-08-11 11:50 ` Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 10/11] swscale: add SwsContext parameter to input functions Timo Rothenpieler 2022-08-10 20:52 ` Timo Rothenpieler 2022-08-10 21:55 ` Andreas Rheinhardt 2022-08-10 22:02 ` Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 11/11] swscale/input: add rgbaf16 input support Timo Rothenpieler 2022-08-10 21:37 ` Timo Rothenpieler
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220810204712.3123-3-timo@rothenpieler.org \ --to=timo@rothenpieler.org \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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