[FFmpeg-cvslog] r15595 - trunk/libavcodec/aac_parser.c

Michael Niedermayer michaelni
Tue Dec 2 01:59:48 CET 2008


On Tue, Dec 02, 2008 at 02:40:02AM +0200, Uoti Urpala wrote:
> On Tue, 2008-12-02 at 00:05 +0000, M?ns Rullg?rd wrote:
> > Michael Niedermayer <michaelni at gmx.at> writes:
> > 
> > > On Sat, Oct 11, 2008 at 01:21:45PM +0200, mru wrote:
> > >> Author: mru
> > >> Date: Sat Oct 11 13:21:45 2008
> > >> New Revision: 15595
> > >> 
> > >> Log:
> > >> aac_parser: fix strict aliasing violation
> > >
> > > This change is insufficient, the code still is not working without
> > > -fno-strict-aliasing
> 
> > Damn.  It worked with all compilers I had installed at the time.  Can
> > you think of a solution?
> 
> static inline unsigned int working_get_bits(uint64_t state, int *remaining, n)
> {
>     *remaining -= n;
>     return (state >> *remaining) & (1 << n) - 1;
> }
> 
> I didn't test whether that really works, but it shouldn't need anything
> more complex (and you can use the same function for skip_bits). It
> should also be faster than using the bitstream reader machinery.

You can implement your idea above within the bitstream reader framework
if you think its that fast.
the reader that is used by default would (assuming the macros where used
directly like in speed relevant code) use only the following:

#define SHOW_BITS(n) (state>>(32-n))
#define SKIP_BITS(n) state<<=n

if this or your variant is faster depends probably on the compilers optimizer
and the relative speed of shifts and & on the CPU

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- 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-cvslog/attachments/20081202/04399046/attachment.pgp>



More information about the ffmpeg-cvslog mailing list