[FFmpeg-devel] [PATCH 7/7] Add alias-safe aligned AV_[RW]N macros

Michael Niedermayer michaelni
Fri Feb 5 10:51:59 CET 2010


On Sun, Jan 31, 2010 at 02:08:29AM +0000, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> 
> > On Fri, Jan 29, 2010 at 02:12:14AM +0000, Mans Rullgard wrote:
> >> ---
> >>  libavutil/intreadwrite.h |   32 ++++++++++++++++++++++++++++++++
> >>  1 files changed, 32 insertions(+), 0 deletions(-)
> >> 
> >> diff --git a/libavutil/intreadwrite.h b/libavutil/intreadwrite.h
> >> index 631db75..61ad488 100644
> >> --- a/libavutil/intreadwrite.h
> >> +++ b/libavutil/intreadwrite.h
> >> @@ -418,6 +418,38 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
> >>      } while(0)
> >>  #endif
> >>  
> >> +/*
> >> + * The AV_[RW]NA macros access naturally aligned data
> >> + * in a type-safe way.
> >> + */
> >> +
> >> +#define AV_RNA(s, p)    (((const ff_alias##s*)(p))->u##s)
> >> +#define AV_WNA(s, p, v) (((ff_alias##s*)(p))->u##s = (v))
> >
> > do we really need yet another set?
> 
> We need one set for aligned accesses and one for unaligned, yes.

yes i agree, doesnt mean i like it though

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100205/e7108443/attachment.pgp>



More information about the ffmpeg-devel mailing list