[FFmpeg-devel] Patch for folding unaligned access routines into one file

Michael Niedermayer michaelni
Sun Jul 29 01:50:43 CEST 2007


Hi

On Fri, Jul 27, 2007 at 09:01:09PM -0700, Roman Shaposhnik wrote:
> Hi
> 
> On Sat, 2007-07-28 at 02:04 +0200, Michael Niedermayer wrote:
> > Hi
> > 
> > On Fri, Jul 27, 2007 at 01:40:16PM -0700, Roman Shaposhnick wrote:
> > > Guys,
> > > 
> > > while cleaning up the __GNUC__ thing I've come across one peculiarity: 
> > > it seems that we've got two sets of pretty much identical routines
> > > for accessing unaligned data residing in 
> > >     libavutil/intreadwrite.h
> > > and libavcodec/bitstream.h. 
> > > 
> > > The obvious question now is, should we fold them into one set by
> > > applying the attached patch?
> > 
> > yes but
> > maybe the folding of calls to stuff from intreadwrite.h / bitstream.h
> > should be folded in a seperate patch from the folding of the
> > implementations in *.h
> 
>   Let me see if I follow -- you want this to be split in two patches:
> first one would just move unalignedXX into intreadwrite.h as-is,
> and the second one would fold the implementation, right?

no

1. replace _use_ of unaligned*() by LD/ST/AV_RB*/...
2. fold the implementation

1. is changes like:

Index: ffmpeg/libavcodec/cavs.c
===================================================================
--- ffmpeg/libavcodec/cavs.c    (revision 9813)
+++ ffmpeg/libavcodec/cavs.c    (working copy)
@@ -212,7 +212,7 @@

 static void intra_pred_vert(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
     int y;
-    uint64_t a = unaligned64(&top[1]);
+    uint64_t a = LD64(&top[1]);
     for(y=0;y<8;y++) {
         *((uint64_t *)(d+y*stride)) = a;
     }


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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070729/0227faa1/attachment.pgp>



More information about the ffmpeg-devel mailing list