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
179 return 0;179 return 0;
180}180}
181 181
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
190void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,182void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
191 int linesize_align[AV_NUM_DATA_POINTERS])183 int linesize_align[AV_NUM_DATA_POINTERS])
192{184{
185 size_t max_align = av_cpu_max_align();
193 int i;186 int i;
194 int w_align = 1;187 int w_align = 1;
195 int h_align = 1;188 int h_align = 1;
@@ -282,7 +275,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, · 86 unmodified lines
282 *height += 2;275 *height += 2;
283 276
284 for (i = 0; i < 4; i++)277 for (i = 0; i < 4; i++)
285 linesize_align[i] = STRIDE_ALIGN;278 linesize_align[i] = max_align;
286}279}
287 280
288void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height)281void 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