[Ffmpeg-cvslog] r5577 - trunk/libavcodec/flacenc.c

Michael Niedermayer michaelni
Mon Jul 3 03:47:20 CEST 2006


Hi

On Sun, Jul 02, 2006 at 06:57:30PM +0100, M?ns Rullg?rd wrote:
> michael <subversion at mplayerhq.hu> writes:
> 
> > Author: michael
> > Date: Sun Jul  2 15:14:04 2006
> > New Revision: 5577
> >
> > Modified:
> >    trunk/libavcodec/flacenc.c
> >
> > Log:
> > 3 lines while -> 1 line for loop 
> >
> > Modified: trunk/libavcodec/flacenc.c
> > ==============================================================================
> > --- trunk/libavcodec/flacenc.c	(original)
> > +++ trunk/libavcodec/flacenc.c	Sun Jul  2 15:14:04 2006
> > @@ -788,13 +788,11 @@
> >  {
> >      int porder, max_parts;
> >
> > -    porder = max_porder;
> > -    while(porder > 0) {
> > +    for(porder = max_porder; porder > 0; porder--) {
> >          max_parts = (1 << porder);
> >          if(!(n % max_parts) && (n > max_parts*order)) {
> 
> Wouldn't (n & (max_parts - 1)) do the same thing a tad faster?  n is
> always positive so there should be no surprises.

yes, and furthermore iam pretty sure the whole can be done without a loop
something based on av_log2(n ^ (n-1)) or similar
and iam unsure if n > max_parts*order is correct which was the reason why
i didnt change anything in that line, i wanted to check that first ...


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

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-cvslog mailing list