[Ffmpeg-devel] FLAC encoder

Justin Ruggles jruggle
Sun May 28 16:54:06 CEST 2006


Michael Niedermayer wrote:
> Hi
> 
> On Sun, May 28, 2006 at 12:32:36AM -0400, Justin Ruggles wrote:
> 
>>Here is an updated version of the encoder.
>>http://home.earthlink.net/~jruggle/flake/flake-01.tar.bz2
>>
>>What I did:
>>
>>Instead of doing brute-force bit counts and gradient search for the
>>optimal rice parameters, I used the log2(mean_residual_value).  This is
>>not 100% optimal for compression, but it's close, and it is much faster.
>>
>> First, the mean is calculated for each partition on the highest order
>>level. Then, each lower level mean is calculated by averaging each pair
>>of partitions from the level above.  In addition to calculating k, the
>>means are also used to estimate bit count.
> 
> 
> the same summing (of the most significant bits instead of all) from the
> previous 2 higher order partitions can be done with the exact method too
> (it was the simple but slower alternative i suggested)

I think I see what you're suggesting now.  I could more quickly
calculate the sums for each k by doing partial sums for each of the 32
bit positions then getting the bit count for each k by summing all
partial sums for position k and above.  Since my updated version
estimates k, this wouldn't really help, but when I add the brute-force
method back in, it will speed things up.  I am understanding this right?

> 
> 
> [...]
> 
>>  8    0m13.858s     2189192  0.414   584
>>
>>As a comparison, here is the same sample with the previous version:
>> 10    0m18.091s     2187875  0.413   583
>>
>>It might be worth taking out one of the lower levels and adding the old
>>brute-force search back in as level 8.
> 
> 
> yes, iam in favor of this
> 
> [...]
> 

Great. I'll put it back in and take out level 1, which seems to be
consistantly worse than level 0.

Thanks!
-Justin




More information about the ffmpeg-devel mailing list