mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e41bf19d2c
commit
9626d0e906
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user