lavc: use av_cpu_max_align() instead of hardcoding alignment requirements
This commit is contained in:
parent
e6bff23f1e
commit
f44ec22e09
@ -179,17 +179,10 @@ int ff_side_data_update_matrix_encoding(AVFrame *frame,
|
|||||||
return 0;
|
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,
|
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
||||||
int linesize_align[AV_NUM_DATA_POINTERS])
|
int linesize_align[AV_NUM_DATA_POINTERS])
|
||||||
{
|
{
|
||||||
|
size_t max_align = av_cpu_max_align();
|
||||||
int i;
|
int i;
|
||||||
int w_align = 1;
|
int w_align = 1;
|
||||||
int h_align = 1;
|
int h_align = 1;
|
||||||
@ -282,7 +275,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
|||||||
*height += 2;
|
*height += 2;
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
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)
|
void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user