[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec kmvc.c, NONE, 1.1 Makefile, 1.250, 1.251 allcodecs.c, 1.134, 1.135 avcodec.h, 1.461, 1.462

Michael Niedermayer michaelni
Tue Apr 3 09:25:47 CEST 2007


Hi

On Tue, Apr 03, 2007 at 08:15:32AM +0300, Kostya wrote:
> On Mon, Apr 02, 2007 at 02:29:26AM +0200, Michael Niedermayer wrote:
> > Hi
> > 
> > On Fri, Apr 07, 2006 at 07:00:00PM +0200, Konstantin Shishkov CVS wrote:
> > > Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
> > > In directory mail:/var2/tmp/cvs-serv12938/libavcodec
> > > 
> > > Modified Files:
> > > 	Makefile allcodecs.c avcodec.h 
> > > Added Files:
> > > 	kmvc.c 
> > > Log Message:
> > > KMVC (used in Worms games) decoder. Works fine with samples from MPHQ
> > [...]
> > > #define kmvc_init_getbits(bb, src)  bb.bits = 7; bb.bitbuf = *src++;
> > > 
> > > #define kmvc_getbit(bb, src, res) {\
> > >     res = 0; \
> > >     if (bb.bitbuf & (1 << bb.bits)) res = 1; \
> > >     bb.bits--; \
> > >     if(bb.bits == -1) { \
> > >         bb.bitbuf = *src++; \
> > >         bb.bits = 7; \
> > >     } \
> > > }
> > 
> > is there a special reason why this is a macro and no inline function or
> > maybe even get_bits1() standard bitstream stuff ... ?
> 
> It cannot be get_bits1() as bits are grouped by 8 and are interwoven into
> data stream so it may be like this:
>  <pixel> <pixel> <bits> <pixel> <pixel> <pixel> <bits> <pixel> <bits>
> Also there is no need to use bitstream as everything is read by bytes.

ok


> 
> About macro vs. inline function - Is there any rule when to use which?
> I prefer to use macros in such situations.

i generally prefer inline functions as the compiler can, if size matters
simply decide not to inline it ...

of course if a macro is faster then a macro is better ...

[...]

-- 
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: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20070403/8ad8aa86/attachment.pgp>



More information about the ffmpeg-cvslog mailing list