This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 42cd61a1548e905a08289e0438d12c5e37b957c1
Author:     Julius Bairaktaris <[email protected]>
AuthorDate: Sun Aug 30 15:32:47 2026 +0200
Commit:     ArazIusubov <[email protected]>
CommitDate: Wed Sep 16 22:05:28 2026 +0000

    avfilter/amf: negotiate the input link from the input format list
    
    amf_setup_input_output_formats() built both negotiated lists from
    output_pix_fmts, so every filter's input_pix_fmts argument was dead and
    the input link only ever offered what the filter could output.
    
    For vpp_amf, whose input list is deliberately wider than its output list,
    libavfilter therefore inserted a software conversion in front of the
    filter for any input format missing from the output list. P010 is the
    damaging case: 10-bit software input was silently reduced to 8-bit
    YUV420P before being uploaded, and the filter was then asked to convert
    that back to P010.
    
    Build input_formats from input_pix_fmts, and apply the D3D11VA and DXVA2
    device overrides to both lists, which the old code got for free by
    sharing one list.
    
    Fixes the FFmpeg side of #21620. With
      -f lavfi -i "smptehdbars=d=1,format=p010le" -vf "vpp_amf=format=p010le"
    signalstats YAVG moves from 432.141 to 413.631, matching the untouched
    P010 source exactly, and the p010le -> yuv420p conversion no longer
    appears in the filter graph. The 8-bit-to-P010 half of that report is an
    AMF limitation and is unaffected.
    
    Tested on Windows 11, RX 9070 XT, driver 32.0.31041.1004: vpp_amf,
    vqe_amf, frc_amf and every sr_amf algorithm, with AMF hardware surfaces
    and with NV12, YUV420P, YUV420P10, YUYV422, GRAY8, 0RGB, RGB0, BGR0,
    P010, RGBA and BGRA software input. No case that worked before stopped
    working; software P010 and RGBA into vpp_amf now work where they
    previously failed.
    
    Assisted-by: Claude Opus 5
    Signed-off-by: Julius Bairaktaris <[email protected]>
---
 libavfilter/vf_amf_common.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavfilter/vf_amf_common.c b/libavfilter/vf_amf_common.c
index 5700c6e2a4..0fbefbfbc0 100644
--- a/libavfilter/vf_amf_common.c
+++ b/libavfilter/vf_amf_common.c
@@ -226,22 +226,24 @@ int amf_setup_input_output_formats(AVFilterContext *avctx,
     #if CONFIG_D3D11VA
         case AV_HWDEVICE_TYPE_D3D11VA:
             {
-                static const enum AVPixelFormat output_pix_fmts_d3d11[] = {
+                static const enum AVPixelFormat pix_fmts_d3d11[] = {
                     AV_PIX_FMT_D3D11,
                     AV_PIX_FMT_NONE,
                 };
-                output_pix_fmts = output_pix_fmts_d3d11;
+                input_pix_fmts  = pix_fmts_d3d11;
+                output_pix_fmts = pix_fmts_d3d11;
             }
             break;
     #endif
     #if CONFIG_DXVA2
         case AV_HWDEVICE_TYPE_DXVA2:
             {
-                static const enum AVPixelFormat output_pix_fmts_dxva2[] = {
+                static const enum AVPixelFormat pix_fmts_dxva2[] = {
                     AV_PIX_FMT_DXVA2_VLD,
                     AV_PIX_FMT_NONE,
                 };
-                output_pix_fmts = output_pix_fmts_dxva2;
+                input_pix_fmts  = pix_fmts_dxva2;
+                output_pix_fmts = pix_fmts_dxva2;
             }
             break;
     #endif
@@ -256,7 +258,7 @@ int amf_setup_input_output_formats(AVFilterContext *avctx,
         }
     }
 
-    input_formats = ff_make_pixel_format_list(output_pix_fmts);
+    input_formats = ff_make_pixel_format_list(input_pix_fmts);
     if (!input_formats) {
         return AVERROR(ENOMEM);
     }

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to