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

Måns Rullgård mans
Tue Jul 15 21:34:00 CEST 2008

Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> writes:

> 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.

No, it makes HAVE_FAST_UNALIGNED mean what it intuitively suggests.
This is only used by the AV_[RW]* macros.

>> -#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.

Yes, I suppose it could be done separately.  It should also, as I
said in another mail, use proper configure checks.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list