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

Justin Ruggles jruggle
Mon Jul 3 08:49:58 CEST 2006


Michael Niedermayer wrote:
> 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 ...
> 
> 
> [...]

i finally figured it out. this patch works. it also fixes a couple bugs
related to partition order.

thanks!
-justin
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: flac-porder.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20060703/eb6c8446/attachment.asc>



More information about the ffmpeg-cvslog mailing list