[FFmpeg-devel] [PATCH] MLP/TrueHD decoder

Ian Caulfield ian.caulfield
Mon Oct 15 13:42:25 CEST 2007


On 14/10/2007, Michael Niedermayer <michaelni at gmx.at> wrote:
>
> > +/** Get a number of bits from a bitstream, updating a running CRC in the process */
> > +
> > +static av_always_inline unsigned int get_bits_crc(GetBitContext *gbp, int bit_count, uint8_t *crctab, uint8_t *crc)
> > +{
> > +    uint8_t crcval = *crc;
> > +    unsigned int data;
> > +    data = get_bits_long(gbp, bit_count);
> > +    while (bit_count > 8) {
> > +        crcval = crctab[crcval] ^ ((data >> (bit_count - 8)) & 0xff);
> > +        bit_count -= 8;
> > +    }
> > +    *crc = (crcval << bit_count)
> > +            ^ crctab[crcval >> (8 - bit_count)]
> > +            ^ (data & ((1 << bit_count) - 1));
> > +    return data;
> > +}
>
> please use the normal get_bits*() and av_crc() once over the whole data
>

Is it possible to use av_crc on fractional bytes?


Ian




More information about the ffmpeg-devel mailing list