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

Git pushed a commit to branch master
in repository ffmpeg.

commit c911295f096c8dcf0dc29239d0915ce92f2454b5
Author:     Lynne <[email protected]>
AuthorDate: Tue Feb 24 19:10:09 2026 +0100
Commit:     Lynne <[email protected]>
CommitDate: Thu Feb 26 14:10:21 2026 +0100

    swscale: forward original frame pointers to ops.c backend
    
    Sponsored-by: Sovereign Tech Fund
---
 libswscale/graph.c            | 1 +
 libswscale/graph.h            | 1 +
 libswscale/ops.c              | 6 ++++++
 libswscale/ops_internal.h     | 7 ++++++-
 libswscale/swscale.c          | 1 +
 libswscale/x86/ops_common.asm | 2 ++
 6 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/libswscale/graph.c b/libswscale/graph.c
index e6843a7752..81f378f020 100644
--- a/libswscale/graph.c
+++ b/libswscale/graph.c
@@ -842,6 +842,7 @@ static SwsImg pass_output(const SwsPass *pass, const SwsImg 
*fallback)
         return *fallback;
 
     SwsImg img = pass->output->img;
+    img.frame_ptr = fallback->frame_ptr;
     for (int i = 0; i < FF_ARRAY_ELEMS(img.data); i++) {
         if (!img.data[i]) {
             img.data[i]     = fallback->data[i];
diff --git a/libswscale/graph.h b/libswscale/graph.h
index b9ad2425bd..e2703dfded 100644
--- a/libswscale/graph.h
+++ b/libswscale/graph.h
@@ -36,6 +36,7 @@ typedef struct SwsImg {
     enum AVPixelFormat fmt;
     uint8_t *data[4]; /* points to y=0 */
     int linesize[4];
+    const AVFrame *frame_ptr; /* Pointer to the original AVframe */
 } SwsImg;
 
 static av_always_inline av_const int ff_fmt_vshift(enum AVPixelFormat fmt, int 
plane)
diff --git a/libswscale/ops.c b/libswscale/ops.c
index e78d09ae0b..d6930a15e5 100644
--- a/libswscale/ops.c
+++ b/libswscale/ops.c
@@ -970,6 +970,9 @@ static void op_pass_setup(const SwsImg *out_base, const 
SwsImg *in_base,
     const SwsImg in  = img_shift_idx(in_base,  0, p->idx_in);
     const SwsImg out = img_shift_idx(out_base, 0, p->idx_out);
 
+    exec->src_frame_ptr = in.frame_ptr;
+    exec->dst_frame_ptr = out.frame_ptr;
+
     for (int i = 0; i < p->planes_in; i++) {
         const int idx        = p->idx_in[i];
         const int sub_x      = (idx == 1 || idx == 2) ? indesc->log2_chroma_w 
: 0;
@@ -1083,6 +1086,9 @@ static void op_pass_run(const SwsImg *out_base, const 
SwsImg *in_base,
         exec.out[i] = out.data[i];
     }
 
+    exec.src_frame_ptr = in_base->frame_ptr;
+    exec.dst_frame_ptr = out_base->frame_ptr;
+
     /**
      *  To ensure safety, we need to consider the following:
      *
diff --git a/libswscale/ops_internal.h b/libswscale/ops_internal.h
index a5a156f728..c0e6e0ae27 100644
--- a/libswscale/ops_internal.h
+++ b/libswscale/ops_internal.h
@@ -75,9 +75,14 @@ typedef struct SwsOpExec {
     int32_t slice_y, slice_h;   /* Start and height of current slice */
     int32_t block_size_in;      /* Size of a block of pixels in bytes */
     int32_t block_size_out;
+
+    const AVFrame *src_frame_ptr;
+    const AVFrame *dst_frame_ptr;
 } SwsOpExec;
 
-static_assert(sizeof(SwsOpExec) == 24 * sizeof(void *) + 6 * sizeof(int32_t),
+static_assert(sizeof(SwsOpExec) == 24 * sizeof(void *) +
+                                   6 * sizeof(int32_t) +
+                                   2 * sizeof(void *),
               "SwsOpExec layout mismatch");
 
 /**
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 0e1831800c..e2770b4c8a 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1321,6 +1321,7 @@ static SwsImg get_frame_img(const AVFrame *frame, int 
field)
 {
     SwsImg img = {0};
 
+    img.frame_ptr = frame;
     img.fmt = frame->format;
     for (int i = 0; i < 4; i++) {
         img.data[i]     = frame->data[i];
diff --git a/libswscale/x86/ops_common.asm b/libswscale/x86/ops_common.asm
index e04ee70b56..23ccda4da3 100644
--- a/libswscale/x86/ops_common.asm
+++ b/libswscale/x86/ops_common.asm
@@ -137,6 +137,8 @@ struc SwsOpExec
     .slice_h resd 1
     .block_size_in resd 1
     .block_size_out resd 1
+    .in_hwframe_ref resq 1
+    .out_hwframe_ref resq 1
 endstruc
 
 struc SwsOpImpl

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to