[FFmpeg-devel] [PATCH] WMA: use type punning and unroll loops in decode_exp_vlc()

Reimar Döffinger Reimar.Doeffinger
Tue Sep 29 13:44:13 CEST 2009


On Tue, Sep 29, 2009 at 11:40:36AM +0100, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> 
> > On Tue, Sep 29, 2009 at 09:10:49AM +0100, M?ns Rullg?rd wrote:
> >> Mans Rullgard <mans at mansr.com> writes:
> >> 
> >> > GCC does stupid things if these assignments are done using floats
> >> > directly, so fill the runs using integer operations instead.  Also
> >> > unroll the loops since the length is always a multiple of 4.
> >> > ---
> >> >  libavcodec/wmadec.c |   22 ++++++++++++++++------
> >> >  1 files changed, 16 insertions(+), 6 deletions(-)
> >> >
> >> > +        iv = AV_RN32(ptab + last_exp);
> >> 
> >> I don't know what I was thinking when I wrote that.  I've changed it
> >> to use a uint32_t pointer instead.
> >
> > float->uint32_t is ok
> 
> Those patches applied.

I'd appreciate if you'd run make test before such extensive changes.
Then you'd have noticed that n can be 0 in the loops you unrolled, which
causes a crash.



More information about the ffmpeg-devel mailing list