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

Git pushed a commit to branch master
in repository ffmpeg.

commit 21e6c1f57dddf976a441c05c89b3275727821af6
Author:     romainhedouin <[email protected]>
AuthorDate: Fri Oct 16 22:37:20 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Sun Nov 1 04:00:54 2026 +0000

    avfilter/vf_nnedi: use smaller per-thread buffers
    
    The output buffer only needs one line now, and the input buffer half a
    frame plus five lines. Both were as big as a whole frame.
    
    For 1080p yuv420p this saves about 115 MB with 10 filter threads and
    about 4 MB with one. The output is unchanged.
    
    Found during a code review sweep of ffmpeg using an LLM.
    
    Signed-off-by: romainhedouin <[email protected]>
---
 libavfilter/vf_nnedi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_nnedi.c b/libavfilter/vf_nnedi.c
index bad1b669cd..78a548c81f 100644
--- a/libavfilter/vf_nnedi.c
+++ b/libavfilter/vf_nnedi.c
@@ -1001,7 +1001,7 @@ static int config_input(AVFilterLink *inlink)
         }
     }
 
-    s->input_size = (s->planewidth[0] + 64) * (s->planeheight[0] + 6);
+    s->input_size = (s->planewidth[0] + 64) * ((s->planeheight[0] + 1) / 2 + 
5);
     s->input_buf = av_calloc(s->nb_threads, sizeof(*s->input_buf));
     if (!s->input_buf)
         return AVERROR(ENOMEM);
@@ -1017,7 +1017,7 @@ static int config_input(AVFilterLink *inlink)
         return AVERROR(ENOMEM);
 
     for (int i = 0; i < s->nb_threads; i++) {
-        s->output_buf[i] = av_calloc(s->input_size, sizeof(**s->output_buf));
+        s->output_buf[i] = av_calloc(s->planewidth[0], 
sizeof(**s->output_buf));
         if (!s->output_buf[i])
             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