[FFmpeg-cvslog] avutil: change default buffer size alignment for sample buffer functions

Justin Ruggles git at videolan.org
Tue Apr 24 02:43:17 CEST 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Tue Apr 10 10:53:55 2012 -0400| [83b26046fcce5f497042fd7c5d7ae6904d7b76e1] | committer: Justin Ruggles

avutil: change default buffer size alignment for sample buffer functions

Aligning nb_samples will give both correct plane pointer alignment and enough
padding for SIMD-optimized functions.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=83b26046fcce5f497042fd7c5d7ae6904d7b76e1
---

 libavutil/samplefmt.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavutil/samplefmt.c b/libavutil/samplefmt.c
index 2e0aa98..0a2ffa0 100644
--- a/libavutil/samplefmt.c
+++ b/libavutil/samplefmt.c
@@ -124,8 +124,10 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
         return AVERROR(EINVAL);
 
     /* auto-select alignment if not specified */
-    if (!align)
-        align = 32;
+    if (!align) {
+        align = 1;
+        nb_samples = FFALIGN(nb_samples, 32);
+    }
 
     /* check for integer overflow */
     if (nb_channels > INT_MAX / align ||



More information about the ffmpeg-cvslog mailing list