[FFmpeg-devel] [PATCH] MLP/TrueHD decoder
Michael Niedermayer
michaelni
Mon Oct 15 17:57:31 CEST 2007
Hi
On Mon, Oct 15, 2007 at 12:42:25PM +0100, Ian Caulfield wrote:
> 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?
is the area over which the crc is calculated not a multiple of 8bits ?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071015/6629cf27/attachment.pgp>
More information about the ffmpeg-devel
mailing list