[FFmpeg-cvslog] lavc: use av_cpu_max_align() instead of hardcoding alignment requirements
Anton Khirnov
git at videolan.org
Thu Sep 28 05:18:24 EEST 2017
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Feb 8 09:34:58 2017 +0100| [f44ec22e095c5ba00ffeadd891655c456e3dd014] | committer: Anton Khirnov
lavc: use av_cpu_max_align() instead of hardcoding alignment requirements
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f44ec22e095c5ba00ffeadd891655c456e3dd014
---
libavcodec/utils.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 2978109a23..06a5784046 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -179,17 +179,10 @@ int ff_side_data_update_matrix_encoding(AVFrame *frame,
return 0;
}
-#if HAVE_SIMD_ALIGN_32
-# define STRIDE_ALIGN 32
-#elif HAVE_SIMD_ALIGN_16
-# define STRIDE_ALIGN 16
-#else
-# define STRIDE_ALIGN 8
-#endif
-
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
int linesize_align[AV_NUM_DATA_POINTERS])
{
+ size_t max_align = av_cpu_max_align();
int i;
int w_align = 1;
int h_align = 1;
@@ -282,7 +275,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
*height += 2;
for (i = 0; i < 4; i++)
- linesize_align[i] = STRIDE_ALIGN;
+ linesize_align[i] = max_align;
}
void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height)
More information about the ffmpeg-cvslog
mailing list