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

Git pushed a commit to branch master
in repository ffmpeg.

commit cb8a006f8a2777ad2766ed7018458e9024586ad8
Author:     Niklas Haas <[email protected]>
AuthorDate: Fri Jun 19 14:09:42 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Sat Jun 20 03:04:01 2026 +0200

    swscale/graph: don't over-allocate pass buffer lines
    
    This is not only wasteful but also serves no real purpose. Looping over
    the correct number of lines is trivial; there is far less point in vertical
    padding than horizontal padding.
    
    Furthermore, this might actually introduce issues when linking output 
buffers;
    since the extra padding depends on the pass's alignment and threading
    requirements, which may differ from pass to pass.
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/graph.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/libswscale/graph.c b/libswscale/graph.c
index 3db3b98c7b..06e5ebefc8 100644
--- a/libswscale/graph.c
+++ b/libswscale/graph.c
@@ -201,6 +201,10 @@ int ff_sws_graph_add_pass(SwsGraph *graph, enum 
AVPixelFormat fmt,
         goto fail;
     }
 
+    pass->output->height = pass->height;
+    pass->output->width  = pass->width;
+    pass->output->width_align = 1;
+
     if (!align) {
         pass->slice_h = pass->height;
         pass->num_slices = 1;
@@ -210,11 +214,6 @@ int ff_sws_graph_add_pass(SwsGraph *graph, enum 
AVPixelFormat fmt,
         pass->num_slices = (pass->height + pass->slice_h - 1) / pass->slice_h;
     }
 
-    /* Align output buffer to include extra slice padding */
-    pass->output->height = pass->slice_h * pass->num_slices;
-    pass->output->width  = pass->width;
-    pass->output->width_align = 1;
-
     ret = av_dynarray_add_nofree(&graph->passes, &graph->num_passes, pass);
     if (ret < 0)
         goto fail;

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

Reply via email to