[FFmpeg-devel] [PATCH] AAC: unroll parts of decode_spectrum_and_dequant()

Michael Niedermayer michaelni
Tue Dec 9 13:02:11 CET 2008


On Mon, Dec 08, 2008 at 10:34:55PM -0500, Alex Converse wrote:
> On Mon, Dec 8, 2008 at 9:33 PM, Jason Garrett-Glaser
> <darkshikari at gmail.com>wrote:
> 
> > On Mon, Dec 8, 2008 at 3:43 PM, Alex Converse <alex.converse at gmail.com>
> > wrote:
> > > Hi,
> > >
> > > The attached patch unrolling sections of decode spectrum saves me 5.48%
> > on
> > > my mpeg4-lc-256kbps stream on my core2 duo.
> > >
> > > Regards,
> > > Alex Converse
> >
> > If dim can only be 2 or 4, wouldn't it be better to do
> >
> > if( dim == 4 ) {
> > do dim 4 stuff
> > }
> > do dim 2 stuff
> >
> > The switch seems unnecessary.
> >
> 
> Idiomatically I like the switch better but your way is faster. When I did

right, i should have realized too that gcc wouldnt be able to optimize
2 semantically identical statements to the same code. One wonders if this
should be reported to the gcc devels, it seems to me gcc should be able to
generate the same code from the switch. At least when the case is replaced
by default ...


> that I also tried reverting access back to forward order and got a slight
> speed up. This way made the unsigned loop just like the other three, so I
> added that one for another benchmarked verified speed up.
> 
> The net gain is a 12% decrease in cycles over the original vs 5% before.

very nice, i like the patch, but i see robert is back here and reviewing
patches so i leave things to him ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- 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/20081209/2d3a9de2/attachment.pgp>



More information about the ffmpeg-devel mailing list