summaryrefslogtreecommitdiffstats
path: root/video/mp_image.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-22 19:22:38 +0100
committerwm4 <wm4@nowhere>2012-11-22 19:22:38 +0100
commit1d3179a5f1dc2fdfeaac3582a925c2849ac265a9 (patch)
tree1c1dc8346a71a4b911023b231e750fac78b23490 /video/mp_image.h
parent11783b5edee8ce6efc8ee526433053afe3c14ed4 (diff)
downloadmpv-1d3179a5f1dc2fdfeaac3582a925c2849ac265a9.tar.bz2
mpv-1d3179a5f1dc2fdfeaac3582a925c2849ac265a9.tar.xz
mp_image: make alloc_mpi() always allocate with aligned stride
By "design", mplayer normally allocates aligned images only inside the filter chain, via the vf_get_image() function. This function pads the width of the requested image if a stride is allowed, sets that new width before calling mp_image_alloc_planes(). However, newer code wants aligned images as well (basically to satisfy libswscale). This affects all uses of alloc_mpi(). To get aligned strides, simply change alloc_mpi() to request an aligned width. Remove the old hack in mp_image_alloc_planes(), which special cases some image formats to be allocated with aligned strides. This is a temporary hack until mp_image_alloc_planes() is revised.
Diffstat (limited to 'video/mp_image.h')
-rw-r--r--video/mp_image.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/mp_image.h b/video/mp_image.h
index 8ce0b98edc..d2c7d38f50 100644
--- a/video/mp_image.h
+++ b/video/mp_image.h
@@ -26,6 +26,9 @@
#include "core/mp_msg.h"
#include "csputils.h"
+// Minimum stride alignment in pixels
+#define MP_STRIDE_ALIGNMENT 32
+
//--------- codec's requirements (filled by the codec/vf) ---------
//--- buffer content restrictions: