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

Thibaut Mattern thibaut.mattern
Fri May 26 15:43:55 CEST 2006


On 5/26/06, Dave Chapman <dave at dchapman.com> wrote:
> Thibaut Mattern wrote:
> > Hi,
> >
> > there was some discussion last year about 24-bits flac support :
> >  http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/25992
>
> Thanks for doing what I promised to do at the time of that discussion....
>
> > the attached patch does two things :
> >  - fixes the overflow in the  decode_subframe_lpc function
>
> There is no need to perform 64-bit multiplications when decoding 16-bit
> audio - this will just slow the decoder down in the most common case.
> IMO, a better solution would be to work out in which cases a 32-bit loop
> would overflow, and use the 64-bit version only for those frames.

64-bit mult are not needed, we just need 32x32->64 bit mult. But i
don't know how to force the compiler to generate the 32*32->64 bits
instruction.
Maybe just doing that is enough :

sum += ((int64_t)coeffs[j] * s->decoded[channel][i-j-1]);

There is people with more knowledge about this here, they could
propose a better patch.

> I implemented that approach in the version of ffmpeg's flac.c that I
> adapted for Rockbox.  You can see that version of decode_subframe_lpc here:
>
> http://www.rockbox.org/viewcvs.cgi/apps/codecs/libffmpegFLAC/decoder.c?view=markup
>
> Regards,
>
> Dave.

Thibaut




More information about the ffmpeg-devel mailing list