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

Måns Rullgård mru
Sun Jul 2 19:57:30 CEST 2006


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.

>              break;
>          }
> -        porder--;
>      }
>      return porder;
>  }

-- 
M?ns Rullg?rd
mru at inprovide.com




More information about the ffmpeg-cvslog mailing list