[FFmpeg-devel] [PATCH/RFC] intreadwrite.h rewrite
Måns Rullgård
mans
Mon Apr 6 20:07:25 CEST 2009
Michael Niedermayer <michaelni at gmx.at> writes:
> On Sun, Apr 05, 2009 at 11:42:24PM +0100, M?ns Rullg?rd wrote:
>> I would like to propose a rework of intreadwrite.h. This new version
>> supports per-arch implementations of the various macros allowing us to
>> take advantage of special instructions or other properties the
>> compiler does not know about.
>
> [...]
>
>> /*
>> * GCC fails miserably on the packed struct version which is used by
>> * default, so we override it here.
>> */
>>
>> #define AV_RB64 AV_RB64
>> static inline uint64_t AV_RB64(const void *p)
>> {
>> return *(const uint64_t *)p;
>> }
>>
>> #define AV_WB64 AV_WB64
>> static inline void AV_WB64(void *p, uint64_t v)
>> {
>> *(uint64_t *)p = v;
>> }
>>
>
> why are these inline functions instead of macros?
No reason. I can certainly change it.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list