Commit 9626d0e9 authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/frame: Try to align width to achive linesize[0] alignment

This results in more alignment for pixel formats that have "odd" pixel
sizes like RGB24. It makes access through SIMD easier

Works around Issue described in Ticket1031
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e41bf19d
......@@ -126,10 +126,14 @@ static int get_video_buffer(AVFrame *frame, int align)
return ret;
if (!frame->linesize[0]) {
ret = av_image_fill_linesizes(frame->linesize, frame->format,
frame->width);
if (ret < 0)
return ret;
for(i=1; i<=align; i+=i) {
ret = av_image_fill_linesizes(frame->linesize, frame->format,
FFALIGN(frame->width, i));
if (ret < 0)
return ret;
if (!(frame->linesize[0] & (align-1)))
break;
}
for (i = 0; i < 4 && frame->linesize[i]; i++)
frame->linesize[i] = FFALIGN(frame->linesize[i], align);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment