[Ffmpeg-devel] [PATCH] 24-bits flac support (with 16-bits output)

Dave Chapman dave
Wed Jun 21 13:26:56 CEST 2006


Luca Barbato wrote:
> Dave Chapman wrote:
> 
>>i.e. it might be more efficient to have an if statement to choose
>>between two loops - one performing 32x32->32 and one performing
>>32x32->64, depending on the precision required.
>>
> 
> 
> feel free to try this patch, if nobody complains I'll add it.
> 

For Rockbox, I used the same check that libFLAC does in order to decide
between the 32-bit and 64-bit loops:

if ((s->bps + coeff_prec + av_log2(pred_order)) <= 32) {
   32-bit loop
} else {
   64-bit loop
}

I admit to not fully understanding it, but if it's in the reference
decoder, it's good enough for me.

I'm assuming this means that for some frames of > 16-bit samples, it's
possible to use the 32-bit version of the loop without fear of overflow
- further optimising for CPUs where the 32x32->64 multiplication is
expensive.

Dave.





More information about the ffmpeg-devel mailing list