diff --git a/configure b/configure index 891b06c43370ffadcaff3b78029c0fd1ebb84c15..96890264fc2a43289a5051753b3de8646fe36ab5 100755 --- a/configure +++ b/configure @@ -1035,6 +1035,8 @@ HAVE_LIST=" libdc1394_1 libdc1394_2 llrint + local_aligned_16 + local_aligned_8 log2 log2f loongson diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 2d8d41af849b00e08d0411518a055557c9eb8eff..af15d9687c90d94e7d3f645ff87bac52a40b046c 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -700,6 +700,22 @@ static inline void emms(void) # define STRIDE_ALIGN 8 #endif +#define LOCAL_ALIGNED(a, t, v, s, ...) \ + uint8_t la_##v[sizeof(t s __VA_ARGS__) + (a)]; \ + t (*v) __VA_ARGS__ = (void *)FFALIGN((uintptr_t)la_##v, a) + +#if HAVE_LOCAL_ALIGNED_8 +# define LOCAL_ALIGNED_8((t, v, s, ...) DECLARE_ALIGNED_8(t, v) s __VA_ARGS__ +#else +# define LOCAL_ALIGNED_8(t, v, s, ...) LOCAL_ALIGNED(8, t, v, s, __VA_ARGS__) +#endif + +#if HAVE_LOCAL_ALIGNED_16 +# define LOCAL_ALIGNED_16((t, v, s, ...) DECLARE_ALIGNED_16(t, v) s __VA_ARGS__ +#else +# define LOCAL_ALIGNED_16(t, v, s, ...) LOCAL_ALIGNED(16, t, v, s, __VA_ARGS__) +#endif + /* PSNR */ void get_psnr(uint8_t *orig_image[3], uint8_t *coded_image[3], int orig_linesize[3], int coded_linesize,