[FFmpeg-devel] [PATCH] Make HAVE_FAST_UNALIGNED allow unaligned memory accesses

Reimar Döffinger Reimar.Doeffinger
Tue Jul 15 21:25:11 CEST 2008

On Tue, Jul 15, 2008 at 08:16:21PM +0100, Mans Rullgard wrote:
> If HAVE_FAST_UNALIGNED is defined, potentially unaligned data is
> accessed through normal pointers.  Otherwise, compiler-specific
> code is used to perform unaligned accesses, falling back to
> byte-wise access if no compiler support is available.

Hm, IMO this changes a whole load of separate things.

> -#else /* __GNUC__ */
> +#elif defined(__DECC)
> +
> +#define AV_RN16(a) (*((const __unaligned uint16_t*)(a)))
> +#define AV_RN32(a) (*((const __unaligned uint32_t*)(a)))
> +#define AV_RN64(a) (*((const __unaligned uint64_t*)(a)))
> +
> +#define AV_WN16(a, b) *((__unaligned uint16_t*)(a)) = (b)
> +#define AV_WN32(a, b) *((__unaligned uint32_t*)(a)) = (b)
> +#define AV_WN64(a, b) *((__unaligned uint64_t*)(a)) = (b)
> +
> +#endif

At the very least this one should be applied separately, and IMO there
should be a comment what __DECC is supposed to stand for.

Reimar D?ffinger

More information about the ffmpeg-devel mailing list