[FFmpeg-cvslog] avfilter/video: Add ff_default_get_video_buffer2() to set specific alignment

Michael Niedermayer git at videolan.org
Sun Oct 9 23:05:54 EEST 2022


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Mon Apr 11 22:40:59 2022 +0200| [ddc96fdb4326c4de1da2c1ef993ae2996572af93] | committer: Michael Niedermayer

avfilter/video: Add ff_default_get_video_buffer2() to set specific alignment

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit d74078270198b97fdda258840f0d501a3ffcc693)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ddc96fdb4326c4de1da2c1ef993ae2996572af93
---

 libavfilter/video.c | 7 ++++++-
 libavfilter/video.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavfilter/video.c b/libavfilter/video.c
index 7a8e587798..b049804419 100644
--- a/libavfilter/video.c
+++ b/libavfilter/video.c
@@ -41,7 +41,7 @@ AVFrame *ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
     return ff_get_video_buffer(link->dst->outputs[0], w, h);
 }
 
-AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
+AVFrame *ff_default_get_video_buffer2(AVFilterLink *link, int w, int h, int align)
 {
     AVFrame *frame = NULL;
     int pool_width = 0;
@@ -96,6 +96,11 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
     return frame;
 }
 
+AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
+{
+    return ff_default_get_video_buffer2(link, w, h, av_cpu_max_align());
+}
+
 AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h)
 {
     AVFrame *ret = NULL;
diff --git a/libavfilter/video.h b/libavfilter/video.h
index 56c58d6766..f9174a4a0b 100644
--- a/libavfilter/video.h
+++ b/libavfilter/video.h
@@ -24,6 +24,7 @@
 #include "avfilter.h"
 
 AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h);
+AVFrame *ff_default_get_video_buffer2(AVFilterLink *link, int w, int h, int align);
 AVFrame *ff_null_get_video_buffer(AVFilterLink *link, int w, int h);
 
 /**



More information about the ffmpeg-cvslog mailing list