comparison dsputil.h @ 11194:7b3f6955462b libavcodec

Add LOCAL_ALIGNED() macro for declaring aligned local arrays
author mru
date Wed, 17 Feb 2010 20:36:12 +0000
parents 34a65026fa06
children 4f3503b0dc07
comparison
equal deleted inserted replaced
11193:e5ebf3a17d9d 11194:7b3f6955462b
698 698
699 #ifndef STRIDE_ALIGN 699 #ifndef STRIDE_ALIGN
700 # define STRIDE_ALIGN 8 700 # define STRIDE_ALIGN 8
701 #endif 701 #endif
702 702
703 #define LOCAL_ALIGNED(a, t, v, s, ...) \
704 uint8_t la_##v[sizeof(t s __VA_ARGS__) + (a)]; \
705 t (*v) __VA_ARGS__ = (void *)FFALIGN((uintptr_t)la_##v, a)
706
707 #if HAVE_LOCAL_ALIGNED_8
708 # define LOCAL_ALIGNED_8((t, v, s, ...) DECLARE_ALIGNED_8(t, v) s __VA_ARGS__
709 #else
710 # define LOCAL_ALIGNED_8(t, v, s, ...) LOCAL_ALIGNED(8, t, v, s, __VA_ARGS__)
711 #endif
712
713 #if HAVE_LOCAL_ALIGNED_16
714 # define LOCAL_ALIGNED_16((t, v, s, ...) DECLARE_ALIGNED_16(t, v) s __VA_ARGS__
715 #else
716 # define LOCAL_ALIGNED_16(t, v, s, ...) LOCAL_ALIGNED(16, t, v, s, __VA_ARGS__)
717 #endif
718
703 /* PSNR */ 719 /* PSNR */
704 void get_psnr(uint8_t *orig_image[3], uint8_t *coded_image[3], 720 void get_psnr(uint8_t *orig_image[3], uint8_t *coded_image[3],
705 int orig_linesize[3], int coded_linesize, 721 int orig_linesize[3], int coded_linesize,
706 AVCodecContext *avctx); 722 AVCodecContext *avctx);
707 723