[Ffmpeg-devel] [PATCH] THP PCM decoder (GSoC Qualification)

Reimar Doeffinger Reimar.Doeffinger
Thu Apr 5 09:29:03 CEST 2007


Hello,
On Thu, Apr 05, 2007 at 12:26:44AM +0200, Michael Niedermayer wrote:
> > +        long table[16][2];
> 
> why not int? the values stored in it seem to be limited to 16bit ...

long is useless anyway, since AFAIK we assume int to be 32 bit anyway.
long only has the advantage that it is faster when used as array index
on 64 bit systems, which is not relevant here.

> [...]
> > +        for (ch = 0; ch <= st; ch++) {
> > +            samples = (unsigned short *) data + ch;
> > +
> > +            /* Read in every sample for this channel.  */
> > +            for (i = 0; i < samplecnt / 14; i++) {
> > +                uint8_t index = get_bits (&gb, 4) & 7;
> > +                unsigned int exp = 1 << get_bits (&gb, 4);
> 
> storing "log2"(exp) instead of exp would avoid a multiply

And that was already like that in some other patch.

Greetings,
Reimar Doeffinger




More information about the ffmpeg-devel mailing list