[FFmpeg-devel] [PATCH3/3] avfilter YUV aligment 32 bytes aligment for Y only and 16 bytes for UV.

Richard Buteau rbuteau
Tue Sep 21 19:15:46 CEST 2010


Hi all,
Some encoder don't support linesize[] that aren't multiple. As an
example they expect 720/360/360 for yuv image or 732/368/368.
the avfilter align all linesize on 16 byte, this make a yuv 720/368/368.
720 isn't a multiple of 368.
I added alignment on 32bytes for Y only so it's always 732/368/368
I hope this acceptable.
Richard


diff -uNr -x .svn -x '*.d' ffmpeg/libavfilter/defaults.c
ffmpeg_avfilter_align32byte/libavfilter/defaults.c
--- ffmpeg/libavfilter/defaults.c       2010-09-14 13:04:26.000000000
-0500
+++ ffmpeg_avfilter_align32byte/libavfilter/defaults.c  2010-09-21
12:03:04.000000000 -0500
@@ -59,8 +59,9 @@
     for (i = 0; i < 4; i++)
         pic->linesize[i] = FFALIGN(pic->linesize[i], 16);

-    tempsize = av_image_fill_pointers(pic->data, ref->format,
ref->video->h, NULL, pic->linesize);
-    buf = av_malloc(tempsize + 16); // +2 is needed for swscaler, +16
to be
+    pic->linesize[0] = FFALIGN(pic->linesize[0], 32);
+    tempsize = av_fill_image_pointers(pic->data, ref->format,
ref->video->h, NULL, pic->linesize);
+    buf = av_malloc(tempsize + 32); // +2 is needed for swscaler, +32
to be
                                     // SIMD-friendly
     if (!buf)
         goto fail;

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: avfilter_align32byte.patch.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100921/222365d3/attachment.txt>



More information about the ffmpeg-devel mailing list