[SCM] libav/experimental: move unaligned access macros to dsputil.h - added unaligned 32 bit store

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:32:26 UTC 2013


The following commit has been merged in the experimental branch:
commit 6d4985bbdfa5000223523d3de079d68b66f0c90b
Author: Fabrice Bellard <fabrice at bellard.org>
Date:   Tue Jun 11 13:43:27 2002 +0000

    move unaligned access macros to dsputil.h - added unaligned 32 bit store
    
    Originally committed as revision 687 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index d76cc8d..624ecd0 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -252,21 +252,6 @@ void add_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size)
     }
 }
 
-#ifdef __GNUC__
-
-struct unaligned_64 { uint64_t l; } __attribute__((packed));
-struct unaligned_32 { uint32_t l; } __attribute__((packed));
-
-#define LD32(a) (((const struct unaligned_32 *) (a))->l)
-#define LD64(a) (((const struct unaligned_64 *) (a))->l)
-
-#else /* __GNUC__ */
-
-#define LD32(a) (*((uint32_t*)(a)))
-#define LD64(a) (*((uint64_t*)(a)))
-
-#endif /* !__GNUC__ */
-
 #if 0
 
 #define PIXOP2(OPNAME, OP) \
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index 8537333..0134a24 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -168,6 +168,25 @@ void dsputil_init_alpha(void);
 
 #endif
 
+#ifdef __GNUC__
+
+struct unaligned_64 { uint64_t l; } __attribute__((packed));
+struct unaligned_32 { uint32_t l; } __attribute__((packed));
+
+#define LD32(a) (((const struct unaligned_32 *) (a))->l)
+#define LD64(a) (((const struct unaligned_64 *) (a))->l)
+
+#define ST32(a, b) (((struct unaligned_32 *) (a))->l) = (b)
+
+#else /* __GNUC__ */
+
+#define LD32(a) (*((uint32_t*)(a)))
+#define LD64(a) (*((uint64_t*)(a)))
+
+#define ST32(a, b) *((uint32_t*)(a)) = (b)
+
+#endif /* !__GNUC__ */
+
 /* PSNR */
 void get_psnr(UINT8 *orig_image[3], UINT8 *coded_image[3],
               int orig_linesize[3], int coded_linesize,

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list