aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-07-31 09:54:02 -0300
committerJames Almer <jamrial@gmail.com>2024-08-07 00:16:21 -0300
commit210740b4ed4ac0329652aa4f16c0166e96a7e112 (patch)
treebe8ce61bd3ac59811475bfa29498c0af637cd1ae
parent792a9979ebc678de9b67745027e2c1bfb63e4845 (diff)
downloadffmpeg-210740b4ed4ac0329652aa4f16c0166e96a7e112.tar.gz
avutil/frame: use the maximum compile time supported alignment for strides
This puts lavu frame buffer allocator helpers in sync with lavc's decoder frame buffer allocator's STRIDE_ALIGN define. Remove the comment about av_cpu_max_align() while at it as using it is not ideal when CPU flags can be changed mid process. Should fix ticket #11116. Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavutil/frame.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c
index 673a9afb3b..5cbfc6a48b 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -166,6 +166,8 @@ void av_frame_free(AVFrame **frame)
av_freep(frame);
}
+#define ALIGN (HAVE_SIMD_ALIGN_64 ? 64 : 32)
+
static int get_video_buffer(AVFrame *frame, int align)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
@@ -182,7 +184,7 @@ static int get_video_buffer(AVFrame *frame, int align)
if (!frame->linesize[0]) {
if (align <= 0)
- align = 32; /* STRIDE_ALIGN. Should be av_cpu_max_align() */
+ align = ALIGN;
for (int i = 1; i <= align; i += i) {
ret = av_image_fill_linesizes(frame->linesize, frame->format,