History

lavc: use av_cpu_max_align() instead of hardcoding alignment requirements

Anton Khirnov committed 9 years ago

Commit f44ec221 parent e6bff231 file · +2 −9Browse files

Unified · Split

libavcodec/utils.c+2−9
@@ -179,17 +179,10 @@ int ff_side_data_update_matrix_encoding(AVFrame *frame, · 178 unmodified lines
179179 return 0;
180180 }
181181
182−#if HAVE_SIMD_ALIGN_32
183−# define STRIDE_ALIGN 32
184−#elif HAVE_SIMD_ALIGN_16
185−# define STRIDE_ALIGN 16
186−#else
187−# define STRIDE_ALIGN 8
188−#endif
189−
190182 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
191183 int linesize_align[AV_NUM_DATA_POINTERS])
192184 {
185+ size_t max_align = av_cpu_max_align();
193186 int i;
194187 int w_align = 1;
195188 int h_align = 1;
@@ -282,7 +275,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, · 86 unmodified lines
282275 *height += 2;
283276
284277 for (i = 0; i < 4; i++)
285− linesize_align[i] = STRIDE_ALIGN;
278+ linesize_align[i] = max_align;
286279 }
287280
288281 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t